Browse Source

Log total timings for each step of the build

default_compile_flags
vector-of-bool 5 years ago
parent
commit
642bd218b5
1 changed files with 25 additions and 8 deletions
  1. +25
    -8
      src/dds/build.cpp

+ 25
- 8
src/dds/build.cpp View File

#include <dds/logging.hpp> #include <dds/logging.hpp>
#include <dds/usage_reqs.hpp> #include <dds/usage_reqs.hpp>
#include <dds/util/algo.hpp> #include <dds/util/algo.hpp>
#include <dds/util/time.hpp>
#include <libman/index.hpp> #include <libman/index.hpp>
#include <libman/parse.hpp> #include <libman/parse.hpp>


if (params.generate_compdb) { if (params.generate_compdb) {
generate_compdb(plan, env); generate_compdb(plan, env);
} }

dds::stopwatch sw;
plan.compile_all(env, params.parallel_jobs); plan.compile_all(env, params.parallel_jobs);
spdlog::info("Compilation completed in {:n}ms", sw.elapsed_ms().count());

sw.reset();
plan.archive_all(env, params.parallel_jobs); plan.archive_all(env, params.parallel_jobs);
plan.link_all(env, params.parallel_jobs);
spdlog::info("Archiving completed in {:n}ms", sw.elapsed_ms().count());


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);
if (params.build_apps || params.build_tests) {
sw.reset();
plan.link_all(env, params.parallel_jobs);
spdlog::info("Runtime binary linking completed in {:n}ms", sw.elapsed_ms().count());
} }
if (!test_failures.empty()) {
throw compile_failure("Test failures during the build!");

if (params.build_tests) {
sw.reset();
auto test_failures = plan.run_all_tests(env, params.parallel_jobs);
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);
}
if (!test_failures.empty()) {
throw compile_failure("Test failures during the build!");
}
} }


if (params.do_export) { if (params.do_export) {

Loading…
Cancel
Save