From 68047907417cee40b4103197598536f87d27a6bb Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Thu, 24 Oct 2024 11:00:38 +0200 Subject: [PATCH] chore: If 'PAVEX_LOG' is set, show the code generation logs coming from test execution to ease debugging --- libs/pavex_test_runner/src/lib.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libs/pavex_test_runner/src/lib.rs b/libs/pavex_test_runner/src/lib.rs index e814959ec..671e5da4d 100644 --- a/libs/pavex_test_runner/src/lib.rs +++ b/libs/pavex_test_runner/src/lib.rs @@ -720,6 +720,14 @@ fn code_generation_test( } }; + if std::env::var("PAVEX_LOG").as_deref() == Ok("true") { + eprintln!( + "Code generation stderr:\n{}Code generation stdout:\n{}", + textwrap::indent(&codegen_output.stderr, " "), + textwrap::indent(&codegen_output.stdout, " "), + ) + } + let expectations_directory = test.expectations_directory(); let outcome = if !output.status.success() { match test.configuration.expectations.codegen {