-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
118 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Copyright (c) Microsoft Corporation. | ||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
|
||
set(TR1_EXPECTED_RESULTS "${CMAKE_CURRENT_SOURCE_DIR}/expected_results.txt") | ||
set(TR1_TEST_OUTPUT_DIR "${STL_TEST_OUTPUT_DIR}/tr1") | ||
set(TR1_TEST_SUBDIRS_FILE "${CMAKE_CURRENT_SOURCE_DIR}/test.lst") | ||
set(TR1_TEST_SUBDIRS_ROOT "${CMAKE_CURRENT_SOURCE_DIR}") | ||
|
||
configure_file( | ||
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in | ||
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg) | ||
|
||
get_property(LLVM_LIT_CONFIG_MAP GLOBAL PROPERTY LLVM_LIT_CONFIG_MAP) | ||
string(APPEND LLVM_LIT_CONFIG_MAP "map_config(\"${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg\", \"${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg\")\n") | ||
set_property(GLOBAL PROPERTY LLVM_LIT_CONFIG_MAP ${LLVM_LIT_CONFIG_MAP}) | ||
|
||
if(ENABLE_XUNIT_OUTPUT) | ||
list(APPEND TR1_ADDITIONAL_LIT_FLAGS "--xunit-xml-output" "${CMAKE_CURRENT_BINARY_DIR}/tr1.test.xml") | ||
endif() | ||
|
||
list(APPEND TR1_LLVM_LIT_COMMAND "${LLVM_LIT_LOCATION}" | ||
"${ADDITIONAL_LIT_FLAGS}" | ||
"${TR1_ADDITIONAL_LIT_FLAGS}" | ||
"${CMAKE_CURRENT_BINARY_DIR}") | ||
|
||
add_test(NAME tr1 COMMAND ${Python3_EXECUTABLE} ${TR1_LLVM_LIT_COMMAND} COMMAND_EXPAND_LISTS) | ||
set_tests_properties(tr1 PROPERTIES RUN_SERIAL TRUE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Copyright (c) Microsoft Corporation. | ||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Copyright (c) Microsoft Corporation. | ||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
|
||
from pathlib import Path | ||
import importlib | ||
import site | ||
|
||
site.addsitedir(str(Path(__file__).parents[1] / "utils")) | ||
site.addsitedir(str(Path(__file__).parent / "tests")) | ||
|
||
config.name = 'tr1' | ||
config.suffixes.add('test.cpp') | ||
|
||
if config.test_source_root is None: | ||
config.test_source_root = str(Path(__file__).parent) | ||
|
||
config.test_exec_root = getattr(config, 'test_exec_root', None) | ||
|
||
if not config.test_exec_root: | ||
import tempfile | ||
config.test_exec_root = tempfile.mkdtemp(prefix=config.name + '-testsuite-') | ||
lit_config.note('Creating temporary directory for tests: %s' % config.test_exec_root) | ||
|
||
config_module_name = getattr(config, 'config_module_name', 'stl.test.config') | ||
config_module = importlib.import_module(config_module_name) | ||
|
||
configuration = config_module.Configuration(lit_config, config) | ||
configuration.configure() | ||
config.test_format = configuration.get_test_format() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Copyright (c) Microsoft Corporation. | ||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
|
||
config.cxx_archive_root = "@CMAKE_ARCHIVE_OUTPUT_DIRECTORY@" | ||
config.cxx_headers = "@STL_TESTED_HEADERS_DIR@" | ||
config.cxx_library_root = "@CMAKE_LIBRARY_OUTPUT_DIRECTORY@" | ||
config.cxx_runtime_root = "@CMAKE_RUNTIME_OUTPUT_DIRECTORY@" | ||
config.expected_results_list_path = "@TR1_EXPECTED_RESULTS@" | ||
config.include_dirs = ["@STL_SOURCE_DIR@/tests/tr1/include"] | ||
config.msvc_toolset_libs_root = "@TOOLSET_LIB@" | ||
config.stl_build_root = "@STL_BUILD_ROOT@" | ||
config.stl_src_root = "@STL_SOURCE_DIR@" | ||
config.target_arch = "@VCLIBS_TARGET_ARCHITECTURE@" | ||
config.test_exec_root = "@TR1_TEST_OUTPUT_DIR@" | ||
config.test_subdirs_file = "@TR1_TEST_SUBDIRS_FILE@" | ||
config.test_subdirs_root = "@TR1_TEST_SUBDIRS_ROOT@" | ||
|
||
lit_config.load_config(config, "@CMAKE_CURRENT_SOURCE_DIR@/lit.cfg") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Copyright (c) Microsoft Corporation. | ||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Copyright (c) Microsoft Corporation. | ||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
|
||
from stl.test.format import STLTestFormat, TestStep | ||
|
||
|
||
class CustomTestFormat(STLTestFormat): | ||
def getTestSteps(self, test, lit_config, shared): | ||
if shared.exec_file is None: | ||
for step in super().getTestSteps(test, lit_config, shared): | ||
yield step | ||
else: | ||
exec_env = test.cxx.compile_env | ||
exec_env['TMP'] = str(shared.exec_dir) | ||
|
||
yield TestStep([str(shared.exec_file)], shared.exec_dir, | ||
[shared.exec_file], exec_env) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Copyright (c) Microsoft Corporation. | ||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
|
||
import cwchar1.custom_format | ||
|
||
config.test_format = \ | ||
cwchar1.custom_format.CustomTestFormat(config.test_format.cxx, | ||
config.test_format.execute_external, | ||
config.test_format.build_executor, | ||
config.test_format.test_executor) |