From cfc1abcfafb3b067b64f85953721b44b8066dedc Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Sun, 4 Sep 2022 02:52:05 -0400 Subject: project tests: add log of the setup command being run Followup to commit 2acb6ee79e24db047800da30f5f4ac52cb9c012d. --- run_project_tests.py | 9 ++++++--- run_tests.py | 6 +++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/run_project_tests.py b/run_project_tests.py index 75665bae7..fd800e648 100755 --- a/run_project_tests.py +++ b/run_project_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: diff --git a/run_tests.py b/run_tests.py index 89ae3b5c8..68a222c84 100755 --- a/run_tests.py +++ b/run_tests.py @@ -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.')) -- cgit v1.2.1