diff options
Diffstat (limited to 'tests/auto/tools/qmakelib/evaltest.cpp')
-rw-r--r-- | tests/auto/tools/qmakelib/evaltest.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/auto/tools/qmakelib/evaltest.cpp b/tests/auto/tools/qmakelib/evaltest.cpp index 03fd4753fd..387a2fb84e 100644 --- a/tests/auto/tools/qmakelib/evaltest.cpp +++ b/tests/auto/tools/qmakelib/evaltest.cpp @@ -2191,6 +2191,44 @@ void tst_qmakelib::addTestFunctions(const QString &qindir) << "" << true; + QTest::newRow("versionAtLeast(): true") + << "VAR = 1.2.3\nversionAtLeast(VAR, 1.2.3): OK = 1" + << "OK = 1" + << "" + << true; + + QTest::newRow("versionAtLeast(): false") + << "VAR = 1.2.2\nversionAtLeast(VAR, 1.2.3): OK = 1" + << "OK = UNDEF" + << "" + << true; + + QTest::newRow("versionAtLeast(): bad number of arguments") + << "versionAtLeast(1): OK = 1\nversionAtLeast(1, 2, 3): OK = 1" + << "OK = UNDEF" + << "##:1: versionAtLeast(variable, versionNumber) requires two arguments.\n" + "##:2: versionAtLeast(variable, versionNumber) requires two arguments." + << true; + + QTest::newRow("versionAtMost(): true") + << "VAR = 1.2.3\nversionAtMost(VAR, 1.2.3): OK = 1" + << "OK = 1" + << "" + << true; + + QTest::newRow("versionAtMost(): false") + << "VAR = 1.2.3\nversionAtMost(VAR, 1.2.2): OK = 1" + << "OK = UNDEF" + << "" + << true; + + QTest::newRow("versionAtMost(): bad number of arguments") + << "versionAtMost(1): OK = 1\nversionAtMost(1, 2, 3): OK = 1" + << "OK = UNDEF" + << "##:1: versionAtMost(variable, versionNumber) requires two arguments.\n" + "##:2: versionAtMost(variable, versionNumber) requires two arguments." + << true; + QTest::newRow("clear(): top-level") << "VAR = there\nclear(VAR): OK = 1" << "OK = 1\nVAR =" |