Sfoglia il codice sorgente

Formatting

default_compile_flags
vector-of-bool 5 anni fa
parent
commit
fbbbfda981
5 ha cambiato i file con 14 aggiunte e 10 eliminazioni
  1. +3
    -1
      src/dds/build.cpp
  2. +3
    -1
      src/dds/build/plan/compile_file.cpp
  3. +6
    -6
      src/dds/build/plan/exe.cpp
  4. +1
    -1
      src/dds/build/plan/exe.hpp
  5. +1
    -1
      src/dds/build/plan/full.cpp

+ 3
- 1
src/dds/build.cpp Vedi File

@@ -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!");

+ 3
- 1
src/dds/build/plan/compile_file.cpp Vedi File

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

+ 6
- 6
src/dds/build/plan/exe.cpp Vedi File

@@ -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;
}
}

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

@@ -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;

+ 1
- 1
src/dds/build/plan/full.cpp Vedi File

@@ -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) {

Loading…
Annulla
Salva