Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions tests/std/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

set(STD_EXPECTED_RESULTS "${CMAKE_CURRENT_SOURCE_DIR}/expected_results.txt")
set(STD_TEST_OUTPUT_DIR "${STL_TEST_OUTPUT_DIR}/std")
set(STD_TEST_SUBDIRS_FILE "${CMAKE_CURRENT_SOURCE_DIR}/test.lst")
set(STD_TEST_SUBDIRS_ROOT "${CMAKE_CURRENT_SOURCE_DIR}")

configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
Expand Down
4 changes: 1 addition & 3 deletions tests/std/lit.site.cfg.in
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ lit_config.expected_results[config.name] = stl.test.file_parsing.parse_result_fi
lit_config.include_dirs[config.name] = \
['@STL_TESTED_HEADERS_DIR@', '@LIBCXX_SOURCE_DIR@/test/support', '@STL_SOURCE_DIR@/tests/std/include']
lit_config.library_dirs[config.name] = ['@CMAKE_LIBRARY_OUTPUT_DIRECTORY@', '@TOOLSET_LIB@']
lit_config.test_subdirs[config.name] = \
[os.path.normpath(os.path.join('@STD_TEST_SUBDIRS_ROOT@', path)) for \
path in stl.test.file_parsing.parse_commented_file('@STD_TEST_SUBDIRS_FILE@')]
lit_config.test_subdirs[config.name] = ['@CMAKE_CURRENT_SOURCE_DIR@/tests']

lit_config.cxx_headers = '@STL_TESTED_HEADERS_DIR@'
lit_config.cxx_runtime = '@CMAKE_RUNTIME_OUTPUT_DIRECTORY@'
Expand Down
7 changes: 7 additions & 0 deletions tests/std/tests/GH_000639_nvcc_include_all/env.lst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

PM_COMPILER="nvcc" PM_CL="--x cu -Xcompiler -Od,-EHsc,-nologo,-W4,-WX,-openmp"
RUNALL_CROSSLIST
PM_CL="-Xcompiler -MT"
PM_CL="--debug -Xcompiler -MTd"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

#define _MSVC_TESTING_NVCC

#include <__msvc_all_public_headers.hpp>
2 changes: 0 additions & 2 deletions tests/tr1/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

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
Expand Down
4 changes: 1 addition & 3 deletions tests/tr1/lit.site.cfg.in
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ lit_config.expected_results[config.name] = stl.test.file_parsing.parse_result_fi
lit_config.include_dirs[config.name] = \
['@STL_TESTED_HEADERS_DIR@', '@STL_SOURCE_DIR@/tests/tr1/include', '@STL_SOURCE_DIR@/tests/std/include']
lit_config.library_dirs[config.name] = ['@CMAKE_LIBRARY_OUTPUT_DIRECTORY@', '@TOOLSET_LIB@']
lit_config.test_subdirs[config.name] = \
[os.path.normpath(os.path.join('@TR1_TEST_SUBDIRS_ROOT@', path)) for \
path in stl.test.file_parsing.parse_commented_file('@TR1_TEST_SUBDIRS_FILE@')]
lit_config.test_subdirs[config.name] = ['@CMAKE_CURRENT_SOURCE_DIR@/tests']

lit_config.cxx_runtime = '@CMAKE_RUNTIME_OUTPUT_DIRECTORY@'
lit_config.target_arch = '@VCLIBS_TARGET_ARCHITECTURE@'
Expand Down
4 changes: 2 additions & 2 deletions tests/utils/stl/test/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ def configure(parameters, features, config, lit_config):

lit_config.flags[config.name] = []
lit_config.compile_flags[config.name] = \
['/I' + os.path.normpath(dir) for dir in lit_config.include_dirs[config.name]]
['-I' + os.path.normpath(dir) for dir in lit_config.include_dirs[config.name]]
lit_config.link_flags[config.name] = \
['/LIBPATH:' + os.path.normpath(dir) for dir in lit_config.library_dirs[config.name]]
['-LIBPATH:' + os.path.normpath(dir) for dir in lit_config.library_dirs[config.name]]

lit_config.test_env = {'PATH' : os.path.normpath(lit_config.cxx_runtime)}
8 changes: 4 additions & 4 deletions tests/utils/stl/test/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,20 +171,20 @@ def getBuildSteps(self, test, litConfig, shared):

shouldFail = TestType.FAIL in test.testType
if TestType.COMPILE in test.testType:
cmd = [test.cxx, '/c', test.getSourcePath(), *test.flags, *test.compileFlags]
cmd = [test.cxx, '-c', test.getSourcePath(), *test.flags, *test.compileFlags]
yield TestStep(cmd, shared.execDir, shared.env, shouldFail)
elif TestType.LINK in test.testType:
objFile = tmpBase + '.o'
cmd = [test.cxx, '/c', test.getSourcePath(), *test.flags, *test.compileFlags, '/Fo' + objFile]
cmd = [test.cxx, '-c', test.getSourcePath(), *test.flags, *test.compileFlags, '-Fo' + objFile]
yield TestStep(cmd, shared.execDir, shared.env, False)

exeFile = tmpBase + '.exe'
cmd = [test.cxx, objFile, *test.flags, '/Fe' + exeFile, '/link', *test.linkFlags]
cmd = [test.cxx, objFile, *test.flags, '-Fe' + exeFile, '-link', *test.linkFlags]
yield TestStep(cmd, shared.execDir, shared.env, shouldFail)
elif TestType.RUN in test.testType:
shared.execFile = tmpBase + '.exe'
cmd = [test.cxx, test.getSourcePath(), *test.flags, *test.compileFlags,
'/Fe' + shared.execFile, '/link', *test.linkFlags]
'-Fe' + shared.execFile, '-link', *test.linkFlags]
yield TestStep(cmd, shared.execDir, shared.env, False)

def getTestSetupSteps(self, test, litConfig, shared):
Expand Down
22 changes: 16 additions & 6 deletions tests/utils/stl/test/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ def configureTest(self, litConfig):
if result:
return result

self._handleEnvlst(litConfig)
result = self._handleEnvlst(litConfig)
if result:
return result

self._parseTest()
self._parseFlags()

Expand Down Expand Up @@ -171,18 +174,20 @@ def _handleEnvlst(self, litConfig):
envCompiler = self.envlstEntry.getEnvVal('PM_COMPILER', 'cl')

cxx = None
if not os.path.isfile(envCompiler):
if os.path.isfile(envCompiler):
cxx = envCompiler
else:
cxx = _compilerPathCache.get(envCompiler, None)

if cxx is None:
if not cxx:
searchPaths = self.config.environment['PATH']
cxx = shutil.which(envCompiler, path=searchPaths)
_compilerPathCache[envCompiler] = cxx
else:
cxx = envCompiler

if not cxx:
litConfig.fatal('Could not find: %r' % envCompiler)
litConfig.warning('Could not find: %r' % envCompiler)
return Result(SKIPPED, 'This test was skipped because the compiler, "' +
envCompiler + '", could not be found')

self.flags = copy.deepcopy(litConfig.flags[self.config.name])
self.compileFlags = copy.deepcopy(litConfig.compile_flags[self.config.name])
Expand All @@ -198,7 +203,12 @@ def _handleEnvlst(self, litConfig):
elif (targetArch == 'x86'.casefold()):
self.compileFlags.append('-m32')

if ('nvcc'.casefold() in os.path.basename(cxx).casefold()):
# nvcc only supports targeting x64
self.requires.append('x64')

self.cxx = os.path.normpath(cxx)
return None

def _parseFlags(self):
foundStd = False
Expand Down