[libcxx] r302713 - Clean up LIT failure output by not showing the entire environment

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Wed May 10 12:55:42 PDT 2017


Author: ericwf
Date: Wed May 10 14:55:42 2017
New Revision: 302713

URL: http://llvm.org/viewvc/llvm-project?rev=302713&view=rev
Log:
Clean up LIT failure output by not showing the entire environment

Modified:
    libcxx/trunk/utils/libcxx/test/executor.py

Modified: libcxx/trunk/utils/libcxx/test/executor.py
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/utils/libcxx/test/executor.py?rev=302713&r1=302712&r2=302713&view=diff
==============================================================================
--- libcxx/trunk/utils/libcxx/test/executor.py (original)
+++ libcxx/trunk/utils/libcxx/test/executor.py Wed May 10 14:55:42 2017
@@ -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)
+        out, err, rc = executeCommand(cmd, cwd=work_dir, env=env)
+        return (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
 
 class PrefixExecutor(Executor):
     """Prefix an executor with some other command wrapper.




More information about the cfe-commits mailing list