mirror of
https://github.com/rad4day/Waybar.git
synced 2025-07-13 14:42:29 +02:00
Fix build with catch2>=3.0.0
This commit is contained in:
@ -3,8 +3,8 @@
|
||||
#include <spdlog/sinks/stdout_sinks.h>
|
||||
#include <spdlog/spdlog.h>
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include <catch2/catch_reporter_tap.hpp>
|
||||
#include <catch2/catch_all.hpp>
|
||||
#include <catch2/reporters/catch_reporter_tap.hpp>
|
||||
#include <memory>
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
@ -13,13 +13,14 @@ int main(int argc, char* argv[]) {
|
||||
|
||||
session.applyCommandLine(argc, argv);
|
||||
const auto logger = spdlog::default_logger();
|
||||
const auto& reporter_name = session.config().getReporterName();
|
||||
if (reporter_name == "tap") {
|
||||
spdlog::set_pattern("# [%l] %v");
|
||||
} else if (reporter_name == "compact") {
|
||||
logger->sinks().clear();
|
||||
} else {
|
||||
logger->sinks().assign({std::make_shared<spdlog::sinks::stderr_sink_st>()});
|
||||
for (const auto& spec : session.config().getReporterSpecs()) {
|
||||
if (spec.name() == "tap") {
|
||||
spdlog::set_pattern("# [%l] %v");
|
||||
} else if (spec.name() == "compact") {
|
||||
logger->sinks().clear();
|
||||
} else {
|
||||
logger->sinks().assign({std::make_shared<spdlog::sinks::stderr_sink_st>()});
|
||||
}
|
||||
}
|
||||
|
||||
return session.run();
|
||||
|
Reference in New Issue
Block a user