From ecf612d11547b749f6db3107f5f07e713b9a83f0 Mon Sep 17 00:00:00 2001 From: Randy LeVeque Date: Wed, 19 Feb 2014 09:53:42 -0800 Subject: [PATCH] allow environment passed in to make_all so they can be set in run_tests.py --- src/python/clawutil/make_all.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/python/clawutil/make_all.py b/src/python/clawutil/make_all.py index 4e80419c..bfbc7fde 100644 --- a/src/python/clawutil/make_all.py +++ b/src/python/clawutil/make_all.py @@ -45,9 +45,14 @@ def list_examples(examples_dir): return dirlist -def make_all(examples_dir = '.',make_clean_first=False): +def make_all(examples_dir = '.',make_clean_first=False, env=None): import os,sys + if env is None: + my_env = os.environ + else: + my_env = env + examples_dir = os.path.abspath(examples_dir) if not os.path.isdir(examples_dir): raise Exception("Directory not found: %s" % examples_dir) @@ -103,7 +108,7 @@ def make_all(examples_dir = '.',make_clean_first=False): # Run 'make all': job = subprocess.Popen(['make','all'], \ - stdout=fout,stderr=ferr) + stdout=fout,stderr=ferr,env=my_env) return_code = job.wait() if return_code == 0: