[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kdesrc-build] /: Fix yet another QMake regression.
From:       Michael Pyne <mpyne () kde ! org>
Date:       2012-05-29 23:16:02
Message-ID: 20120529231602.49D88A60A9 () git ! kde ! org
[Download RAW message or body]

Git commit 5da44fdc63002f510bfb88fd6d68f4928c80df62 by Michael Pyne.
Committed on 30/05/2012 at 00:49.
Pushed by mpyne into branch 'master'.

Fix yet another QMake regression.

M  +3    -1    kdesrc-build
M  +13   -0    kdesrc-build-test.pl

http://commits.kde.org/kdesrc-build/5da44fdc63002f510bfb88fd6d68f4928c80df62

diff --git a/kdesrc-build b/kdesrc-build
index a7fce35..9267221 100755
--- a/kdesrc-build
+++ b/kdesrc-build
@@ -4132,6 +4132,8 @@ EOF
 
     our @ISA = ('GenericBuildSystem');
 
+    use List::Util qw(first);
+
     ksb::Debug->import();
     ksb::Util->import();
 
@@ -4153,7 +4155,7 @@ EOF
     sub absPathToQMake
     {
         my @possibilities = qw/qmake qmake4 qmake-qt4 qmake-mac/;
-        return grep { main::absPathToExecutable($_) } @possibilities;
+        return first { main::absPathToExecutable($_) } @possibilities;
     }
 
     # Return value style: boolean
diff --git a/kdesrc-build-test.pl b/kdesrc-build-test.pl
index cf47d33..e123b2b 100755
--- a/kdesrc-build-test.pl
+++ b/kdesrc-build-test.pl
@@ -502,6 +502,19 @@ $buildSystem = l10nSystem->new($ctx);
 ok (!$buildSystem->isSubdirBuildable('scripts'), 'l10n-build isSubdirBuildable-scripts');
 ok ($buildSystem->isSubdirBuildable(''), 'l10n-build isSubdirBuildable-other');
 
+# Note to packagers: This assumes qmake or qmake-qt4 are already installed on
+# the system.
+my @qmakePossibilities = QMakeBuildSystem::absPathToQMake();
+SKIP: {
+    is (scalar @qmakePossibilities, 1, 'Ensure exactly one qmake is returned from possibilities.')
+        or skip "Need a qmake candidate for next test", 1; # Skip next tests if no qmake
+    like ($qmakePossibilities[0], qr/^qmake/, 'qmake candidate looks like a qmake executable.');
+
+    # Duplicate test in scalar context the whole time.
+    my $newQMakePossibility = QMakeBuildSystem::absPathToQMake();
+    like ($newQMakePossibility, qr/^qmake/, 'qmake looks like an executable even in scalar context.');
+}
+
 done_testing();
 ### TESTS GO ABOVE THIS LINE
 }; # eval
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic