summaryrefslogtreecommitdiffstats
path: root/util/cmake/tests/test_parsing.py
diff options
context:
space:
mode:
authorLeander Beernaert <leander.beernaert@qt.io>2019-08-08 13:21:23 +0200
committerLeander Beernaert <leander.beernaert@qt.io>2019-08-08 13:03:28 +0000
commit5d7bb2e4f084908a0e807ff8b0105f231bf74298 (patch)
tree2d95ad2396233d1c63d854c0a6edd127fb85d794 /util/cmake/tests/test_parsing.py
parent6396840182dd80518493c66fe025a4f032954dbd (diff)
Add support for converting qtTargetLibrary() value assignments
Add support to pro2cmake to handle variable assignments via functions, e.g: TARGET = $$qtTargetLibrary($$TARGET). The evalulation of the functions happens during parsing and is very rudementary in nature. Currently it only covers the qtTargetLibrary(), required for certain projects, and quote(), required for passing unit tests. If we run into any unhanlded function an exception will be thrown. This patch also changes the TARGET property on Scope to expand the value. Change-Id: I678b7058067348a3972944bdba110f556cf22447 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CMake Build Bot
Diffstat (limited to 'util/cmake/tests/test_parsing.py')
-rwxr-xr-xutil/cmake/tests/test_parsing.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/util/cmake/tests/test_parsing.py b/util/cmake/tests/test_parsing.py
index f924b139133..4019836ae18 100755
--- a/util/cmake/tests/test_parsing.py
+++ b/util/cmake/tests/test_parsing.py
@@ -343,3 +343,10 @@ def test_multi_condition_divided_by_lc():
def test_nested_function_calls():
result = parse_file(_tests_path + '/data/nested_function_calls.pro')
assert len(result) == 1
+
+def test_value_function():
+ result = parse_file(_tests_path + '/data/value_function.pro')
+ target = result[0]['value'][0]
+ assert target == 'Dummy'
+ value = result[1]['value']
+ assert value[0] == '$$TARGET'