summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2019-06-06 10:31:03 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2019-06-06 08:38:08 +0000
commit4e907f1f62e2dc5676aeb48b99494709b7bf9d50 (patch)
treebfac3b0f6313b2e26a521226d0cf1406478060e8 /util
parent89b7f7671924f810c34637ee1f91de33a720521a (diff)
Fix comment fixup in pro2cmake
Comments should be removed before line continuations, otherwise the semantics of an assignment change. Found this during reconversion of qtimageformats. Adjust test to specifically test for all the expected values. Amends 76f5b784ce54730ed8d6ad4bb9c39c9a05c5d81d. Change-Id: Iaa46bbc9cbd7b2390fe9b5f0078ac33d225a9258 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'util')
-rwxr-xr-xutil/cmake/pro2cmake.py2
-rwxr-xr-xutil/cmake/tests/test_parsing.py19
2 files changed, 20 insertions, 1 deletions
diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py
index bfd791a196..2eda9b69d3 100755
--- a/util/cmake/pro2cmake.py
+++ b/util/cmake/pro2cmake.py
@@ -870,8 +870,8 @@ class QmakeParser:
contents = file_fd.read()
old_contents = contents
- contents = fixup_linecontinuation(contents)
contents = fixup_comments(contents)
+ contents = fixup_linecontinuation(contents)
if old_contents != contents:
print('Warning: Fixed line continuation in .pro-file!\n'
diff --git a/util/cmake/tests/test_parsing.py b/util/cmake/tests/test_parsing.py
index 11d1ed093f..f924b13913 100755
--- a/util/cmake/tests/test_parsing.py
+++ b/util/cmake/tests/test_parsing.py
@@ -308,6 +308,25 @@ def test_realworld_lc():
def test_realworld_lc_with_comment_in_between():
result = parse_file(_tests_path + '/data/lc_with_comment.pro')
+
+ my_var = result[1]['value'][0]
+ assert my_var == 'foo'
+
+ my_var = result[2]['value'][0]
+ assert my_var == 'foo2'
+
+ my_var = result[3]['value'][0]
+ assert my_var == 'foo3'
+
+ my_var = result[4]['value'][0]
+ assert my_var == 'foo4'
+
+ my_var = result[5]['value'][0]
+ assert my_var == 'foo5'
+
+ sub_dirs = result[0]['value']
+ assert sub_dirs[0] == 'tga'
+ assert sub_dirs[1] == 'wbmp'
assert len(result) == 6