dds::stopwatch sw; | dds::stopwatch sw; | ||||
plan.compile_all(env, params.parallel_jobs); | plan.compile_all(env, params.parallel_jobs); | ||||
log::info("Compilation completed in {:n}ms", sw.elapsed_ms().count()); | |||||
log::info("Compilation completed in {:L}ms", sw.elapsed_ms().count()); | |||||
sw.reset(); | sw.reset(); | ||||
plan.archive_all(env, params.parallel_jobs); | plan.archive_all(env, params.parallel_jobs); | ||||
log::info("Archiving completed in {:n}ms", sw.elapsed_ms().count()); | |||||
log::info("Archiving completed in {:L}ms", sw.elapsed_ms().count()); | |||||
sw.reset(); | sw.reset(); | ||||
plan.link_all(env, params.parallel_jobs); | plan.link_all(env, params.parallel_jobs); | ||||
log::info("Runtime binary linking completed in {:n}ms", sw.elapsed_ms().count()); | |||||
log::info("Runtime binary linking completed in {:L}ms", sw.elapsed_ms().count()); | |||||
sw.reset(); | sw.reset(); | ||||
auto test_failures = plan.run_all_tests(env, params.parallel_jobs); | auto test_failures = plan.run_all_tests(env, params.parallel_jobs); | ||||
log::info("Test execution finished in {:n}ms", sw.elapsed_ms().count()); | |||||
log::info("Test execution finished in {:L}ms", sw.elapsed_ms().count()); | |||||
for (auto& fail : test_failures) { | for (auto& fail : test_failures) { | ||||
log_failure(fail); | log_failure(fail); |
// Do it! | // Do it! | ||||
log::info("[{}] Archive: {}", _qual_name, out_relpath); | log::info("[{}] Archive: {}", _qual_name, out_relpath); | ||||
auto&& [dur_ms, ar_res] = timed<std::chrono::milliseconds>([&] { return run_proc(ar_cmd); }); | auto&& [dur_ms, ar_res] = timed<std::chrono::milliseconds>([&] { return run_proc(ar_cmd); }); | ||||
log::info("[{}] Archive: {} - {:n}ms", _qual_name, out_relpath, dur_ms.count()); | |||||
log::info("[{}] Archive: {} - {:L}ms", _qual_name, out_relpath, dur_ms.count()); | |||||
// Check, log, and throw | // Check, log, and throw | ||||
if (!ar_res.okay()) { | if (!ar_res.okay()) { |
auto&& [dur_ms, proc_res] | auto&& [dur_ms, proc_res] | ||||
= timed<std::chrono::milliseconds>([&] { return run_proc(cf.cmd_info.command); }); | = timed<std::chrono::milliseconds>([&] { return run_proc(cf.cmd_info.command); }); | ||||
auto nth = counter.n.fetch_add(1); | auto nth = counter.n.fetch_add(1); | ||||
log::info("{:60} - {:>7n}ms [{:{}}/{}]", | |||||
log::info("{:60} - {:>7L}ms [{:{}}/{}]", | |||||
msg, | msg, | ||||
dur_ms.count(), | dur_ms.count(), | ||||
nth, | nth, |
log::info(msg); | log::info(msg); | ||||
auto [dur_ms, proc_res] | auto [dur_ms, proc_res] | ||||
= timed<std::chrono::milliseconds>([&] { return run_proc(link_command); }); | = timed<std::chrono::milliseconds>([&] { return run_proc(link_command); }); | ||||
log::info("{} - {:>6n}ms", msg, dur_ms.count()); | |||||
log::info("{} - {:>6L}ms", msg, dur_ms.count()); | |||||
// Check and throw if errant | // Check and throw if errant | ||||
if (!proc_res.okay()) { | if (!proc_res.okay()) { | ||||
[&] { return run_proc({.command = {exe_path.string()}, .timeout = 10s}); }); | [&] { return run_proc({.command = {exe_path.string()}, .timeout = 10s}); }); | ||||
if (res.okay()) { | if (res.okay()) { | ||||
log::info("{} - PASSED - {:>9n}μs", msg, dur.count()); | |||||
log::info("{} - PASSED - {:>9L}μs", msg, dur.count()); | |||||
return std::nullopt; | return std::nullopt; | ||||
} else { | } else { | ||||
auto exit_msg = fmt::format(res.signal ? "signalled {}" : "exited {}", | auto exit_msg = fmt::format(res.signal ? "signalled {}" : "exited {}", | ||||
res.signal ? res.signal : res.retc); | res.signal ? res.signal : res.retc); | ||||
auto fail_str = res.timed_out ? "TIMEOUT" : "FAILED "; | auto fail_str = res.timed_out ? "TIMEOUT" : "FAILED "; | ||||
log::error("{} - {} - {:>9n}μs [{}]", msg, fail_str, dur.count(), exit_msg); | |||||
log::error("{} - {} - {:>9L}μs [{}]", msg, fail_str, dur.count(), exit_msg); | |||||
test_failure f; | test_failure f; | ||||
f.executable_path = exe_path; | f.executable_path = exe_path; | ||||
f.output = res.output; | f.output = res.output; |
#include <dds/error/errors.hpp> | #include <dds/error/errors.hpp> | ||||
#include <fmt/core.h> | |||||
#include <json5/parse_data.hpp> | #include <json5/parse_data.hpp> | ||||
#include <neo/assert.hpp> | #include <neo/assert.hpp> | ||||
#include <semester/walk.hpp> | #include <semester/walk.hpp> | ||||
#include <spdlog/fmt/fmt.h> | |||||
#include <optional> | #include <optional> | ||||
}; | }; | ||||
template <typename KF, typename... Args> | template <typename KF, typename... Args> | ||||
any_key(KF&&, Args&&...) -> any_key<KF, Args...>; | |||||
any_key(KF&&, Args&&...)->any_key<KF, Args...>; | |||||
namespace { | namespace { | ||||
#include <json5/parse_data.hpp> | #include <json5/parse_data.hpp> | ||||
#include <semester/walk.hpp> | #include <semester/walk.hpp> | ||||
#include <spdlog/fmt/fmt.h> | |||||
#include <fmt/core.h> | |||||
#include <cctype> | #include <cctype> | ||||
#include <sstream> | #include <sstream> |
#pragma once | #pragma once | ||||
#include <spdlog/fmt/fmt.h> | |||||
#include <fmt/core.h> | |||||
#include <stdexcept> | #include <stdexcept> | ||||
#include <string_view> | #include <string_view> |
#include <dds/error/errors.hpp> | #include <dds/error/errors.hpp> | ||||
#include <spdlog/fmt/fmt.h> | |||||
#include <fmt/core.h> | |||||
#include <tuple> | #include <tuple> | ||||
#include <dds/util/algo.hpp> | #include <dds/util/algo.hpp> | ||||
#include <dds/util/shlex.hpp> | #include <dds/util/shlex.hpp> | ||||
#include <fmt/core.h> | |||||
#include <json5/parse_data.hpp> | #include <json5/parse_data.hpp> | ||||
#include <semester/decomp.hpp> | #include <semester/decomp.hpp> | ||||
#include <spdlog/fmt/fmt.h> | |||||
#include <string> | #include <string> | ||||
#include <dds/error/errors.hpp> | #include <dds/error/errors.hpp> | ||||
#include <dds/util/algo.hpp> | #include <dds/util/algo.hpp> | ||||
#include <spdlog/fmt/fmt.h> | |||||
#include <fmt/core.h> | |||||
#include <stdexcept> | #include <stdexcept> | ||||
#include <dds/util/signal.hpp> | #include <dds/util/signal.hpp> | ||||
#include <spdlog/fmt/fmt.h> | |||||
#include <fmt/core.h> | |||||
#include <fcntl.h> | #include <fcntl.h> | ||||
#include <sys/file.h> | #include <sys/file.h> |
#include <dds/util/signal.hpp> | #include <dds/util/signal.hpp> | ||||
#include <spdlog/fmt/fmt.h> | |||||
#include <fmt/core.h> | |||||
#include <wil/resource.h> | #include <wil/resource.h> | ||||
#include <cassert> | |||||
using namespace dds; | using namespace dds; | ||||
namespace { | namespace { |
#include "./fs.hpp" | #include "./fs.hpp" | ||||
#include <spdlog/fmt/fmt.h> | |||||
#include <fmt/core.h> | |||||
#include <sstream> | #include <sstream> | ||||
}; | }; | ||||
template <formattable... Args> | template <formattable... Args> | ||||
void log(level l, std::string_view s, const Args&... args) { | |||||
void log(level l, std::string_view s, const Args&... args) noexcept { | |||||
if (int(l) >= int(current_log_level)) { | if (int(l) >= int(current_log_level)) { | ||||
auto message = fmt::format(s, args...); | auto message = fmt::format(s, args...); | ||||
log_print(l, message); | log_print(l, message); |
#include <libman/parse.hpp> | #include <libman/parse.hpp> | ||||
#include <spdlog/fmt/fmt.h> | |||||
#include <fmt/core.h> | |||||
using namespace lm; | using namespace lm; | ||||
#include <libman/parse.hpp> | #include <libman/parse.hpp> | ||||
#include <spdlog/fmt/fmt.h> | |||||
#include <fmt/core.h> | |||||
using namespace lm; | using namespace lm; | ||||
#include <libman/util.hpp> | #include <libman/util.hpp> | ||||
#include <spdlog/fmt/fmt.h> | |||||
#include <fmt/core.h> | |||||
#include <cctype> | #include <cctype> | ||||
#include <fstream> | #include <fstream> |