Split parser tests part 2 into additional segments

This commit is contained in:
ado 2024-02-19 00:04:09 +01:00
parent 11d57bd073
commit e4fba8a918
9 changed files with 58 additions and 23 deletions

View File

@ -15,7 +15,7 @@ endif()
if (MSVC) if (MSVC)
add_compile_options(/bigobj) add_compile_options(/bigobj)
elseif (MINGW) elseif (MINGW)
add_compile_options(-Wa,-mbig-obj -mcmodel=medium) add_compile_options(-Wa,-mbig-obj)
endif () endif ()
include(FetchContent) include(FetchContent)
@ -35,8 +35,8 @@ enable_testing()
foreach(name IN ITEMS test_splitter test_parser1_1 test_parser1_2 foreach(name IN ITEMS test_splitter test_parser1_1 test_parser1_2
test_parser1_3 test_parser1_4 test_converter test_parser1_3 test_parser1_4 test_converter
test_extractions test_parser2_1 test_parser2_2 test_extractions test_parser2_1 test_parser2_2
test_parser2_3 test_parser2_4 test_parser2_3 test_parser2_4 test_parser2_5
test_extractions_without_fast_float) test_parser2_6 test_extractions_without_fast_float)
add_executable("${name}" "${name}.cpp") add_executable("${name}" "${name}.cpp")
target_link_libraries("${name}" PRIVATE ssp::ssp fast_float target_link_libraries("${name}" PRIVATE ssp::ssp fast_float
doctest::doctest) doctest::doctest)

View File

@ -13,6 +13,8 @@ tests = [
'parser2_2', 'parser2_2',
'parser2_3', 'parser2_3',
'parser2_4', 'parser2_4',
'parser2_5',
'parser2_6',
'extractions_without_fast_float', 'extractions_without_fast_float',
] ]

View File

@ -635,25 +635,33 @@ TEST_CASE("parser test various cases version 2 segment 1") {
using multiline_r = ss::multiline_restricted<10>; using multiline_r = ss::multiline_restricted<10>;
using trimr = ss::trim_right<' '>; using trimr = ss::trim_right<' '>;
using triml = ss::trim_left<' '>; using triml = ss::trim_left<' '>;
using trim = ss::trim<' '>;
// segment 1 // segment 1
test_option_combinations3<>(); test_option_combinations3<>();
test_option_combinations3<escape>(); test_option_combinations3<escape>();
test_option_combinations3<quote>();
// segment 2 // segment 2
test_option_combinations3<quote>();
test_option_combinations3<escape, quote>(); test_option_combinations3<escape, quote>();
// segment 3
test_option_combinations3<escape, multiline>(); test_option_combinations3<escape, multiline>();
test_option_combinations3<quote, multiline>(); test_option_combinations3<quote, multiline>();
// segment 3 // segment 4
test_option_combinations3<escape, quote, multiline>(); test_option_combinations3<escape, quote, multiline>();
test_option_combinations3<escape, quote, multiline_r>(); test_option_combinations3<escape, quote, multiline_r>();
// segment 4 // segment 5
test_option_combinations<escape, quote, multiline, triml>(); test_option_combinations<escape, quote, multiline, triml>();
test_option_combinations<escape, quote, multiline, trimr>(); test_option_combinations<escape, quote, multiline, trimr>();
// segment 6
test_option_combinations3<escape, quote, multiline>();
test_option_combinations3<escape, quote, multiline, trim>();
#else #else
test_option_combinations3<escape, quote, multiline>(); test_option_combinations3<escape, quote, multiline>();
#endif #endif
} }

View File

@ -3,12 +3,10 @@
TEST_CASE("parser test various cases version 2 segment 1") { TEST_CASE("parser test various cases version 2 segment 1") {
#ifdef CMAKE_GITHUB_CI #ifdef CMAKE_GITHUB_CI
using quote = ss::quote<'"'>;
using escape = ss::escape<'\\'>; using escape = ss::escape<'\\'>;
test_option_combinations3<>(); test_option_combinations3<>();
test_option_combinations3<escape>(); test_option_combinations3<escape>();
test_option_combinations3<quote>();
#endif #endif
} }

