From 55a9e623bea934a9ebb15193b5bd5fc1df41eb22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edu=20G=C3=B3mez=20Escandell?= Date: Tue, 5 Dec 2023 12:54:29 +0100 Subject: [PATCH 1/2] Remove unused import in day 4 --- 2023/solvelib/04/day04.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/2023/solvelib/04/day04.cpp b/2023/solvelib/04/day04.cpp index 660b0dc..f35e167 100644 --- a/2023/solvelib/04/day04.cpp +++ b/2023/solvelib/04/day04.cpp @@ -7,7 +7,6 @@ #include #include #include -#include #include #include #include From ab46e6db213d1dcb37661acd924e2838979795a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edu=20G=C3=B3mez=20Escandell?= Date: Tue, 5 Dec 2023 12:55:09 +0100 Subject: [PATCH 2/2] Make any failed day cause the return value to be non-zero --- 2023/xmaslib/solution/solution.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/2023/xmaslib/solution/solution.cpp b/2023/xmaslib/solution/solution.cpp index f6f32b1..048de0c 100644 --- a/2023/xmaslib/solution/solution.cpp +++ b/2023/xmaslib/solution/solution.cpp @@ -16,7 +16,9 @@ solution::duration solution::time() const { } bool solution::run(bool verbose) noexcept { - if(verbose) + bool success = true; + + if (verbose) xlog::info("Day {}", this->day()); try { @@ -42,6 +44,7 @@ bool solution::run(bool verbose) noexcept { } } catch (std::runtime_error &err) { xlog::error("Part 1 failed with message: {}", err.what()); + success = false; } catch (...) { xlog::error("Part 1 failed with no message"); return false; @@ -60,12 +63,13 @@ bool solution::run(bool verbose) noexcept { } } catch (std::runtime_error &err) { xlog::error("Part 2 failed with message: {}", err.what()); + success = false; } catch (...) { xlog::error("Part 2 failed with no message"); return false; } - return true; + return success; } void solution::set_input(std::string_view path) { this->data_path = path; }