mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-01-30 16:41:05 +08:00
test: nasm-t -- Add ability to pass environ variables to test
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
This commit is contained in:
parent
292d728974
commit
0f26c1ec54
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user