project tests: add log of the setup command being run

Followup to commit 2acb6ee79e.
pull/10779/head
Eli Schwartz 2 years ago
parent a024d75e15
commit cfc1abcfaf
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
  1. 9
      run_project_tests.py
  2. 6
      run_tests.py

@ -654,16 +654,19 @@ def _run_test(test: TestDef,
gen_args.extend(['--native-file', nativefile.as_posix()])
if crossfile.exists():
gen_args.extend(['--cross-file', crossfile.as_posix()])
(returncode, stdo, stde) = run_configure(gen_args, env=test.env, catch_exception=True)
inprocess, res = run_configure(gen_args, env=test.env, catch_exception=True)
returncode, stdo, stde = res
cmd = '(inprocess) $ ' if inprocess else '$ '
cmd += mesonlib.join_args(gen_args)
try:
logfile = Path(test_build_dir, 'meson-logs', 'meson-log.txt')
with logfile.open(errors='ignore', encoding='utf-8') as fid:
mesonlog = fid.read()
mesonlog = '\n'.join((cmd, fid.read()))
except Exception:
mesonlog = no_meson_log_msg
cicmds = run_ci_commands(mesonlog)
testresult = TestResult(cicmds)
testresult.add_step(BuildStep.configure, stdo, stde, mesonlog, time.time() - gen_start)
testresult.add_step(BuildStep.configure, '\n'.join((cmd, stdo)), stde, mesonlog, time.time() - gen_start)
output_msg = validate_output(test, stdo, stde)
testresult.mlog += output_msg
if output_msg:

@ -327,11 +327,11 @@ def run_configure_external(full_command: T.List[str], env: T.Optional[T.Dict[str
pc, o, e = mesonlib.Popen_safe(full_command, env=env)
return pc.returncode, o, e
def run_configure(commandlist: T.List[str], env: T.Optional[T.Dict[str, str]] = None, catch_exception: bool = False) -> T.Tuple[int, str, str]:
def run_configure(commandlist: T.List[str], env: T.Optional[T.Dict[str, str]] = None, catch_exception: bool = False) -> T.Tuple[bool, T.Tuple[int, str, str]]:
global meson_exe
if meson_exe:
return run_configure_external(meson_exe + commandlist, env=env)
return run_configure_inprocess(commandlist, env=env, catch_exception=catch_exception)
return (False, run_configure_external(meson_exe + commandlist, env=env))
return (True, run_configure_inprocess(commandlist, env=env, catch_exception=catch_exception))
def print_system_info():
print(mlog.bold('System information.'))

Loading…
Cancel
Save