From 8afbeb189264eba7367ed5c86f7871f8bd46feb9 Mon Sep 17 00:00:00 2001 From: Dan Klishch Date: Sun, 1 Oct 2023 22:19:40 -0400 Subject: [PATCH] JSSpecCompiler: Print stderr in test runner if compiler invocation fails --- Tests/JSSpecCompiler/test-runner.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Tests/JSSpecCompiler/test-runner.cpp b/Tests/JSSpecCompiler/test-runner.cpp index 8fd834d3ff..f926ea4080 100644 --- a/Tests/JSSpecCompiler/test-runner.cpp +++ b/Tests/JSSpecCompiler/test-runner.cpp @@ -166,8 +166,15 @@ TEST_CASE(test_regression) bool exited_with_code_0 = MUST(process.wait_for_termination()); EXPECT(exited_with_code_0); - if (exited_with_code_0) + if (!exited_with_code_0) { + auto captured_output = read(path_to_captured_stderr); + if (!captured_output.is_error()) { + StringView stderr_output_view = captured_output.value(); + dbgln("Compiler invocation failed. Captured output:\n{}", stderr_output_view); + } + } else { check_expectations(path_to_expectation, path_to_captured_stderr, should_update_expectations); + } } } }