project tests: add log of the setup command being run
Followup to commit 2acb6ee79e
.
This commit is contained in:
parent
a024d75e15
commit
cfc1abcfaf
|
@ -654,16 +654,19 @@ def _run_test(test: TestDef,
|
||||||
gen_args.extend(['--native-file', nativefile.as_posix()])
|
gen_args.extend(['--native-file', nativefile.as_posix()])
|
||||||
if crossfile.exists():
|
if crossfile.exists():
|
||||||
gen_args.extend(['--cross-file', crossfile.as_posix()])
|
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:
|
try:
|
||||||
logfile = Path(test_build_dir, 'meson-logs', 'meson-log.txt')
|
logfile = Path(test_build_dir, 'meson-logs', 'meson-log.txt')
|
||||||
with logfile.open(errors='ignore', encoding='utf-8') as fid:
|
with logfile.open(errors='ignore', encoding='utf-8') as fid:
|
||||||
mesonlog = fid.read()
|
mesonlog = '\n'.join((cmd, fid.read()))
|
||||||
except Exception:
|
except Exception:
|
||||||
mesonlog = no_meson_log_msg
|
mesonlog = no_meson_log_msg
|
||||||
cicmds = run_ci_commands(mesonlog)
|
cicmds = run_ci_commands(mesonlog)
|
||||||
testresult = TestResult(cicmds)
|
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)
|
output_msg = validate_output(test, stdo, stde)
|
||||||
testresult.mlog += output_msg
|
testresult.mlog += output_msg
|
||||||
if 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)
|
pc, o, e = mesonlib.Popen_safe(full_command, env=env)
|
||||||
return pc.returncode, o, e
|
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
|
global meson_exe
|
||||||
if meson_exe:
|
if meson_exe:
|
||||||
return run_configure_external(meson_exe + commandlist, env=env)
|
return (False, run_configure_external(meson_exe + commandlist, env=env))
|
||||||
return run_configure_inprocess(commandlist, env=env, catch_exception=catch_exception)
|
return (True, run_configure_inprocess(commandlist, env=env, catch_exception=catch_exception))
|
||||||
|
|
||||||
def print_system_info():
|
def print_system_info():
|
||||||
print(mlog.bold('System information.'))
|
print(mlog.bold('System information.'))
|
||||||
|
|
Loading…
Reference in New Issue