diff options
Diffstat (limited to 'tests/auto/tools/qmakelib/parsertest.cpp')
-rw-r--r-- | tests/auto/tools/qmakelib/parsertest.cpp | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/tests/auto/tools/qmakelib/parsertest.cpp b/tests/auto/tools/qmakelib/parsertest.cpp index dc92f98f45..70f1be5fc3 100644 --- a/tests/auto/tools/qmakelib/parsertest.cpp +++ b/tests/auto/tools/qmakelib/parsertest.cpp @@ -1684,6 +1684,57 @@ void tst_qmakelib::addParseCustomFunctions() /* 22 */ << H(TokTerminator)) << "" << true; + + QTest::newRow("bypassNesting()-{return}") + << "defineTest(test) { bypassNesting() { return(true) } }" + << TS( + /* 0 */ << H(TokLine) << H(1) + /* 2 */ << H(TokTestDef) << HS(L"test") + /* 10 */ /* body */ << I(16) + /* 12 */ << H(TokLine) << H(1) + /* 14 */ << H(TokBypassNesting) + /* 15 */ /* block */ << I(10) + /* 17 */ << H(TokLine) << H(1) + /* 19 */ << H(TokLiteral | TokNewStr) << S(L"true") + /* 25 */ << H(TokReturn) + /* 26 */ << H(TokTerminator) + /* 27 */ << H(TokTerminator)) + << "" + << true; + + QTest::newRow("test-AND-bypassNesting()-{}") + << "defineTest(test) { test: bypassNesting() {} }" + << TS( + /* 0 */ << H(TokLine) << H(1) + /* 2 */ << H(TokTestDef) << HS(L"test") + /* 10 */ /* body */ << I(17) + /* 12 */ << H(TokLine) << H(1) + /* 14 */ << H(TokHashLiteral) << HS(L"test") + /* 22 */ << H(TokCondition) + /* 23 */ << H(TokAnd) + /* 24 */ << H(TokBypassNesting) + /* 25 */ /* block */ << I(1) + /* 27 */ << H(TokTerminator) + /* 28 */ << H(TokTerminator)) + << "" + << true; + + QTest::newRow("test-OR-bypassNesting()-{}") + << "defineTest(test) { test| bypassNesting() {} }" + << TS( + /* 0 */ << H(TokLine) << H(1) + /* 2 */ << H(TokTestDef) << HS(L"test") + /* 10 */ /* body */ << I(17) + /* 12 */ << H(TokLine) << H(1) + /* 14 */ << H(TokHashLiteral) << HS(L"test") + /* 22 */ << H(TokCondition) + /* 23 */ << H(TokOr) + /* 24 */ << H(TokBypassNesting) + /* 25 */ /* block */ << I(1) + /* 27 */ << H(TokTerminator) + /* 28 */ << H(TokTerminator)) + << "" + << true; } void tst_qmakelib::addParseAbuse() @@ -1736,6 +1787,24 @@ void tst_qmakelib::addParseAbuse() << "in:1: Unexpected NOT operator in front of function definition." << false; + QTest::newRow("outer-bypassNesting()-{}") + << "bypassNesting() {}" + << TS() + << "in:1: Unexpected bypassNesting()." + << false; + + QTest::newRow("bypassNesting(arg)-{}") + << "defineTest(test) { bypassNesting(arg) {} }" + << TS() + << "in:1: bypassNesting() requires zero arguments." + << false; + + QTest::newRow("NOT-bypassNesting()-{}") + << "defineTest(test) { !bypassNesting() {} }" + << TS() + << "in:1: Unexpected NOT operator in front of bypassNesting()." + << false; + QTest::newRow("AND-test") << ":test" << TS( |