From 9ae00c7fb24016fe92fc7484bfadde0009cfe831 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sat, 15 Jan 2022 12:59:54 -0800 Subject: [PATCH] run_c: [nfc] factor out an array addition This will make an upcoming commit clearer and more concise. --- rtest/gvtest.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rtest/gvtest.py b/rtest/gvtest.py index 383cb8275..e91153b11 100644 --- a/rtest/gvtest.py +++ b/rtest/gvtest.py @@ -115,10 +115,11 @@ def run_c(src: Path, args: List[str] = None, input: str = "", compile_c(src, cflags, link, exe) # dump the command being run for the user to observe if the test fails - print(f'+ {exe} {" ".join(str(x) for x in args)}') + argv = [exe] + args + print(f'+ {" ".join(str(x) for x in argv)}') # run it - p = subprocess.run([exe] + args, input=input, stdout=subprocess.PIPE, + p = subprocess.run(argv, input=input, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True) # check it succeeded -- 2.40.0