From d55aa1ad2aa2391eb6b32fa696867fd8b20e570b Mon Sep 17 00:00:00 2001 From: Michael Goddard Date: Mon, 25 Jul 2011 10:10:54 +1000 Subject: 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 Reviewed-by: Rohan McGovern --- bin/qtmodule-configtests | 31 +++++++++++++++++-------------- 1 file 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; -- cgit v1.2.3