diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2022-09-04 02:52:05 -0400 |
---|---|---|
committer | Eli Schwartz <eschwartz@archlinux.org> | 2023-03-20 17:22:50 -0400 |
commit | cfc1abcfafb3b067b64f85953721b44b8066dedc (patch) | |
tree | 8e49511c9c1ece4ba3e2ef5fb378cf4fdb162225 | |
parent | a024d75e150334330954bf7a6fdbe8cb02a82491 (diff) | |
download | meson-cfc1abcfafb3b067b64f85953721b44b8066dedc.zip meson-cfc1abcfafb3b067b64f85953721b44b8066dedc.tar.gz meson-cfc1abcfafb3b067b64f85953721b44b8066dedc.tar.bz2 |
project tests: add log of the setup command being run
Followup to commit 2acb6ee79e24db047800da30f5f4ac52cb9c012d.
-rwxr-xr-x | run_project_tests.py | 9 | ||||
-rwxr-xr-x | run_tests.py | 6 |
2 files changed, 9 insertions, 6 deletions
diff --git a/run_project_tests.py b/run_project_tests.py index 75665ba..fd800e6 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 89ae3b5..68a222c 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.')) |