Log which go exe is being used to run the tests

This commit is contained in:
Kovid Goyal 2022-08-16 09:49:20 +05:30
parent 2fd013b593
commit 14262b158d
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -113,7 +113,7 @@ def create_go_filter(packages: List[str], *names: str) -> str:
if not go:
return ''
all_tests = set()
for line in subprocess.check_output('go test -list .'.split() + packages).decode().splitlines():
for line in subprocess.check_output(f'{go} test -list .'.split() + packages).decode().splitlines():
if line.startswith('Test'):
all_tests.add(line[4:])
tests = set(names) & all_tests
@ -128,11 +128,11 @@ def run_go(packages: List[str], names: str) -> None:
if not packages:
print('Skipping Go tests as go source files not availabe', file=sys.stderr)
return
cmd = 'go test -v'.split()
cmd = [go, 'test', '-v']
if names:
cmd.extend(('-run', names))
cmd += packages
print(shlex.join(cmd))
print(shlex.join(cmd), flush=True)
os.execl(go, *cmd)