diff options
author | Michael Goddard <michael.goddard@nokia.com> | 2011-07-25 10:10:54 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-07-26 13:40:07 +0200 |
commit | d55aa1ad2aa2391eb6b32fa696867fd8b20e570b (patch) | |
tree | 1ab3dd54863fe9856aef8032a2810ecc99534866 | |
parent | 33a55c5661299085c5e381f9aaf99b74ccc7b6b1 (diff) |
Tighten up the config test success checking.
Try a lot harder to remove the old $TARGET output, since make
clean isn't sufficient. Also fix a bug in program invocation
that was hidden because of the stale files.
Change-Id: I0a365409d81efb74c5836eaf9f129fd9b2cca77e
Reviewed-on: http://codereview.qt.nokia.com/2052
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
-rwxr-xr-x | bin/qtmodule-configtests | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/bin/qtmodule-configtests b/bin/qtmodule-configtests index a5c5899cc5..f6cc2052da 100755 --- a/bin/qtmodule-configtests +++ b/bin/qtmodule-configtests @@ -135,8 +135,7 @@ sub hashesAreDifferent { # Returns: The output. ###################################################################### sub executeSomething { - my @args = @_; - my $program = $args[0]; + my ($program, @args) = @_; my $pid = open(KID_TO_READ, "-|"); @@ -183,6 +182,10 @@ sub executeTest { my $testOutDir = catdir($out_basedir, 'config.tests', $testName); + # Since we might be cross compiling, look for barename (Linux) and .exe (Win32/Symbian) + my $testOutFile1 = catfile($testOutDir, "$testName.exe"); + my $testOutFile2 = catfile($testOutDir, $testName); + if (abs_path($basedir) eq abs_path($out_basedir)) { chdir $testOutDir or die "\nUnable to change to config test directory ($testOutDir): $!\n"; } else { # shadow build @@ -194,24 +197,24 @@ sub executeTest { push (@QMAKEARGS, catdir($basedir, 'config.tests', $testName)); } - # Throw it all away + # First remove existing stuff (XXX this probably needs generator specific code, but hopefully + # the target removal below will suffice) + if (-e "Makefile") { + executeSomething($MAKE, 'distclean'); + } + + # and any targets that we might find that weren't distcleaned + unlink $testOutFile1, $testOutFile2; + + # Run qmake && make executeSomething($QMAKE, @QMAKEARGS); - executeSomething($MAKE, 'clean'); my $makeOutput = executeSomething(($MAKE)); # If make prints "blah blah blah\nSkipped." we consider this a skipped test if ($makeOutput !~ qr(^Skipped\.$)ms) { - # Check the test exists (can't reliably execute, especially for cross compilation) - if ($^O =~ /win32/i) { - # On windows look for $testName.exe - if (-e catfile($testOutDir, "$testName.exe")) { - $ret = 1; - } - } else { - if (-e catfile($testOutDir, $testName)) { - $ret = 1; - } + if (-e $testOutFile1 or -e $testOutFile2) { + $ret = 1; } } else { $ret = 2; |