|
|
|
|
|
|
|
|
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>(); |