summaryrefslogtreecommitdiff
path: root/utils/libcxx/test
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-05-16 19:47:31 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-05-16 19:47:31 +0000
commit7582e3938bb9fb3e4664efdfb2313df29f27b70b (patch)
tree65bec6df3984fb0b437488fd86eb1359e9c84af4 /utils/libcxx/test
parent733153a0fb52facba02c550ec849f0c734dfa412 (diff)
Notes
Diffstat (limited to 'utils/libcxx/test')
-rw-r--r--utils/libcxx/test/config.py25
-rw-r--r--utils/libcxx/test/executor.py31
-rw-r--r--utils/libcxx/test/format.py2
3 files changed, 15 insertions, 43 deletions
diff --git a/utils/libcxx/test/config.py b/utils/libcxx/test/config.py
index 7f1ae851b9ce..25553c70da31 100644
--- a/utils/libcxx/test/config.py
+++ b/utils/libcxx/test/config.py
@@ -67,7 +67,7 @@ class Configuration(object):
self.abi_library_root = None
self.link_shared = self.get_lit_bool('enable_shared', default=True)
self.debug_build = self.get_lit_bool('debug_build', default=False)
- self.exec_env = {}
+ self.exec_env = dict(os.environ)
self.use_target = False
self.use_system_cxx_lib = False
self.use_clang_verify = False
@@ -160,7 +160,11 @@ class Configuration(object):
# Print as list to prevent "set([...])" from being printed.
self.lit_config.note('Using available_features: %s' %
list(self.config.available_features))
- self.lit_config.note('Using environment: %r' % self.exec_env)
+ show_env_vars = {}
+ for k,v in self.exec_env.items():
+ if k not in os.environ or os.environ[k] != v:
+ show_env_vars[k] = v
+ self.lit_config.note('Adding environment variables: %r' % show_env_vars)
sys.stderr.flush() # Force flushing to avoid broken output on Windows
def get_test_format(self):
@@ -546,6 +550,7 @@ class Configuration(object):
def configure_compile_flags_header_includes(self):
support_path = os.path.join(self.libcxx_src_root, 'test', 'support')
+ self.configure_config_site_header()
if self.cxx_stdlib_under_test != 'libstdc++' and \
not self.is_windows:
self.cxx.compile_flags += [
@@ -561,7 +566,6 @@ class Configuration(object):
'-include', os.path.join(support_path,
'set_windows_crt_report_mode.h')
]
- self.configure_config_site_header()
cxx_headers = self.get_lit_conf('cxx_headers')
if cxx_headers == '' or (cxx_headers is None
and self.cxx_stdlib_under_test != 'libc++'):
@@ -868,6 +872,9 @@ class Configuration(object):
# FIXME: Enable the two warnings below.
self.cxx.addWarningFlagIfSupported('-Wno-conversion')
self.cxx.addWarningFlagIfSupported('-Wno-unused-local-typedef')
+ # FIXME: Remove this warning once the min/max handling patch lands
+ # See https://reviews.llvm.org/D33080
+ self.cxx.addWarningFlagIfSupported('-Wno-#warnings')
std = self.get_lit_conf('std', None)
if std in ['c++98', 'c++03']:
# The '#define static_assert' provided by libc++ in C++03 mode
@@ -1002,18 +1009,8 @@ class Configuration(object):
sub.append(('%link', link_str))
sub.append(('%build', build_str))
# Configure exec prefix substitutions.
- exec_env_str = ''
- if not self.is_windows and len(self.exec_env) != 0:
- exec_env_str = 'env '
- for k, v in self.exec_env.items():
- exec_env_str += ' %s=%s' % (k, v)
# Configure run env substitution.
- exec_str = exec_env_str
- if self.lit_config.useValgrind:
- exec_str = ' '.join(self.lit_config.valgrindArgs) + exec_env_str
- sub.append(('%exec', exec_str))
- # Configure run shortcut
- sub.append(('%run', exec_str + ' %t.exe'))
+ sub.append(('%run', '%t.exe'))
# Configure not program substitutions
not_py = os.path.join(self.libcxx_src_root, 'utils', 'not.py')
not_str = '%s %s ' % (pipes.quote(sys.executable), pipes.quote(not_py))
diff --git a/utils/libcxx/test/executor.py b/utils/libcxx/test/executor.py
index 4a189174d915..0ccf96caa8ba 100644
--- a/utils/libcxx/test/executor.py
+++ b/utils/libcxx/test/executor.py
@@ -38,36 +38,11 @@ class LocalExecutor(Executor):
def run(self, exe_path, cmd=None, work_dir='.', file_deps=None, env=None):
cmd = cmd or [exe_path]
- env_cmd = []
- if env:
- env_cmd += ['env']
- env_cmd += ['%s=%s' % (k, v) for k, v in env.items()]
if work_dir == '.':
work_dir = os.getcwd()
- if not self.is_windows:
- out, err, rc = executeCommand(env_cmd + cmd, cwd=work_dir)
- else:
- out, err, rc = executeCommand(cmd, cwd=work_dir,
- env=self._build_windows_env(env))
- return (env_cmd + cmd, out, err, rc)
-
- def _build_windows_env(self, exec_env):
- # FIXME: Finding Windows DLL's at runtime requires modifying the
- # PATH environment variables. However we don't want to print out
- # the entire PATH as part of the diagnostic for every failing test.
- # Therefore this hack builds a new executable environment that
- # merges the current environment and the supplied environment while
- # still only printing the supplied environment in diagnostics.
- if not self.is_windows or exec_env is None:
- return None
- new_env = dict(os.environ)
- for key, value in exec_env.items():
- if key == 'PATH':
- assert value.strip() != '' and "expected non-empty path"
- new_env['PATH'] = "%s;%s" % (value, os.environ['PATH'])
- else:
- new_env[key] = value
- return new_env
+ out, err, rc = executeCommand(cmd, cwd=work_dir, env=env)
+ return (cmd, out, err, rc)
+
class PrefixExecutor(Executor):
"""Prefix an executor with some other command wrapper.
diff --git a/utils/libcxx/test/format.py b/utils/libcxx/test/format.py
index c3bc97187ad4..3ac5472b4720 100644
--- a/utils/libcxx/test/format.py
+++ b/utils/libcxx/test/format.py
@@ -139,7 +139,7 @@ class LibcxxTestFormat(object):
# We can't run ShTest tests with a executor yet.
# For now, bail on trying to run them
return lit.Test.UNSUPPORTED, 'ShTest format not yet supported'
- test.config.enviroment = dict(self.exec_env)
+ test.config.environment = dict(self.exec_env)
return lit.TestRunner._runShTest(test, lit_config,
self.execute_external, script,
tmpBase)