summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2016-08-23 14:05:54 +0200
committerOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2016-08-25 11:56:07 +0000
commit12bb328bb0be8efe54aae750c21938aab4d17539 (patch)
treee41933a511e6edeaccf3840d8897345971a3fdaf /tests
parent6a9f38a11d56bb3ba6ec59955f3220627c0d30b6 (diff)
add discard_from() function
this function discards all values that come from a specific file. it will be needed for configure bootstrapping, but is too obscure to document it for general use. Change-Id: I62c18aeb1847712e33d0599dbb0b90ffa1722438 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/tools/qmakelib/evaltest.cpp15
-rw-r--r--tests/auto/tools/qmakelib/testdata/include/inc.pri2
2 files changed, 16 insertions, 1 deletions
diff --git a/tests/auto/tools/qmakelib/evaltest.cpp b/tests/auto/tools/qmakelib/evaltest.cpp
index 1cd5c71531..62fcedddb9 100644
--- a/tests/auto/tools/qmakelib/evaltest.cpp
+++ b/tests/auto/tools/qmakelib/evaltest.cpp
@@ -2325,6 +2325,18 @@ void tst_qmakelib::addTestFunctions(const QString &qindir)
<< "##:1: load(feature) requires one or two arguments."
<< true;
+ QTest::newRow("discard_from()")
+ << "HERE = 1\nPLUS = one\ninclude(include/inc.pri)\ndiscard_from(include/inc.pri): OK = 1"
+ << "OK = 1\nHERE = 1\nPLUS = one\nVAR = UNDEF"
+ << ""
+ << true;
+
+ QTest::newRow("discard_from(): bad number of arguments")
+ << "discard_from(1, 2): OK = 1"
+ << "OK = UNDEF"
+ << "##:1: discard_from(file) requires one argument."
+ << true;
+
// We don't test debug() and log(), because they print directly to stderr.
QTest::newRow("message()")
@@ -2744,7 +2756,8 @@ void tst_qmakelib::proEval()
QMakeTestHandler handler;
handler.setExpectedMessages(msgs.replace("##:", infile + ':').split('\n', QString::SkipEmptyParts));
QMakeVfs vfs;
- QMakeParser parser(0, &vfs, &handler);
+ ProFileCache cache;
+ QMakeParser parser(&cache, &vfs, &handler);
QMakeGlobals globals;
globals.do_cache = false;
globals.xqmakespec = "fake-g++";
diff --git a/tests/auto/tools/qmakelib/testdata/include/inc.pri b/tests/auto/tools/qmakelib/testdata/include/inc.pri
index 1f1b3a287f..f9a4ec1bfa 100644
--- a/tests/auto/tools/qmakelib/testdata/include/inc.pri
+++ b/tests/auto/tools/qmakelib/testdata/include/inc.pri
@@ -1,6 +1,8 @@
VAR = val
.VAR = nope
+PLUS += more
+
fake-*: MATCH = 1
defineTest(func) {