mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-06 14:19:59 -05:00
Merge topic 'fileapi-check-script'
bb704d0390 Tests: Refactor RunCMake.FileAPI check script to support more arguments
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11215
This commit is contained in:
@@ -108,8 +108,10 @@ function(check_python case prefix)
|
||||
endif()
|
||||
file(GLOB index ${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/reply/${prefix}-*.json)
|
||||
execute_process(
|
||||
COMMAND ${Python_EXECUTABLE} "${RunCMake_SOURCE_DIR}/${case}-check.py" "${index}" "${CMAKE_CXX_COMPILER_ID}"
|
||||
"${RunCMake_TEST_BINARY_DIR}"
|
||||
COMMAND ${Python_EXECUTABLE} "${RunCMake_SOURCE_DIR}/${case}-check.py"
|
||||
--build-dir "${RunCMake_TEST_BINARY_DIR}"
|
||||
--reply-index "${index}"
|
||||
--cxx-compiler-id "${CMAKE_CXX_COMPILER_ID}"
|
||||
RESULT_VARIABLE result
|
||||
OUTPUT_VARIABLE output
|
||||
ERROR_VARIABLE output
|
||||
|
||||
@@ -2,6 +2,7 @@ import sys
|
||||
import os
|
||||
import json
|
||||
import re
|
||||
import argparse
|
||||
|
||||
if sys.version_info[0] >= 3:
|
||||
unicode = str
|
||||
@@ -158,8 +159,13 @@ def check_error_re(value, error):
|
||||
assert is_string(value["error"])
|
||||
assert re.search(error, value["error"])
|
||||
|
||||
reply_index = sys.argv[1]
|
||||
reply_dir = os.path.dirname(reply_index)
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--build-dir")
|
||||
parser.add_argument("--reply-index")
|
||||
parser.add_argument("--cxx-compiler-id")
|
||||
args = parser.parse_args()
|
||||
|
||||
with open(reply_index) as f:
|
||||
reply_dir = os.path.dirname(args.reply_index)
|
||||
|
||||
with open(args.reply_index) as f:
|
||||
index = json.load(f)
|
||||
|
||||
@@ -900,7 +900,7 @@ def gen_check_targets(c, g, inSource):
|
||||
e["compileGroups"] = apple_exe_framework["compileGroups"]
|
||||
e["link"] = apple_exe_framework["link"]
|
||||
|
||||
if cxx_compiler_id in ['Clang', 'AppleClang', 'LCC', 'GNU', 'Intel', 'IntelLLVM', 'MSVC', 'Embarcadero', 'CrayClang', 'IBMClang'] and g["name"] != "Xcode":
|
||||
if args.cxx_compiler_id in ['Clang', 'AppleClang', 'LCC', 'GNU', 'Intel', 'IntelLLVM', 'MSVC', 'Embarcadero', 'CrayClang', 'IBMClang'] and g["name"] != "Xcode":
|
||||
for e in expected:
|
||||
if e["name"] == "cxx_exe":
|
||||
if matches(g["name"], "^(Visual Studio |Ninja Multi-Config)"):
|
||||
@@ -1087,7 +1087,6 @@ def check_object_codemodel(g, major, minor):
|
||||
check_object_codemodel_configuration(c, g, major, minor, inSource)
|
||||
return _check
|
||||
|
||||
cxx_compiler_id = sys.argv[2]
|
||||
assert is_dict(index)
|
||||
assert sorted(index.keys()) == ["cmake", "objects", "reply"]
|
||||
check_objects(index["objects"], index["cmake"]["generator"])
|
||||
|
||||
@@ -77,7 +77,7 @@ def check_object_toolchain(o, expected):
|
||||
else:
|
||||
assert False
|
||||
|
||||
with open(os.path.join(sys.argv[3], "toolchain_variables.json")) as f:
|
||||
with open(os.path.join(args.build_dir, "toolchain_variables.json")) as f:
|
||||
variables = json.load(f)
|
||||
|
||||
assert is_dict(variables)
|
||||
|
||||
Reference in New Issue
Block a user