Skip to content

Commit

Permalink
CL: Restored CMakeLists to original state
Browse files Browse the repository at this point in the history
  • Loading branch information
sebasfalcone authored and pboettch committed Oct 29, 2022
1 parent 2a2d2d2 commit 56bb4a4
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions test/JSON-Schema-Test-Suite/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ set(DRAFT "draft7")
# find schema-test-suite
find_path(JSON_SCHEMA_TEST_SUITE_PATH
NAMES
tests/${DRAFT})
tests/${DRAFT})

if(NOT JSON_SCHEMA_TEST_SUITE_PATH)
if (NOT JSON_SCHEMA_TEST_SUITE_PATH)
message(STATUS "Set JSON_SCHEMA_TEST_SUITE_PATH to a path in which JSON-Schema-Test-Suite is located (github.com/json-schema-org/JSON-Schema-Test-Suite). Using internal test-suite which might be out of date.")
set(JSON_SCHEMA_TEST_SUITE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
endif()
Expand All @@ -18,7 +18,7 @@ if(JSON_SCHEMA_TEST_SUITE_PATH)
target_link_libraries(json-schema-test nlohmann_json_schema_validator)
target_compile_definitions(json-schema-test
PRIVATE
JSON_SCHEMA_TEST_SUITE_PATH="${JSON_SCHEMA_TEST_SUITE_PATH}")
JSON_SCHEMA_TEST_SUITE_PATH="${JSON_SCHEMA_TEST_SUITE_PATH}")

option(JSON_SCHEMA_ENABLE_OPTIONAL_TESTS "Enable optional tests of the JSONSchema Test Suite" ON)

Expand All @@ -28,23 +28,23 @@ if(JSON_SCHEMA_TEST_SUITE_PATH)
foreach(TEST_FILE ${TEST_FILES})
get_filename_component(TEST_NAME ${TEST_FILE} NAME_WE)
add_test(NAME "${JSON_SCHEMA_TEST_PREFIX}::${TEST_NAME}"
COMMAND ${PIPE_IN_TEST_SCRIPT} $<TARGET_FILE:json-schema-test> ${TEST_FILE})
COMMAND ${PIPE_IN_TEST_SCRIPT} $<TARGET_FILE:json-schema-test> ${TEST_FILE})
endforeach()

if(JSON_SCHEMA_ENABLE_OPTIONAL_TESTS)
if (JSON_SCHEMA_ENABLE_OPTIONAL_TESTS)
file(GLOB OPT_TEST_FILES ${JSON_SCHEMA_TEST_SUITE_PATH}/tests/${DRAFT}/optional/*.json)
file(GLOB FORMAT_TEST_FILES ${JSON_SCHEMA_TEST_SUITE_PATH}/tests/${DRAFT}/optional/format/*.json)

foreach(TEST_FILE ${OPT_TEST_FILES})
get_filename_component(TEST_NAME ${TEST_FILE} NAME_WE)
add_test(NAME "${JSON_SCHEMA_TEST_PREFIX}::Optional::${TEST_NAME}"
COMMAND ${PIPE_IN_TEST_SCRIPT} $<TARGET_FILE:json-schema-test> ${TEST_FILE})
COMMAND ${PIPE_IN_TEST_SCRIPT} $<TARGET_FILE:json-schema-test> ${TEST_FILE})
endforeach()

foreach(TEST_FILE ${FORMAT_TEST_FILES})
get_filename_component(TEST_NAME ${TEST_FILE} NAME_WE)
add_test(NAME "${JSON_SCHEMA_TEST_PREFIX}::Optional::Format::${TEST_NAME}"
COMMAND ${PIPE_IN_TEST_SCRIPT} $<TARGET_FILE:json-schema-test> ${TEST_FILE})
COMMAND ${PIPE_IN_TEST_SCRIPT} $<TARGET_FILE:json-schema-test> ${TEST_FILE})
endforeach()

# some optional tests will fail
Expand All @@ -65,7 +65,7 @@ if(JSON_SCHEMA_TEST_SUITE_PATH)
JSON-Suite::Optional::unicode

PROPERTIES
WILL_FAIL ON)
WILL_FAIL ON)
endif()
else()
endif()

0 comments on commit 56bb4a4

Please sign in to comment.