#############################################################################
##
## Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-## All rights reserved.
## Contact: http://www.qt-project.org/
##
## This file is part of the build configuration tools of the Qt Toolkit.
##
##
##
+##
## $QT_END_LICENSE$
##
#############################################################################
use File::Spec::Functions qw/ :ALL /;
use File::Temp qw/ :POSIX /;
use Cwd;
-use Cwd 'abs_path';
use Config;
# Which file to look for the %configtests variable in
our %configtests;
-my $absOutDir = abs_path($out_basedir);
-my $qmakeCachePath = catfile($absOutDir, '.qmake.cache');
-my $configLogPath = catfile($absOutDir, 'config.log');
+my $qmakeCachePath = catfile($out_basedir, '.qmake.cache');
+my $configLogPath = catfile($out_basedir, 'config.log');
my $QMAKE = catfile($qtbasedir, "bin", ($^O =~ /win32/i) ? 'qmake.exe' : 'qmake');
if (!-x $QMAKE) {
my @QMAKEARGS = ('CONFIG-=debug_and_release', 'CONFIG-=app_bundle');
- my $testOutDir = catdir($absOutDir, 'config.tests', $testName);
+ 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)) {
+ if ($basedir eq $out_basedir) {
chdir $testOutDir or die "\nUnable to change to config test directory ($testOutDir): $!\n";
} else { # shadow build
if (! -e $testOutDir) {
unlink $testOutFile1, $testOutFile2;
# Run qmake && make
- executeLoggedCommand($QMAKE, @QMAKEARGS);
- my ($makeExitCode, $makeOutput) = executeLoggedCommand($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 (-e $testOutFile1 or -e $testOutFile2) {
- $ret = 1;
+ my ($qmakeExitCode, $qmakeOutput) = executeLoggedCommand($QMAKE, @QMAKEARGS);
+ if ($qmakeExitCode == 0) {
+ my ($makeExitCode, $makeOutput) = executeLoggedCommand($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 ($makeExitCode == 0 and (-e $testOutFile1 or -e $testOutFile2)) {
+ $ret = 1;
+ }
+ } else {
+ $ret = 2;
}
- } else {
- $ret = 2;
}
my $fh;
# Only do this step for modules that have config tests
# (qtbase doesn't). We try to preserve existing contents (and furthermore
# only write to .qmake.cache if the tests change)
-if (abs_path($out_basedir) ne abs_path($qtbasedir)) {
+if ($out_basedir ne $qtbasedir) {
# Read any existing content
my $existingContents = fileContents($qmakeCachePath);
my %oldTestResults;