diff options
author | Justin Goshi <jgoshi@microsoft.com> | 2020-04-28 23:45:43 (GMT) |
---|---|---|
committer | kitware <kitware@dragnipur.kitware.com> | 2020-05-22 15:26:55 (GMT) |
commit | 9f6d40ee23113f1317e54d662316752adb9f368e (patch) | |
tree | bb76716817e572ebca342577c2e555446eb5406d /Tests/RunCMake/FileAPI/codemodel-v2-check.py | |
parent | b698764a316d346e3c1bc33c7a88b5a09f144ad6 (diff) | |
download | CMake-9f6d40ee23113f1317e54d662316752adb9f368e.zip CMake-9f6d40ee23113f1317e54d662316752adb9f368e.tar.gz CMake-9f6d40ee23113f1317e54d662316752adb9f368e.tar.bz2 |
fileapi: Extend codemodel targets with PRECOMPILE_HEADERS
Diffstat (limited to 'Tests/RunCMake/FileAPI/codemodel-v2-check.py')
-rw-r--r-- | Tests/RunCMake/FileAPI/codemodel-v2-check.py | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-check.py b/Tests/RunCMake/FileAPI/codemodel-v2-check.py index 143e784..a3dd9ff 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-check.py +++ b/Tests/RunCMake/FileAPI/codemodel-v2-check.py @@ -12,7 +12,7 @@ def read_codemodel_json_data(filename): def check_objects(o, g): assert is_list(o) assert len(o) == 1 - check_index_object(o[0], "codemodel", 2, 0, check_object_codemodel(g)) + check_index_object(o[0], "codemodel", 2, 1, check_object_codemodel(g)) def check_backtrace(t, b, backtrace): btg = t["backtraceGraph"] @@ -404,6 +404,23 @@ def check_target(c): missing_exception=lambda e: "Include path: %s" % e["path"], extra_exception=lambda a: "Include path: %s" % a["path"]) + if "precompileHeaders" in expected: + expected_keys.append("precompileHeaders") + + def check_precompile_header(actual, expected): + assert is_dict(actual) + expected_keys = ["backtrace", "header"] + check_backtrace(obj, actual["backtrace"], expected["backtrace"]) + + assert sorted(actual.keys()) == sorted(expected_keys) + + check_list_match(lambda a, e: matches(a["header"], e["header"]), + actual["precompileHeaders"], expected["precompileHeaders"], + check=check_precompile_header, + check_exception=lambda a, e: "Precompile header: %s" % a["header"], + missing_exception=lambda e: "Precompile header: %s" % e["header"], + extra_exception=lambda a: "Precompile header: %s" % a["header"]) + if expected["defines"] is not None: expected_keys.append("defines") |