2022-01-08 02:59:08 +00:00
|
|
|
#define CATCH_CONFIG_RUNNER
|
|
|
|
#include <glibmm.h>
|
|
|
|
#include <spdlog/sinks/stdout_sinks.h>
|
|
|
|
#include <spdlog/spdlog.h>
|
|
|
|
|
2022-10-16 13:51:43 +00:00
|
|
|
#include <catch2/catch_all.hpp>
|
|
|
|
#include <catch2/reporters/catch_reporter_tap.hpp>
|
2022-01-08 02:59:08 +00:00
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
int main(int argc, char* argv[]) {
|
|
|
|
Catch::Session session;
|
|
|
|
Glib::init();
|
|
|
|
|
|
|
|
session.applyCommandLine(argc, argv);
|
2022-04-06 06:37:19 +00:00
|
|
|
const auto logger = spdlog::default_logger();
|
2022-10-16 13:51:43 +00:00
|
|
|
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>()});
|
|
|
|
}
|
2022-01-08 02:59:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return session.run();
|
|
|
|
}
|