diff options
author | Tobias Hunger <tobias.hunger@qt.io> | 2019-02-27 15:17:36 +0100 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@qt.io> | 2019-02-28 08:08:17 +0000 |
commit | 33fe56c630d9e59b2a33e28db5e062323d577d34 (patch) | |
tree | 5291ee4655198b578b4bdce663ddd1b59d31018c /util | |
parent | 754ba287999e0d1681f77d12f6d7c3ae0362745a (diff) |
CMake: pro2cmake.py: Make \$\$QT_FOO work in assignments
This broke somewhere along the way. Add a test for this.
Change-Id: I106ddff6eb86a51ef132285d1bc623f3b5cf71fb
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'util')
-rwxr-xr-x | util/cmake/pro2cmake.py | 2 | ||||
-rw-r--r-- | util/cmake/tests/data/escaped_value.pro | 2 | ||||
-rwxr-xr-x | util/cmake/tests/test_parsing.py | 7 |
3 files changed, 10 insertions, 1 deletions
diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 5d161a139a..1f76d9dedd 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -544,7 +544,7 @@ class QmakeParser: SubstitutionValue \ = pp.Combine(pp.OneOrMore(Substitution | LiteralValuePart | pp.Literal('$'))) - Value = pp.NotAny(Else | pp.Literal('}') | EOL | pp.Literal('\\')) \ + Value = pp.NotAny(Else | pp.Literal('}') | EOL) \ + (pp.QuotedString(quoteChar='"', escChar='\\') | SubstitutionValue | BracedValue) diff --git a/util/cmake/tests/data/escaped_value.pro b/util/cmake/tests/data/escaped_value.pro new file mode 100644 index 0000000000..7c95b1fc30 --- /dev/null +++ b/util/cmake/tests/data/escaped_value.pro @@ -0,0 +1,2 @@ +MODULE_AUX_INCLUDES = \ + \$\$QT_MODULE_INCLUDE_BASE/QtANGLE diff --git a/util/cmake/tests/test_parsing.py b/util/cmake/tests/test_parsing.py index 1f50fc87ab..dd4e5508f6 100755 --- a/util/cmake/tests/test_parsing.py +++ b/util/cmake/tests/test_parsing.py @@ -287,3 +287,10 @@ def test_realworld_sql(): assert len(result) == 2 validate_op('TEMPLATE', '=', ['subdirs'], result[0]) validate_op('SUBDIRS', '=', ['kernel'], result[1]) + + +def test_realworld_qtconfig(): + result = parse_file(_tests_path + '/data/escaped_value.pro') + assert len(result) == 1 + validate_op('MODULE_AUX_INCLUDES', '=', ['\\$\\$QT_MODULE_INCLUDE_BASE/QtANGLE'], result[0]) + |