mirror of
https://github.com/red0124/ssp.git
synced 2025-01-23 04:55:20 +01:00
55d0a4e598
* 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
48 lines
1.4 KiB
CMake
48 lines
1.4 KiB
CMake
cmake_minimum_required(VERSION 3.14)
|
|
|
|
project(ssp_tests CXX)
|
|
|
|
# ---- Dependencies ----
|
|
|
|
include(FetchContent)
|
|
FetchContent_Declare(ssp SOURCE_DIR "${PROJECT_SOURCE_DIR}/..")
|
|
FetchContent_MakeAvailable(ssp)
|
|
|
|
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
|
|
target_compile_options(ssp INTERFACE -Wall -Wextra)
|
|
endif()
|
|
|
|
if (MSVC)
|
|
add_compile_options(/bigobj)
|
|
elseif (MINGW)
|
|
add_compile_options(-Wa,-mbig-obj)
|
|
endif ()
|
|
|
|
include(FetchContent)
|
|
FetchContent_Declare(
|
|
DOCTEST
|
|
GIT_REPOSITORY https://github.com/red0124/doctest
|
|
GIT_TAG origin/master
|
|
GIT_SHALLOW TRUE)
|
|
|
|
FetchContent_MakeAvailable(DOCTEST)
|
|
set(DOCTEST "${FETCHCONTENT_BASE_DIR}/doctest-src")
|
|
|
|
# ---- Test ----
|
|
|
|
enable_testing()
|
|
|
|
foreach(name IN ITEMS test_splitter test_parser1_1 test_parser1_2
|
|
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)
|
|
add_executable("${name}" "${name}.cpp")
|
|
target_link_libraries("${name}" PRIVATE ssp::ssp fast_float
|
|
doctest::doctest)
|
|
target_compile_definitions(
|
|
"${name}" PRIVATE DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN CMAKE_GITHUB_CI)
|
|
add_test(NAME "${name}" COMMAND "${name}")
|
|
endforeach()
|