From e49ccede353e0face23746b706e114201d30b550 Mon Sep 17 00:00:00 2001 From: ado Date: Thu, 21 Jan 2021 01:29:07 +0100 Subject: [PATCH] update tests for github ci --- subprojects/doctest.wrap | 2 +- test/CMakeLists.txt | 2 +- test/test_converter.cpp | 7 ++++++- test/test_extractions.cpp | 7 ++++++- test/test_parser.cpp | 7 ++++++- 5 files changed, 20 insertions(+), 5 deletions(-) diff --git a/subprojects/doctest.wrap b/subprojects/doctest.wrap index 906440d..265b76b 100644 --- a/subprojects/doctest.wrap +++ b/subprojects/doctest.wrap @@ -1,3 +1,3 @@ [wrap-git] url = https://github.com/onqtam/doctest -revision = master +revision = 2.4.4 diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index f672add..f08051e 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -31,6 +31,6 @@ enable_testing() foreach(name IN ITEMS test_parser test_converter test_extractions) add_executable("${name}" "${name}.cpp") target_link_libraries("${name}" PRIVATE ssp::ssp doctest::doctest) - target_compile_definitions("${name}" PRIVATE DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN) + target_compile_definitions("${name}" PRIVATE CMAKE_GITHUB_CI) doctest_discover_tests("${name}") endforeach() diff --git a/test/test_converter.cpp b/test/test_converter.cpp index 3e77ae7..8fc5171 100644 --- a/test/test_converter.cpp +++ b/test/test_converter.cpp @@ -1,7 +1,12 @@ #include -#include #include +#ifdef CMAKE_GITHUB_CI +#include +#else +#include +#endif + TEST_CASE("testing split") { ss::converter c; diff --git a/test/test_extractions.cpp b/test/test_extractions.cpp index 8b0dbd7..d645b61 100644 --- a/test/test_extractions.cpp +++ b/test/test_extractions.cpp @@ -1,7 +1,12 @@ #include -#include #include +#ifdef CMAKE_GITHUB_CI +#include +#else +#include +#endif + constexpr auto eps = 0.000001; using ld = long double; diff --git a/test/test_parser.cpp b/test/test_parser.cpp index 2706103..54cfef5 100644 --- a/test/test_parser.cpp +++ b/test/test_parser.cpp @@ -1,9 +1,14 @@ #include -#include #include #include #include +#ifdef CMAKE_GITHUB_CI +#include +#else +#include +#endif + struct unique_file_name { const std::string name;