update tests for github ci

This commit is contained in:
ado 2021-01-21 01:29:07 +01:00
parent 4f7cf73002
commit e49ccede35
5 changed files with 20 additions and 5 deletions

View File

@ -1,3 +1,3 @@
[wrap-git] [wrap-git]
url = https://github.com/onqtam/doctest url = https://github.com/onqtam/doctest
revision = master revision = 2.4.4

View File

@ -31,6 +31,6 @@ enable_testing()
foreach(name IN ITEMS test_parser test_converter test_extractions) foreach(name IN ITEMS test_parser test_converter test_extractions)
add_executable("${name}" "${name}.cpp") add_executable("${name}" "${name}.cpp")
target_link_libraries("${name}" PRIVATE ssp::ssp doctest::doctest) 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}") doctest_discover_tests("${name}")
endforeach() endforeach()

View File

@ -1,7 +1,12 @@
#include <algorithm> #include <algorithm>
#include <doctest.h>
#include <ss/converter.hpp> #include <ss/converter.hpp>
#ifdef CMAKE_GITHUB_CI
#include <doctest/doctest.h>
#else
#include <doctest.h>
#endif
TEST_CASE("testing split") { TEST_CASE("testing split") {
ss::converter c; ss::converter c;

View File

@ -1,7 +1,12 @@
#include <ss/extract.hpp> #include <ss/extract.hpp>
#include <doctest.h>
#include <algorithm> #include <algorithm>
#ifdef CMAKE_GITHUB_CI
#include <doctest/doctest.h>
#else
#include <doctest.h>
#endif
constexpr auto eps = 0.000001; constexpr auto eps = 0.000001;
using ld = long double; using ld = long double;

View File

@ -1,9 +1,14 @@
#include <algorithm> #include <algorithm>
#include <doctest.h>
#include <filesystem> #include <filesystem>
#include <fstream> #include <fstream>
#include <ss/parser.hpp> #include <ss/parser.hpp>
#ifdef CMAKE_GITHUB_CI
#include <doctest/doctest.h>
#else
#include <doctest.h>
#endif
struct unique_file_name { struct unique_file_name {
const std::string name; const std::string name;