[llvm-commits] [LNT] r167204 - /lnt/trunk/lnt/tests/compile.py

Michael Gottesman mgottesman at apple.com
Wed Oct 31 19:07:28 PDT 2012


Author: mgottesman
Date: Wed Oct 31 21:07:28 2012
New Revision: 167204

URL: http://llvm.org/viewvc/llvm-project?rev=167204&view=rev
Log:
[compile test] Added an environ argument to runN/etc so that I can
specify additional environment variables if I so choose to.

Modified:
    lnt/trunk/lnt/tests/compile.py

Modified: lnt/trunk/lnt/tests/compile.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/tests/compile.py?rev=167204&r1=167203&r2=167204&view=diff
==============================================================================
--- lnt/trunk/lnt/tests/compile.py (original)
+++ lnt/trunk/lnt/tests/compile.py Wed Oct 31 21:07:28 2012
@@ -90,13 +90,14 @@
 
 def get_runN_test_data(name, variables, cmd, ignore_stderr=False,
                        sample_mem=False, only_mem=False,
-                       stdout=None, stderr=None, preprocess_cmd=None):
+                       stdout=None, stderr=None, preprocess_cmd=None, env=None):
     if only_mem and not sample_mem:
         raise ArgumentError,"only_mem doesn't make sense without sample_mem"
 
     data = runN(cmd, variables.get('run_count'), cwd='/tmp',
                 ignore_stderr=ignore_stderr, sample_mem=sample_mem,
-                stdout=stdout, stderr=stderr, preprocess_cmd=preprocess_cmd)
+                stdout=stdout, stderr=stderr, preprocess_cmd=preprocess_cmd,
+                env=env)
     if data is not None:
         if data.get('version') != 0:
             raise ValueError,'unknown runN data format'
@@ -314,6 +315,9 @@
         with open(last_unpack_hash_path, "w") as f:
             f.write(archive_hash)
 
+    # Create an env dict in case the user wants to use it.
+    env = dict(os.environ)
+    
     # Form the test build command.
     build_info = project['build_info']
     if build_info['style'].startswith('xcode-'):
@@ -374,7 +378,7 @@
 
     for res in get_runN_test_data(name, variables, cmd,
                                   stdout=stdout_path, stderr=stderr_path,
-                                  preprocess_cmd=preprocess_cmd):
+                                  preprocess_cmd=preprocess_cmd, env=env):
         yield res
 
     # Check that the file sizes of the output log files "make sense", and warn





More information about the llvm-commits mailing list