aboutsummaryrefslogtreecommitdiffstats
path: root/travis/nasm-t.py
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@gmail.com>2018-11-11 17:58:49 +0300
committerCyrill Gorcunov <gorcunov@gmail.com>2018-11-11 21:43:46 +0300
commit0f26c1ec54b8332f33c5db966390271d8f908435 (patch)
treee33f03ef385ea8e42d8dd598289c23e0804f0b50 /travis/nasm-t.py
parent292d728974117586aab439cf98dfe67dc66919cc (diff)
downloadnasm-0f26c1ec54b8332f33c5db966390271d8f908435.tar.gz
nasm-0f26c1ec54b8332f33c5db966390271d8f908435.tar.xz
nasm-0f26c1ec54b8332f33c5db966390271d8f908435.zip
test: nasm-t -- Add ability to pass environ variables to test
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Diffstat (limited to 'travis/nasm-t.py')
-rwxr-xr-xtravis/nasm-t.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/travis/nasm-t.py b/travis/nasm-t.py
index 49c547f3..e925a6ea 100755
--- a/travis/nasm-t.py
+++ b/travis/nasm-t.py
@@ -277,11 +277,24 @@ def exec_nasm(desc):
print("\tProcessing %s" % (desc['_test-name']))
opts = [args.nasm] + prepare_run_opts(desc)
+ desc_env = desc.get('environ')
+ if desc_env:
+ nasm_env = os.environ.copy()
+ for i in desc_env:
+ v = i.split('=')
+ if len(v) == 2:
+ nasm_env[v[0]] = v[1]
+ else:
+ nasm_env[v[0]] = None
+ else:
+ nasm_env = None
+
print("\tExecuting %s" % (" ".join(opts)))
pnasm = subprocess.Popen(opts,
stdout = subprocess.PIPE,
stderr = subprocess.PIPE,
- close_fds = True)
+ close_fds = True,
+ env = nasm_env)
if pnasm == None:
test_fail(desc['_test-name'], "Unable to execute test")
return None