Add tools/test.py test runner. (#384)

This commit is contained in:
Ryan Dahl 2018-07-21 19:08:24 -04:00 committed by GitHub
parent 709b0cb90c
commit dff5c16e85
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 90 additions and 12 deletions

View file

@ -3,6 +3,8 @@
import os
import subprocess
executable_suffix = ".exe" if os.name == "nt" else ""
def run(args, quiet=False, envs={}):
if not quiet:
@ -10,10 +12,9 @@ def run(args, quiet=False, envs={}):
env = os.environ.copy()
for key in envs.keys():
env[key] = envs[key]
if os.name == "nt":
# Run through shell to make .bat/.cmd files work.
args = ["cmd", "/c"] + args
subprocess.check_call(args, env=env)
args[0] = os.path.normpath(args[0])
shell = os.name == "nt" # Run through shell to make .bat/.cmd files work.
subprocess.check_call(args, env=env, shell=shell)
def remove_and_symlink(target, name, target_is_dir=False):