2021-01-06 02:38:31 +01:00
|
|
|
cmake_minimum_required(VERSION 3.14)
|
|
|
|
|
|
|
|
project(ssp_tests CXX)
|
|
|
|
|
|
|
|
# ---- Dependencies ----
|
|
|
|
|
|
|
|
include(FetchContent)
|
2023-07-29 20:41:31 +02:00
|
|
|
FetchContent_Declare(ssp SOURCE_DIR "${PROJECT_SOURCE_DIR}/..")
|
|
|
|
FetchContent_MakeAvailable(ssp)
|
2021-01-06 02:38:31 +01:00
|
|
|
|
|
|
|
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
|
2023-02-08 21:54:44 +01:00
|
|
|
target_compile_options(ssp INTERFACE -Wall -Wextra)
|
2021-01-06 02:38:31 +01:00
|
|
|
endif()
|
|
|
|
|
2023-07-30 22:59:37 +02:00
|
|
|
if (MSVC)
|
|
|
|
add_compile_options(/bigobj)
|
2023-07-31 23:30:26 +02:00
|
|
|
elseif (MINGW)
|
2024-02-19 00:04:09 +01:00
|
|
|
add_compile_options(-Wa,-mbig-obj)
|
2023-07-30 22:59:37 +02:00
|
|
|
endif ()
|
|
|
|
|
2023-02-12 12:23:25 +01:00
|
|
|
include(FetchContent)
|
2023-07-29 20:41:31 +02:00
|
|
|
FetchContent_Declare(
|
2023-02-12 12:23:25 +01:00
|
|
|
DOCTEST
|
|
|
|
GIT_REPOSITORY https://github.com/red0124/doctest
|
|
|
|
GIT_TAG origin/master
|
2023-07-29 20:41:31 +02:00
|
|
|
GIT_SHALLOW TRUE)
|
2023-02-12 12:23:25 +01:00
|
|
|
|
2023-07-29 20:41:31 +02:00
|
|
|
FetchContent_MakeAvailable(DOCTEST)
|
2023-02-12 12:23:25 +01:00
|
|
|
set(DOCTEST "${FETCHCONTENT_BASE_DIR}/doctest-src")
|
2021-01-06 02:38:31 +01:00
|
|
|
|
|
|
|
# ---- Test ----
|
|
|
|
|
|
|
|
enable_testing()
|
|
|
|
|
2024-02-17 21:08:24 +01:00
|
|
|
foreach(name IN ITEMS test_splitter test_parser1_1 test_parser1_2
|
Updated and added new functions related to headers, resolved ODR issues, resolved clang-tidy warnings (#50)
* Bugfix/odr violations (#47)
* Make common non-member functions inline, remove unreachable line from get_line_buffer
* [skip ci] Fix namespace comments
* Resolve clang-tidy warnings (#48)
* Resolve clang-tidy warnings, update single_header_generator.py
* Update single header test, resolve additional clang-tidy warnings
* Add header and raw_header methods, update header usage methods error handling, write new and update existing unit tests
* Update parser error messages, fix parser tests
* Add [[nodiscard]] where fitting, update unit tests (#49)
* Add const where fitting, make splitter class members private, add #pragma once to ssp.hpp
* Modify header parsing for empty headers, update old and add new tests for header parsing
* Enable the parser to accept a header with one empty field, update unit tests
* Fix test CMakeLists.txt typo
2024-03-14 17:22:57 +01:00
|
|
|
test_parser1_3 test_parser1_4 test_parser1_5
|
|
|
|
test_converter test_extractions test_parser2_1
|
|
|
|
test_parser2_2 test_parser2_3 test_parser2_4
|
|
|
|
test_parser2_5 test_parser2_6
|
|
|
|
test_extractions_without_fast_float)
|
2023-02-08 21:54:44 +01:00
|
|
|
add_executable("${name}" "${name}.cpp")
|
2023-07-29 20:41:31 +02:00
|
|
|
target_link_libraries("${name}" PRIVATE ssp::ssp fast_float
|
|
|
|
doctest::doctest)
|
2023-02-08 21:54:44 +01:00
|
|
|
target_compile_definitions(
|
2024-02-21 21:38:27 +01:00
|
|
|
"${name}" PRIVATE DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN CMAKE_GITHUB_CI)
|
2023-02-12 12:23:25 +01:00
|
|
|
add_test(NAME "${name}" COMMAND "${name}")
|
2021-01-06 02:38:31 +01:00
|
|
|
endforeach()
|