Fix CI issues (#3906)

Co-authored-by: barcode <barcode@example.com>
This commit is contained in:
Raphael Grimm
2023-01-31 19:23:37 +01:00
committed by GitHub
parent da6b908c4f
commit 233d233439
6 changed files with 24 additions and 18 deletions

View File

@@ -6,6 +6,15 @@ option(JSON_FastTests "Skip expensive/slow tests." OFF)
set(JSON_32bitTest AUTO CACHE STRING "Enable the 32bit unit test (ON/OFF/AUTO/ONLY).")
set(JSON_TestStandards "" CACHE STRING "The list of standards to test explicitly.")
# using an env var, since this will also affect targets executing cmake (such as "ci_test_compiler_default")
set(JSON_FORCED_GLOBAL_COMPILE_OPTIONS $ENV{JSON_FORCED_GLOBAL_COMPILE_OPTIONS})
if (NOT "" STREQUAL "$ENV{JSON_FORCED_GLOBAL_COMPILE_OPTIONS}")
add_compile_options($ENV{JSON_FORCED_GLOBAL_COMPILE_OPTIONS})
endif()
if (NOT "" STREQUAL "$ENV{JSON_FORCED_GLOBAL_LINK_OPTIONS}")
add_link_options($ENV{JSON_FORCED_GLOBAL_LINK_OPTIONS})
endif()
include(test)
#############################################################################

View File

@@ -37,7 +37,9 @@ using ordered_json = nlohmann::ordered_json;
#endif
#ifdef JSON_HAS_CPP_20
#include <span>
#if __has_include(<span>)
#include <span>
#endif
#endif
// NLOHMANN_JSON_SERIALIZE_ENUM uses a static std::pair
@@ -664,6 +666,7 @@ TEST_CASE("regression tests 2")
}
#ifdef JSON_HAS_CPP_20
#if __has_include(<span>)
SECTION("issue #2546 - parsing containers of std::byte")
{
const char DATA[] = R"("Hello, world!")"; // NOLINT(cppcoreguidelines-avoid-c-arrays,hicpp-avoid-c-arrays,modernize-avoid-c-arrays)
@@ -671,6 +674,7 @@ TEST_CASE("regression tests 2")
const json j = json::parse(s);
CHECK(j.dump() == "\"Hello, world!\"");
}
#endif
#endif
SECTION("issue #2574 - Deserialization to std::array, std::pair, and std::tuple with non-default constructable types fails")