Skip to content

Commit dbae634

Browse files
committed
call thread_utility::register_main_thread()
1 parent dccb94f commit dbae634

4 files changed

Lines changed: 33 additions & 7 deletions

File tree

tests/src/core_configuration/test.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
#define CATCH_CONFIG_MAIN
1+
#define CATCH_CONFIG_RUNNER
22
#include "../../vendor/catch/catch.hpp"
33

44
#include "core_configuration.hpp"
5+
#include "thread_utility.hpp"
56
#include <iostream>
67
#include <spdlog/spdlog.h>
78

@@ -88,3 +89,8 @@ TEST_CASE("invalid_key_code_name.json") {
8889
REQUIRE(configuration.get_current_profile_simple_modifications() == expected);
8990
REQUIRE(configuration.is_loaded() == true);
9091
}
92+
93+
int main(int argc, char* const argv[]) {
94+
thread_utility::register_main_thread();
95+
return Catch::Session().run(argc, argv);
96+
}

tests/src/filesystem/test.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
#define CATCH_CONFIG_MAIN
1+
#define CATCH_CONFIG_RUNNER
22
#include "../../vendor/catch/catch.hpp"
33

4-
#include <ostream>
4+
#include "boost_defs.hpp"
55

66
#include "filesystem.hpp"
7+
#include "thread_utility.hpp"
78
#include <boost/optional/optional_io.hpp>
9+
#include <ostream>
810

911
TEST_CASE("create_directory_with_intermediate_directories") {
1012
REQUIRE(filesystem::create_directory_with_intermediate_directories("/", 0700) == true);
@@ -148,3 +150,8 @@ TEST_CASE("realpath") {
148150
actual = filesystem::realpath("/var/log/system.log");
149151
REQUIRE(*actual == "/private/var/log/system.log");
150152
}
153+
154+
int main(int argc, char* const argv[]) {
155+
thread_utility::register_main_thread();
156+
return Catch::Session().run(argc, argv);
157+
}

tests/src/spdlog_utility/test.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
#define CATCH_CONFIG_MAIN
1+
#define CATCH_CONFIG_RUNNER
22
#include "../../vendor/catch/catch.hpp"
33

4-
#include <boost/optional/optional_io.hpp>
5-
#include <ostream>
4+
#include "boost_defs.hpp"
65

76
#include "spdlog_utility.hpp"
7+
#include "thread_utility.hpp"
8+
#include <boost/optional/optional_io.hpp>
9+
#include <ostream>
810

911
TEST_CASE("get_timestamp_number") {
1012
{
@@ -21,3 +23,8 @@ TEST_CASE("get_timestamp_number") {
2123
REQUIRE(actual == boost::none);
2224
}
2325
}
26+
27+
int main(int argc, char* const argv[]) {
28+
thread_utility::register_main_thread();
29+
return Catch::Session().run(argc, argv);
30+
}

tests/src/system_preferences/test.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
#define CATCH_CONFIG_MAIN
1+
#define CATCH_CONFIG_RUNNER
22
#include "../../vendor/catch/catch.hpp"
33

44
#include "system_preferences.hpp"
5+
#include "thread_utility.hpp"
56

67
TEST_CASE("convert") {
78
for (uint32_t i = 0; i < 50000; ++i) {
@@ -11,3 +12,8 @@ TEST_CASE("convert") {
1112
REQUIRE(v == i);
1213
}
1314
}
15+
16+
int main(int argc, char* const argv[]) {
17+
thread_utility::register_main_thread();
18+
return Catch::Session().run(argc, argv);
19+
}

0 commit comments

Comments
 (0)