diff options
| author | Tobias Hunger <tobias.hunger@qt.io> | 2019-02-13 13:04:45 +0100 |
|---|---|---|
| committer | Tobias Hunger <tobias.hunger@qt.io> | 2019-02-28 08:06:49 +0000 |
| commit | eb832cb00ae231d31052e885d4482e34aeb2640d (patch) | |
| tree | b45dcd132c1a47a7db2415145d8b198244006057 /util/cmake/tests/test_parsing.py | |
| parent | 951e297362917675f605154ff6da89fb1acb3d40 (diff) | |
CMake: pro2cmake.py: Handle complex conditions
Change-Id: Ifb047e5736f1831ddbd65b210e760c2729378334
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'util/cmake/tests/test_parsing.py')
| -rwxr-xr-x | util/cmake/tests/test_parsing.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/util/cmake/tests/test_parsing.py b/util/cmake/tests/test_parsing.py index c238c80c084..f0c80f560e1 100755 --- a/util/cmake/tests/test_parsing.py +++ b/util/cmake/tests/test_parsing.py @@ -260,3 +260,17 @@ def test_realworld_complex_assign(): assert len(result) == 1 validate_op('qmake-clean.commands', '+=', '( cd qmake && $(MAKE) clean ":-(==)-:" \'(Foo)\' )'.split(), result[0]) + + +def test_realworld_complex_condition(): + result = parse_file(_tests_path + '/data/complex_condition.pro') + assert len(result) == 1 + (cond, if_branch, else_branch) = evaluate_condition(result[0]) + assert cond == '!system("dbus-send --session --type=signal / ' \ + 'local.AutotestCheck.Hello >$$QMAKE_SYSTEM_NULL_DEVICE ' \ + '2>&1")' + assert len(if_branch) == 1 + validate_op('SOURCES', '=', ['dbus.cpp'], if_branch[0]) + + assert len(else_branch) == 0 + |