View File

@ -5,11 +5,9 @@ TEST_CASE("parser test various cases version 2 segment 2") {
#ifdef CMAKE_GITHUB_CI #ifdef CMAKE_GITHUB_CI
using quote = ss::quote<'"'>; using quote = ss::quote<'"'>;
using escape = ss::escape<'\\'>; using escape = ss::escape<'\\'>;
using multiline = ss::multiline;
test_option_combinations3<quote>();
test_option_combinations3<escape, quote>(); test_option_combinations3<escape, quote>();
test_option_combinations3<escape, multiline>();
test_option_combinations3<quote, multiline>();
#endif #endif
} }

View File

@ -6,10 +6,9 @@ TEST_CASE("parser test various cases version 2 segment 3") {
using quote = ss::quote<'"'>; using quote = ss::quote<'"'>;
using escape = ss::escape<'\\'>; using escape = ss::escape<'\\'>;
using multiline = ss::multiline; using multiline = ss::multiline;
using multiline_r = ss::multiline_restricted<10>;
test_option_combinations3<escape, quote, multiline>(); test_option_combinations3<escape, multiline>();
test_option_combinations3<escape, quote, multiline_r>(); test_option_combinations3<quote, multiline>();
#endif #endif
} }

View File

@ -1,19 +1,15 @@
#define SEGMENT_NAME "segment4" #define SEGMENT_NAME "segment3"
#include "test_parser2.hpp" #include "test_parser2.hpp"
TEST_CASE("parser test various cases version 2 segment 4") { TEST_CASE("parser test various cases version 2 segment 3") {
#ifdef CMAKE_GITHUB_CI
using quote = ss::quote<'"'>; using quote = ss::quote<'"'>;
using escape = ss::escape<'\\'>; using escape = ss::escape<'\\'>;
using multiline = ss::multiline; using multiline = ss::multiline;
using multiline_r = ss::multiline_restricted<10>;
#ifdef CMAKE_GITHUB_CI
using trimr = ss::trim_right<' '>;
using triml = ss::trim_left<' '>;
test_option_combinations<escape, quote, multiline, triml>();
test_option_combinations<escape, quote, multiline, trimr>();
#else
test_option_combinations3<escape, quote, multiline>(); test_option_combinations3<escape, quote, multiline>();
test_option_combinations3<escape, quote, multiline_r>();
#endif #endif
} }

16
test/test_parser2_5.cpp Normal file
View File

@ -0,0 +1,16 @@
#define SEGMENT_NAME "segment3"
#include "test_parser2.hpp"
TEST_CASE("parser test various cases version 2 segment 3") {
#ifdef CMAKE_GITHUB_CI
using quote = ss::quote<'"'>;
using escape = ss::escape<'\\'>;
using multiline = ss::multiline;
using trimr = ss::trim_right<' '>;
using triml = ss::trim_left<' '>;
test_option_combinations<escape, quote, multiline, triml>();
test_option_combinations<escape, quote, multiline, trimr>();
#endif
}

18
test/test_parser2_6.cpp Normal file
View File

@ -0,0 +1,18 @@
#define SEGMENT_NAME "segment4"
#include "test_parser2.hpp"
TEST_CASE("parser test various cases version 2 segment 4") {
using quote = ss::quote<'"'>;
using escape = ss::escape<'\\'>;
using multiline = ss::multiline;
#ifdef CMAKE_GITHUB_CI
using trim = ss::trim<' '>;
test_option_combinations3<escape, quote, multiline>();
test_option_combinations3<escape, quote, multiline, trim>();
#else
test_option_combinations3<escape, quote, multiline>();
#endif
}