diff options
Diffstat (limited to 'Tests/RunCMake/FileAPI/codemodel-v2-check.py')
-rw-r--r-- | Tests/RunCMake/FileAPI/codemodel-v2-check.py | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-check.py b/Tests/RunCMake/FileAPI/codemodel-v2-check.py index a3dd9ff..b567bf1 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, 1, check_object_codemodel(g)) + check_index_object(o[0], "codemodel", 2, 2, check_object_codemodel(g)) def check_backtrace(t, b, backtrace): btg = t["backtraceGraph"] @@ -42,6 +42,16 @@ def check_backtrace(t, b, backtrace): assert b is None +def check_backtraces(t, actual, expected): + assert is_list(actual) + assert is_list(expected) + assert len(actual) == len(expected) + + i = 0 + while i < len(actual): + check_backtrace(t, actual[i], expected[i]) + i += 1 + def check_directory(c): def _check(actual, expected): assert is_dict(actual) @@ -421,6 +431,19 @@ def check_target(c): missing_exception=lambda e: "Precompile header: %s" % e["header"], extra_exception=lambda a: "Precompile header: %s" % a["header"]) + if "languageStandard" in expected: + expected_keys.append("languageStandard") + + def check_language_standard(actual, expected): + assert is_dict(actual) + expected_keys = ["backtraces", "standard"] + assert actual["standard"] == expected["standard"] + check_backtraces(obj, actual["backtraces"], expected["backtraces"]) + + assert sorted(actual.keys()) == sorted(expected_keys) + + check_language_standard(actual["languageStandard"], expected["languageStandard"]) + if expected["defines"] is not None: expected_keys.append("defines") @@ -544,6 +567,8 @@ def gen_check_targets(c, g, inSource): read_codemodel_json_data("targets/zero_check_cxx.json"), read_codemodel_json_data("targets/cxx_lib.json"), read_codemodel_json_data("targets/cxx_exe.json"), + read_codemodel_json_data("targets/cxx_standard_compile_feature_exe.json"), + read_codemodel_json_data("targets/cxx_standard_exe.json"), read_codemodel_json_data("targets/cxx_shared_lib.json"), read_codemodel_json_data("targets/cxx_shared_exe.json"), read_codemodel_json_data("targets/cxx_static_lib.json"), @@ -592,6 +617,12 @@ def gen_check_targets(c, g, inSource): e["sources"] = precompile_header_data["sources"] e["sourceGroups"] = precompile_header_data["sourceGroups"] + if os.path.exists(os.path.join(reply_dir, "..", "..", "..", "..", "cxx", "cxx_std_11.txt")): + for e in expected: + if e["name"] == "cxx_standard_compile_feature_exe": + language_standard_data = read_codemodel_json_data("targets/cxx_standard_compile_feature_exe_languagestandard.json") + e["compileGroups"][0]["languageStandard"] = language_standard_data["languageStandard"] + if not os.path.exists(os.path.join(reply_dir, "..", "..", "..", "..", "ipo_enabled.txt")): for e in expected: try: |