summaryrefslogtreecommitdiffstats
path: root/util/cmake/tests/test_parsing.py
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2019-05-23 11:53:41 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2019-05-23 14:17:46 +0000
commit6dfeb81bcb05360e83a55b519886014c55e8e771 (patch)
tree4b863091f50783179f9e97c3d09b7047ca44f52d /util/cmake/tests/test_parsing.py
parent80271e82807b4ac51d158398d08554925b9fcdd5 (diff)
Improve qmake syntax parser in pro2cmake.py
Some qtdeclarative pro files caused exceptions when trying to parse them using the script. This included the following: - handling conditions divided by newlines and backslashes - handling conditions that have no scope The parser has been fixed to deal with those cases and relevant tests were added. After the change, all qtdeclarative project files are parseable by the script. Change-Id: Ib9736423f7fb3bcc1944b26cfb3114306b4db9a7 Reviewed-by: Qt CMake Build Bot Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Diffstat (limited to 'util/cmake/tests/test_parsing.py')
-rwxr-xr-xutil/cmake/tests/test_parsing.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/util/cmake/tests/test_parsing.py b/util/cmake/tests/test_parsing.py
index c8feeb18114..11d1ed093f9 100755
--- a/util/cmake/tests/test_parsing.py
+++ b/util/cmake/tests/test_parsing.py
@@ -309,3 +309,18 @@ def test_realworld_lc():
def test_realworld_lc_with_comment_in_between():
result = parse_file(_tests_path + '/data/lc_with_comment.pro')
assert len(result) == 6
+
+
+def test_condition_without_scope():
+ result = parse_file(_tests_path + '/data/condition_without_scope.pro')
+ assert len(result) == 1
+
+
+def test_multi_condition_divided_by_lc():
+ result = parse_file(_tests_path + '/data/multi_condition_divided_by_lc.pro')
+ assert len(result) == 1
+
+
+def test_nested_function_calls():
+ result = parse_file(_tests_path + '/data/nested_function_calls.pro')
+ assert len(result) == 1