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