summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/makefiles/conditionals.mk28
-rw-r--r--tests/tests.cpp3
2 files changed, 31 insertions, 0 deletions
diff --git a/tests/makefiles/conditionals.mk b/tests/makefiles/conditionals.mk
index a783e60..aecd32a 100644
--- a/tests/makefiles/conditionals.mk
+++ b/tests/makefiles/conditionals.mk
@@ -93,5 +93,33 @@ boo \
hoo
!ENDIF
+# Test !else if syntax (alternative to !elseif with space)
+TEST11=false
+!if "A" == "B"
+TEST11=false
+!else if "A"=="A"
+TEST11=true
+!else
+TEST11=false
+!endif
+
+TEST12=false
+!ifdef NOT_DEFINED
+TEST12=false
+!else ifdef TEST1
+TEST12=true
+!else
+TEST12=false
+!endif
+
+TEST13=false
+!ifdef NOT_DEFINED
+TEST13=false
+!else ifndef NOT_DEFINED
+TEST13=true
+!else
+TEST13=false
+!endif
+
all:
diff --git a/tests/tests.cpp b/tests/tests.cpp
index 21e1df6..f1c3fe3 100644
--- a/tests/tests.cpp
+++ b/tests/tests.cpp
@@ -333,6 +333,9 @@ void Tests::conditionals()
QCOMPARE(macroTable->macroValue("TEST8"), QLatin1String("true"));
QCOMPARE(macroTable->macroValue("TEST9"), QLatin1String("foo bar baz"));
QCOMPARE(macroTable->macroValue("TEST10"), QLatin1String("foo bar boo hoo"));
+ QCOMPARE(macroTable->macroValue("TEST11"), QLatin1String("true"));
+ QCOMPARE(macroTable->macroValue("TEST12"), QLatin1String("true"));
+ QCOMPARE(macroTable->macroValue("TEST13"), QLatin1String("true"));
}
void Tests::dotDirectives()