|
@@ -11,13 +11,6 @@ find_package(CURL REQUIRED)
|
|
|
# ICU components = data, i18n, io, le, lx, test, tu and uc.
|
|
# ICU components = data, i18n, io, le, lx, test, tu and uc.
|
|
|
find_package(ICU 77.1 COMPONENTS uc i18n)
|
|
find_package(ICU 77.1 COMPONENTS uc i18n)
|
|
|
|
|
|
|
|
-FetchContent_Declare(
|
|
|
|
|
- IDNA
|
|
|
|
|
- GIT_REPOSITORY https://github.com/ada-url/idna.git
|
|
|
|
|
- GIT_TAG 0.5.0
|
|
|
|
|
-)
|
|
|
|
|
-FetchContent_MakeAvailable(IDNA)
|
|
|
|
|
-
|
|
|
|
|
FetchContent_Declare(
|
|
FetchContent_Declare(
|
|
|
json_schema_test_suite
|
|
json_schema_test_suite
|
|
|
GIT_REPOSITORY https://github.com/json-schema-org/JSON-Schema-Test-Suite.git
|
|
GIT_REPOSITORY https://github.com/json-schema-org/JSON-Schema-Test-Suite.git
|
|
@@ -28,11 +21,11 @@ FetchContent_MakeAvailable(json_schema_test_suite)
|
|
|
include(GoogleTest)
|
|
include(GoogleTest)
|
|
|
|
|
|
|
|
add_executable(annotation_test annotation_test.cxx)
|
|
add_executable(annotation_test annotation_test.cxx)
|
|
|
-target_link_libraries(annotation_test GTest::gtest GTest::gmock ada-idna jsoncpp_lib)
|
|
|
|
|
|
|
+target_link_libraries(annotation_test GTest::gtest GTest::gmock jsoncpp_lib)
|
|
|
gtest_discover_tests(annotation_test)
|
|
gtest_discover_tests(annotation_test)
|
|
|
|
|
|
|
|
add_executable(extension_test extension_test.cxx)
|
|
add_executable(extension_test extension_test.cxx)
|
|
|
-target_link_libraries(extension_test GTest::gtest GTest::gmock ada-idna jsoncpp_lib)
|
|
|
|
|
|
|
+target_link_libraries(extension_test GTest::gtest GTest::gmock jsoncpp_lib)
|
|
|
gtest_discover_tests(extension_test)
|
|
gtest_discover_tests(extension_test)
|
|
|
|
|
|
|
|
add_executable(selfvalidate_test selfvalidate_test.cxx)
|
|
add_executable(selfvalidate_test selfvalidate_test.cxx)
|
|
@@ -43,7 +36,7 @@ target_compile_definitions(selfvalidate_test
|
|
|
JVALIDATE_JSON_SCHEMA_TEST_SUITE_DIR="${json_schema_test_suite_SOURCE_DIR}"
|
|
JVALIDATE_JSON_SCHEMA_TEST_SUITE_DIR="${json_schema_test_suite_SOURCE_DIR}"
|
|
|
)
|
|
)
|
|
|
endif()
|
|
endif()
|
|
|
-target_link_libraries(selfvalidate_test GTest::gtest GTest::gmock ada-idna jsoncpp_lib CURL::libcurl)
|
|
|
|
|
|
|
+target_link_libraries(selfvalidate_test GTest::gtest GTest::gmock jsoncpp_lib CURL::libcurl)
|
|
|
|
|
|
|
|
if (ICU_FOUND)
|
|
if (ICU_FOUND)
|
|
|
target_link_libraries(annotation_test ICU::uc ICU::i18n)
|
|
target_link_libraries(annotation_test ICU::uc ICU::i18n)
|
|
@@ -59,16 +52,23 @@ string(
|
|
|
"*optional_zeroTerminatedFloats"
|
|
"*optional_zeroTerminatedFloats"
|
|
|
"*optional_format*"
|
|
"*optional_format*"
|
|
|
)
|
|
)
|
|
|
-if (NOT ${ICU_FOUND})
|
|
|
|
|
|
|
+set(SelfValidateTest_Unsupported_Suites "")
|
|
|
|
|
+set(SelfValidateTest_Unsupported_Cases "*leap second")
|
|
|
|
|
+
|
|
|
|
|
+if (ICU_FOUND)
|
|
|
|
|
+ target_compile_definitions(selfvalidate_test PUBLIC JVALIDATE_HAS_ICU=1)
|
|
|
|
|
+ target_link_libraries(annotation_test ICU::uc ICU::i18n)
|
|
|
|
|
+ target_link_libraries(extension_test ICU::uc ICU::i18n)
|
|
|
|
|
+ target_link_libraries(selfvalidate_test ICU::uc ICU::i18n)
|
|
|
|
|
+else()
|
|
|
|
|
+ target_compile_definitions(selfvalidate_test PUBLIC JVALIDATE_HAS_ICU=0)
|
|
|
string(
|
|
string(
|
|
|
- JOIN ":"
|
|
|
|
|
- SelfValidateTest_Unsupported
|
|
|
|
|
- ${SelfValidateTest_Unsupported}
|
|
|
|
|
- "*optional_non_bmp_regex"
|
|
|
|
|
|
|
+ APPEND SelfValidateTest_Unsupported
|
|
|
|
|
+ ":*optional_non_bmp_regex"
|
|
|
)
|
|
)
|
|
|
endif()
|
|
endif()
|
|
|
-set(SelfValidateTest_Unsupported_Cases "*leap second")
|
|
|
|
|
|
|
|
|
|
gtest_discover_tests(selfvalidate_test
|
|
gtest_discover_tests(selfvalidate_test
|
|
|
- EXTRA_ARGS --json_case_filter=-${SelfValidateTest_Unsupported_Cases}
|
|
|
|
|
|
|
+ EXTRA_ARGS --json_suite_filter=-${SelfValidateTest_Unsupported_Suites}
|
|
|
|
|
+ --json_case_filter=-${SelfValidateTest_Unsupported_Cases}
|
|
|
TEST_FILTER -${SelfValidateTest_Unsupported})
|
|
TEST_FILTER -${SelfValidateTest_Unsupported})
|