Merge pull request #1724 from llyyr/fix-build-with-catch2

pull/1739/head
Alex 2022-10-20 10:47:52 +02:00 committed by GitHub
commit ffa458223d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 12 deletions

View File

@ -2,7 +2,7 @@
#include <glibmm.h> #include <glibmm.h>
#include <catch2/catch.hpp> #include <catch2/catch_all.hpp>
#include <thread> #include <thread>
#include <type_traits> #include <type_traits>

View File

@ -1,6 +1,6 @@
#include "config.hpp" #include "config.hpp"
#include <catch2/catch.hpp> #include <catch2/catch_all.hpp>
TEST_CASE("Load simple config", "[config]") { TEST_CASE("Load simple config", "[config]") {
waybar::Config conf; waybar::Config conf;

View File

@ -3,8 +3,8 @@
#include <spdlog/sinks/stdout_sinks.h> #include <spdlog/sinks/stdout_sinks.h>
#include <spdlog/spdlog.h> #include <spdlog/spdlog.h>
#include <catch2/catch.hpp> #include <catch2/catch_all.hpp>
#include <catch2/catch_reporter_tap.hpp> #include <catch2/reporters/catch_reporter_tap.hpp>
#include <memory> #include <memory>
int main(int argc, char* argv[]) { int main(int argc, char* argv[]) {
@ -13,13 +13,14 @@ int main(int argc, char* argv[]) {
session.applyCommandLine(argc, argv); session.applyCommandLine(argc, argv);
const auto logger = spdlog::default_logger(); const auto logger = spdlog::default_logger();
const auto& reporter_name = session.config().getReporterName(); for (const auto& spec : session.config().getReporterSpecs()) {
if (reporter_name == "tap") { if (spec.name() == "tap") {
spdlog::set_pattern("# [%l] %v"); spdlog::set_pattern("# [%l] %v");
} else if (reporter_name == "compact") { } else if (spec.name() == "compact") {
logger->sinks().clear(); logger->sinks().clear();
} else { } else {
logger->sinks().assign({std::make_shared<spdlog::sinks::stderr_sink_st>()}); logger->sinks().assign({std::make_shared<spdlog::sinks::stderr_sink_st>()});
}
} }
return session.run(); return session.run();

View File

@ -3,7 +3,7 @@
#include <date/date.h> #include <date/date.h>
#include <date/tz.h> #include <date/tz.h>
#include <catch2/catch.hpp> #include <catch2/catch_all.hpp>
#include <chrono> #include <chrono>
#include <stdexcept> #include <stdexcept>