summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/FileAPI
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2019-11-15 18:01:36 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2019-12-13 15:51:46 (GMT)
commit5a8a9f72293ab1b3fd768ff40e5fb1f07cdb7dd2 (patch)
tree7e456292c9299223c3bd851261595f24371d2f3b /Tests/RunCMake/FileAPI
parent3bc63e99e44b3ef82c19d018f939ea839882a131 (diff)
downloadCMake-5a8a9f72293ab1b3fd768ff40e5fb1f07cdb7dd2.zip
CMake-5a8a9f72293ab1b3fd768ff40e5fb1f07cdb7dd2.tar.gz
CMake-5a8a9f72293ab1b3fd768ff40e5fb1f07cdb7dd2.tar.bz2
Ninja: Add multi-config variant
Co-Authored-by: vector-of-bool <vectorofbool@gmail.com>
Diffstat (limited to 'Tests/RunCMake/FileAPI')
-rw-r--r--Tests/RunCMake/FileAPI/check_index.py2
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-check.py24
2 files changed, 13 insertions, 13 deletions
diff --git a/Tests/RunCMake/FileAPI/check_index.py b/Tests/RunCMake/FileAPI/check_index.py
index 23b02e9..20243c0 100644
--- a/Tests/RunCMake/FileAPI/check_index.py
+++ b/Tests/RunCMake/FileAPI/check_index.py
@@ -113,7 +113,7 @@ def check_cmake_generator(g):
assert is_string(g["platform"])
else:
assert sorted(g.keys()) == ["multiConfig", "name"]
- assert is_bool(g["multiConfig"], matches(name, "^(Visual Studio |Xcode$)"))
+ assert is_bool(g["multiConfig"], matches(name, "^(Visual Studio |Xcode$|Ninja Multi-Config$)"))
def check_index_object(indexEntry, kind, major, minor, check):
assert is_dict(indexEntry)
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-check.py b/Tests/RunCMake/FileAPI/codemodel-v2-check.py
index 66c559d..de6253f 100644
--- a/Tests/RunCMake/FileAPI/codemodel-v2-check.py
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-check.py
@@ -621,12 +621,12 @@ def gen_check_directories(c, g):
},
]
- if matches(g, "^Visual Studio "):
+ if matches(g["name"], "^Visual Studio "):
for e in expected:
if e["parentSource"] is not None:
e["targetIds"] = filter_list(lambda t: not matches(t, "^\\^ZERO_CHECK"), e["targetIds"])
- elif g == "Xcode":
+ elif g["name"] == "Xcode":
if ';' in os.environ.get("CMAKE_OSX_ARCHITECTURES", ""):
for e in expected:
e["targetIds"] = filter_list(lambda t: not matches(t, "^\\^(link_imported_object_exe)"), e["targetIds"])
@@ -5087,13 +5087,13 @@ def gen_check_targets(c, g, inSource):
for s in e["sources"]:
s["path"] = s["path"].replace("^.*/Tests/RunCMake/FileAPI/", "^", 1)
if e["sourceGroups"] is not None:
- for g in e["sourceGroups"]:
- g["sourcePaths"] = [p.replace("^.*/Tests/RunCMake/FileAPI/", "^", 1) for p in g["sourcePaths"]]
+ for group in e["sourceGroups"]:
+ group["sourcePaths"] = [p.replace("^.*/Tests/RunCMake/FileAPI/", "^", 1) for p in group["sourcePaths"]]
if e["compileGroups"] is not None:
- for g in e["compileGroups"]:
- g["sourcePaths"] = [p.replace("^.*/Tests/RunCMake/FileAPI/", "^", 1) for p in g["sourcePaths"]]
+ for group in e["compileGroups"]:
+ group["sourcePaths"] = [p.replace("^.*/Tests/RunCMake/FileAPI/", "^", 1) for p in group["sourcePaths"]]
- if matches(g, "^Visual Studio "):
+ if matches(g["name"], "^Visual Studio "):
expected = filter_list(lambda e: e["name"] not in ("ZERO_CHECK") or e["id"] == "^ZERO_CHECK::@6890427a1f51a3e7e1df$", expected)
for e in expected:
if e["type"] == "UTILITY":
@@ -5130,7 +5130,7 @@ def gen_check_targets(c, g, inSource):
if matches(d["id"], "^\\^ZERO_CHECK::@"):
d["id"] = "^ZERO_CHECK::@6890427a1f51a3e7e1df$"
- elif g == "Xcode":
+ elif g["name"] == "Xcode":
if ';' in os.environ.get("CMAKE_OSX_ARCHITECTURES", ""):
expected = filter_list(lambda e: e["name"] not in ("link_imported_object_exe"), expected)
for e in expected:
@@ -5286,12 +5286,12 @@ def gen_check_projects(c, g):
},
]
- if matches(g, "^Visual Studio "):
+ if matches(g["name"], "^Visual Studio "):
for e in expected:
if e["parentName"] is not None:
e["targetIds"] = filter_list(lambda t: not matches(t, "^\\^ZERO_CHECK"), e["targetIds"])
- elif g == "Xcode":
+ elif g["name"] == "Xcode":
if ';' in os.environ.get("CMAKE_OSX_ARCHITECTURES", ""):
for e in expected:
e["targetIds"] = filter_list(lambda t: not matches(t, "^\\^(link_imported_object_exe)"), e["targetIds"])
@@ -5327,7 +5327,7 @@ def check_object_codemodel(g):
inSource = os.path.dirname(o["paths"]["build"]) == o["paths"]["source"]
- if matches(g, "^(Visual Studio |Xcode$)"):
+ if g["multiConfig"]:
assert sorted([c["name"] for c in o["configurations"]]) == ["Debug", "MinSizeRel", "RelWithDebInfo", "Release"]
else:
assert len(o["configurations"]) == 1
@@ -5339,4 +5339,4 @@ def check_object_codemodel(g):
assert is_dict(index)
assert sorted(index.keys()) == ["cmake", "objects", "reply"]
-check_objects(index["objects"], index["cmake"]["generator"]["name"])
+check_objects(index["objects"], index["cmake"]["generator"])