Fix build with catch2>=3.0.0

This commit is contained in:
llyyr 2022-10-16 19:21:43 +05:30
parent 5da45ece9d
commit 1db3c55b48
4 changed files with 13 additions and 12 deletions

View File

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

View File

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

View File

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

View File

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