diff --git a/btest b/btest index 15098eb5..d4799ce5 100755 --- a/btest +++ b/btest @@ -252,7 +252,17 @@ def runTestCommandLine(cmdline, measure_time, **kwargs): def runSubprocess(*args, **kwargs): def child(q): try: - subprocess.check_call(*args, **kwargs) + if sys.platform == 'win32': + tmpdir = normalize_path(kwargs.get('cwd', '')) + tf, tf_name = tempfile.mkstemp(suffix='.sh', dir=tmpdir) + fcontents = f'#!/usr/bin/env bash\n{" ".join(args)}\n' + with os.fdopen(tf, 'wb') as f: + f.write(fcontents.encode('utf-8')) + + cmd = ['bash.exe', '-c', normalize_path(tf_name)] + subprocess.check_call(cmd, **kwargs) + else: + subprocess.check_call(*args, **kwargs) success = True rc = 0