Browse Source

Print signal-exits from tests

default_compile_flags
vector-of-bool 4 years ago
parent
commit
725755b8b7
3 changed files with 16 additions and 4 deletions
  1. +14
    -4
      src/dds/build/builder.cpp
  2. +1
    -0
      src/dds/build/plan/exe.cpp
  3. +1
    -0
      src/dds/build/plan/exe.hpp

+ 14
- 4
src/dds/build/builder.cpp View File

bool generate_catch2_main = false; bool generate_catch2_main = false;
}; };


void log_failure(const test_failure& fail) {
spdlog::error("Test '{}' failed! [exitted {}]", fail.executable_path.string(), fail.retc);
if (fail.signal) {
spdlog::error("Test execution received signal {}", fail.signal);
}
if (trim_view(fail.output).empty()) {
spdlog::error("(Test executable produced no output");
} else {
spdlog::error("Test output:\n{}[dds - test output end]", fail.output);
}
}

lm::library lm::library
prepare_catch2_driver(test_lib test_driver, const build_params& params, build_env_ref env_) { prepare_catch2_driver(test_lib test_driver, const build_params& params, build_env_ref env_) {
fs::path test_include_root = params.out_root / "_catch-2.10.2"; fs::path test_include_root = params.out_root / "_catch-2.10.2";
auto test_failures = plan.run_all_tests(env, params.parallel_jobs); auto test_failures = plan.run_all_tests(env, params.parallel_jobs);
spdlog::info("Test execution finished in {:n}ms", sw.elapsed_ms().count()); spdlog::info("Test execution finished in {:n}ms", sw.elapsed_ms().count());


for (auto& failures : test_failures) {
spdlog::error("Test {} failed! Output:\n{}[dds - test output end]",
failures.executable_path.string(),
failures.output);
for (auto& fail : test_failures) {
log_failure(fail);
} }
if (!test_failures.empty()) { if (!test_failures.empty()) {
throw_user_error<errc::test_failure>(); throw_user_error<errc::test_failure>();

+ 1
- 0
src/dds/build/plan/exe.cpp View File

f.executable_path = exe_path; f.executable_path = exe_path;
f.output = res.output; f.output = res.output;
f.retc = res.retc; f.retc = res.retc;
f.signal = res.signal;
return f; return f;
} }
} }

+ 1
- 0
src/dds/build/plan/exe.hpp View File

fs::path executable_path; fs::path executable_path;
std::string output; std::string output;
int retc; int retc;
int signal;
}; };


/** /**

Loading…
Cancel
Save