From e4fba8a918584bb2dedfa594d54b3e865a52eb23 Mon Sep 17 00:00:00 2001 From: ado Date: Mon, 19 Feb 2024 00:04:09 +0100 Subject: [PATCH] Split parser tests part 2 into additional segments --- test/CMakeLists.txt | 6 +++--- test/meson.build | 2 ++ test/test_parser2.hpp | 14 +++++++++++--- test/test_parser2_1.cpp | 2 -- test/test_parser2_2.cpp | 4 +--- test/test_parser2_3.cpp | 5 ++--- test/test_parser2_4.cpp | 14 +++++--------- test/test_parser2_5.cpp | 16 ++++++++++++++++ test/test_parser2_6.cpp | 18 ++++++++++++++++++ 9 files changed, 58 insertions(+), 23 deletions(-) create mode 100644 test/test_parser2_5.cpp create mode 100644 test/test_parser2_6.cpp diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index cb0ca65..be399a1 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -15,7 +15,7 @@ endif() if (MSVC) add_compile_options(/bigobj) elseif (MINGW) - add_compile_options(-Wa,-mbig-obj -mcmodel=medium) + add_compile_options(-Wa,-mbig-obj) endif () include(FetchContent) @@ -35,8 +35,8 @@ enable_testing() foreach(name IN ITEMS test_splitter test_parser1_1 test_parser1_2 test_parser1_3 test_parser1_4 test_converter test_extractions test_parser2_1 test_parser2_2 - test_parser2_3 test_parser2_4 - test_extractions_without_fast_float) + 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) diff --git a/test/meson.build b/test/meson.build index 454b16f..f4e6639 100644 --- a/test/meson.build +++ b/test/meson.build @@ -13,6 +13,8 @@ tests = [ 'parser2_2', 'parser2_3', 'parser2_4', + 'parser2_5', + 'parser2_6', 'extractions_without_fast_float', ] diff --git a/test/test_parser2.hpp b/test/test_parser2.hpp index ba6fd1a..e3e17db 100644 --- a/test/test_parser2.hpp +++ b/test/test_parser2.hpp @@ -635,25 +635,33 @@ TEST_CASE("parser test various cases version 2 segment 1") { using multiline_r = ss::multiline_restricted<10>; using trimr = ss::trim_right<' '>; using triml = ss::trim_left<' '>; + using trim = ss::trim<' '>; // segment 1 test_option_combinations3<>(); test_option_combinations3(); - test_option_combinations3(); // segment 2 + test_option_combinations3(); test_option_combinations3(); + + // segment 3 test_option_combinations3(); test_option_combinations3(); - // segment 3 + // segment 4 test_option_combinations3(); test_option_combinations3(); - // segment 4 + // segment 5 test_option_combinations(); test_option_combinations(); + + // segment 6 + test_option_combinations3(); + test_option_combinations3(); #else + test_option_combinations3(); #endif } diff --git a/test/test_parser2_1.cpp b/test/test_parser2_1.cpp index 6f1ac7a..55ec45a 100644 --- a/test/test_parser2_1.cpp +++ b/test/test_parser2_1.cpp @@ -3,12 +3,10 @@ TEST_CASE("parser test various cases version 2 segment 1") { #ifdef CMAKE_GITHUB_CI - using quote = ss::quote<'"'>; using escape = ss::escape<'\\'>; test_option_combinations3<>(); test_option_combinations3(); - test_option_combinations3(); #endif } diff --git a/test/test_parser2_2.cpp b/test/test_parser2_2.cpp index 5b5cc2c..ec76aa9 100644 --- a/test/test_parser2_2.cpp +++ b/test/test_parser2_2.cpp @@ -5,11 +5,9 @@ TEST_CASE("parser test various cases version 2 segment 2") { #ifdef CMAKE_GITHUB_CI using quote = ss::quote<'"'>; using escape = ss::escape<'\\'>; - using multiline = ss::multiline; + test_option_combinations3(); test_option_combinations3(); - test_option_combinations3(); - test_option_combinations3(); #endif } diff --git a/test/test_parser2_3.cpp b/test/test_parser2_3.cpp index 776f49a..aab905c 100644 --- a/test/test_parser2_3.cpp +++ b/test/test_parser2_3.cpp @@ -6,10 +6,9 @@ TEST_CASE("parser test various cases version 2 segment 3") { using quote = ss::quote<'"'>; using escape = ss::escape<'\\'>; using multiline = ss::multiline; - using multiline_r = ss::multiline_restricted<10>; - test_option_combinations3(); - test_option_combinations3(); + test_option_combinations3(); + test_option_combinations3(); #endif } diff --git a/test/test_parser2_4.cpp b/test/test_parser2_4.cpp index 4658337..776f49a 100644 --- a/test/test_parser2_4.cpp +++ b/test/test_parser2_4.cpp @@ -1,19 +1,15 @@ -#define SEGMENT_NAME "segment4" +#define SEGMENT_NAME "segment3" #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 escape = ss::escape<'\\'>; 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(); - test_option_combinations(); -#else test_option_combinations3(); + test_option_combinations3(); #endif } diff --git a/test/test_parser2_5.cpp b/test/test_parser2_5.cpp new file mode 100644 index 0000000..71ae35f --- /dev/null +++ b/test/test_parser2_5.cpp @@ -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(); + test_option_combinations(); +#endif +} + diff --git a/test/test_parser2_6.cpp b/test/test_parser2_6.cpp new file mode 100644 index 0000000..49c429b --- /dev/null +++ b/test/test_parser2_6.cpp @@ -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(); + test_option_combinations3(); +#else + test_option_combinations3(); +#endif +} +