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
3 changes: 2 additions & 1 deletion tests/utils/stl/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class CXXCompiler:
CM_Analyze = 4

def __init__(self, path, flags=None, compile_flags=None,
link_flags=None, compile_env=None):
link_flags=None, compile_env=None, edg_drop=None):
self.path = path
if path is not None:
self.name = os.path.basename(path).split('.')[0]
Expand All @@ -34,6 +34,7 @@ def __init__(self, path, flags=None, compile_flags=None,
self.link_flags = link_flags or []

self.compile_env = compile_env
self.edg_drop = edg_drop

def _basicCmd(self, source_files: List[Path], out: Path,
mode=CM_Default, flags=[], compile_flags=[], link_flags=[],
Expand Down
4 changes: 4 additions & 0 deletions tests/utils/stl/test/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,10 @@ def configure_default_compiler(self):

self.default_compiler.compile_env = self.config.environment

env_var = 'STL_EDG_DROP'
if env_var in os.environ and os.environ[env_var] is not None:
self.default_compiler.edg_drop = os.environ[env_var]

# TRANSITION: Investigate using SSHExecutor for ARM
def configure_executors(self):
self.build_executor = LocalExecutor()
Expand Down
32 changes: 31 additions & 1 deletion tests/utils/stl/test/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,14 +244,44 @@ def getBuildSteps(self, test, lit_config, shared):
output_dir = test.getOutputDir()
source_path = Path(test.getSourcePath())

flags = []
isense_rsp_path = None
if test.cxx.edg_drop is not None:
isense_rsp_path = output_dir / (output_base + '.isense.rsp')
flags.extend(['/dE--write-isense-rsp', '/dE' + str(isense_rsp_path)])

cmd, out_files, shared.exec_file = \
test.cxx.executeBasedOnFlagsCmd([source_path], output_dir,
shared.exec_dir, output_base,
[], [], [])
flags, [], [])

yield TestStep(cmd, shared.exec_dir, [source_path],
test.cxx.compile_env)

if isense_rsp_path is not None:
with open(isense_rsp_path) as f:
cmd = [line.strip() for line in f]
cmd[0] = test.cxx.edg_drop

# cpfecl translates /Fo into --import_dir, but that is not
# used in the same way by upstream EDG.
try:
index = cmd.index('--import_dir')
cmd.pop(index)
cmd.pop(index)
except ValueError:
pass

# --print_diagnostics is not recognized by upstream EDG.
try:
index = cmd.index('--print_diagnostics')
cmd.pop(index)
except ValueError:
pass

yield TestStep(cmd, shared.exec_dir, [source_path],
test.cxx.compile_env)

def getTestSteps(self, test, lit_config, shared):
if shared.exec_file is not None:
exec_env = test.cxx.compile_env
Expand Down
7 changes: 6 additions & 1 deletion tests/utils/stl/test/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,18 @@ def __init__(self, suite, path_in_suite, lit_config, test_config,

self._configure_cxx(lit_config, envlst_entry, default_cxx)

use_edg = False
for flag in chain(self.cxx.flags, self.cxx.compile_flags):
if flag[1:] == 'clr:pure':
self.requires.append('clr_pure') # TRANSITION, GH-798
elif flag[1:] == 'clr':
self.requires.append('clr') # TRANSITION, GH-797
elif flag[1:] == 'BE':
self.requires.append('edg') # available for x86, see config.py
use_edg = True

if not use_edg and self.cxx.edg_drop is not None:
self.skipped = True

def getOutputDir(self):
return Path(os.path.join(
Expand Down Expand Up @@ -142,7 +147,7 @@ def _configure_cxx(self, lit_config, envlst_entry, default_cxx):
compile_flags.append('-m32')

self.cxx = CXXCompiler(cxx, flags, compile_flags, link_flags,
default_cxx.compile_env)
default_cxx.compile_env, default_cxx.edg_drop)

# This is partially lifted from lit's Test class. The changes here are to
# handle skipped tests, our env.lst format, and different naming schemes.
Expand Down