| @@ -164,7 +164,9 @@ void dds::build(const build_params& params, const package_manifest& man) { | |||
| auto test_failures = plan.run_all_tests(env, params.parallel_jobs); | |||
| for (auto& failures : test_failures) { | |||
| spdlog::error("Test {} failed! Output:\n{}[dds - test output end]", failures.executable_path.string(), failures.output); | |||
| spdlog::error("Test {} failed! Output:\n{}[dds - test output end]", | |||
| failures.executable_path.string(), | |||
| failures.output); | |||
| } | |||
| if (!test_failures.empty()) { | |||
| throw compile_failure("Test failures during the build!"); | |||
| @@ -26,7 +26,9 @@ void compile_file_plan::compile(const build_env& env) const { | |||
| const auto obj_path = calc_object_file_path(env); | |||
| fs::create_directories(obj_path.parent_path()); | |||
| auto msg = fmt::format("[{}] Compile: {:40}", _qualifier, fs::relative(_source.path, _source.basis_path).string()); | |||
| auto msg = fmt::format("[{}] Compile: {:40}", | |||
| _qualifier, | |||
| fs::relative(_source.path, _source.basis_path).string()); | |||
| spdlog::info(msg); | |||
| auto start_time = std::chrono::steady_clock::now(); | |||
| @@ -5,9 +5,9 @@ | |||
| #include <spdlog/spdlog.h> | |||
| #include <chrono> | |||
| #include <algorithm> | |||
| #include <cassert> | |||
| #include <chrono> | |||
| using namespace dds; | |||
| @@ -56,9 +56,9 @@ std::optional<test_failure> link_executable_plan::run_test(build_env_ref env) co | |||
| auto msg = fmt::format("Run test: {:30}", fs::relative(exe_path, env.output_root).string()); | |||
| spdlog::info(msg); | |||
| auto start = std::chrono::high_resolution_clock::now(); | |||
| auto res = run_proc({exe_path}); | |||
| auto end = std::chrono::high_resolution_clock::now(); | |||
| auto dur = std::chrono::duration_cast<std::chrono::microseconds>(end - start); | |||
| auto res = run_proc({exe_path}); | |||
| auto end = std::chrono::high_resolution_clock::now(); | |||
| auto dur = std::chrono::duration_cast<std::chrono::microseconds>(end - start); | |||
| if (res.okay()) { | |||
| spdlog::info("{} - PASSED - {:>9n}μs", msg, dur.count()); | |||
| return std::nullopt; | |||
| @@ -66,8 +66,8 @@ std::optional<test_failure> link_executable_plan::run_test(build_env_ref env) co | |||
| spdlog::error("{} - FAILED - {:>9n}μs [exited {}]", msg, dur.count(), res.retc); | |||
| test_failure f; | |||
| f.executable_path = exe_path; | |||
| f.output = res.output; | |||
| f.retc = res.retc; | |||
| f.output = res.output; | |||
| f.retc = res.retc; | |||
| return f; | |||
| } | |||
| } | |||
| @@ -37,7 +37,7 @@ public: | |||
| fs::path calc_executable_path(const build_env& env) const noexcept; | |||
| void link(const build_env&, const library_plan&) const; | |||
| void link(const build_env&, const library_plan&) const; | |||
| std::optional<test_failure> run_test(build_env_ref) const; | |||
| bool is_test() const noexcept; | |||
| @@ -123,7 +123,7 @@ std::vector<test_failure> build_plan::run_all_tests(build_env_ref env, int njobs | |||
| | filter(&link_executable_plan::is_test) // | |||
| ; | |||
| std::mutex mut; | |||
| std::mutex mut; | |||
| std::vector<test_failure> fails; | |||
| parallel_run(test_executables, njobs, [&](const auto& exe) { | |||