Merge pull request #1724 from llyyr/fix-build-with-catch2
This commit is contained in:
commit
ffa458223d
|
@ -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>
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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,14 +13,15 @@ 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();
|
||||||
}
|
}
|
||||||
|
|
|
@ -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>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue