This commit is contained in:
Curtis J Bezault 2020-03-29 18:16:33 -07:00 коммит произвёл GitHub
Родитель ff83542af4
Коммит 811c8c1816
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
11 изменённых файлов: 118 добавлений и 1 удалений

Просмотреть файл

@ -109,3 +109,12 @@ jobs:
testResultsFormat: JUnit
testResultsFiles: '**/std.test.xml'
testRunTitle: 'std-${{ parameters.targetPlatform }}'
- task: PublishTestResults@2
displayName: 'Publish tr1 Tests'
timeoutInMinutes: 10
condition: in('${{ parameters.targetPlatform }}', 'x64', 'x86')
inputs:
searchFolder: $(Build.ArtifactStagingDirectory)/${{ parameters.targetPlatform }}
testResultsFormat: JUnit
testResultsFiles: '**/tr1.test.xml'
testRunTitle: 'tr1-${{ parameters.targetPlatform }}'

Просмотреть файл

@ -31,8 +31,9 @@ set(LLVM_LIT_LOCATION "${LIT_BASE_DIR}/${LIT_FILE_NAME}")
set(Python_FIND_STRATEGY VERSION)
find_package(Python3)
add_subdirectory(std)
add_subdirectory(libcxx)
add_subdirectory(std)
add_subdirectory(tr1)
# Add the llvm-lit subdirectory last so all the test directories have had a
# chance to add to the config map.

Просмотреть файл

@ -732,6 +732,7 @@ std/utilities/utility/pairs/pairs.pair/assign_pair.pass.cpp SKIP
std/thread/futures/futures.async/async.pass.cpp SKIP
std/thread/futures/futures.shared_future/get.pass.cpp SKIP
std/thread/futures/futures.shared_future/wait_for.pass.cpp SKIP
std/thread/futures/futures.shared_future/wait.pass.cpp SKIP
std/thread/futures/futures.unique_future/wait_for.pass.cpp SKIP
std/thread/futures/futures.unique_future/wait.pass.cpp SKIP
std/thread/thread.condition/thread.condition.condvar/notify_all.pass.cpp SKIP

Просмотреть файл

@ -732,6 +732,7 @@ utilities\utility\pairs\pairs.pair\assign_pair.pass.cpp
thread\futures\futures.async\async.pass.cpp
thread\futures\futures.shared_future\get.pass.cpp
thread\futures\futures.shared_future\wait_for.pass.cpp
thread\futures\futures.shared_future\wait.pass.cpp
thread\futures\futures.unique_future\wait_for.pass.cpp
thread\futures\futures.unique_future\wait.pass.cpp
thread\thread.condition\thread.condition.condvar\notify_all.pass.cpp

27
tests/tr1/CMakeLists.txt Normal file
Просмотреть файл

@ -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)

Просмотреть файл

@ -0,0 +1,2 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

29
tests/tr1/lit.cfg Normal file
Просмотреть файл

@ -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()

18
tests/tr1/lit.site.cfg.in Normal file
Просмотреть файл

@ -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")

Просмотреть файл

@ -0,0 +1,2 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

Просмотреть файл

@ -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)

Просмотреть файл

@ -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)