Schema a now "parsed" into C++-validator-objects in a first step and then validation takes place with these objects. Errors are now handled via a user-provided error-handler allowing the user to collect all errors at once or bail out when a certain threshold is reached. Fixes #36 and #8. One (sub-)schema can now be referenced with different URIs. Fixes #9 JSON schema draft 7 is now supported. Fixes #35
26 lines
653 B
CMake
26 lines
653 B
CMake
set(PIPE_IN_TEST_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/test-pipe-in.sh)
|
|
|
|
# built-in tests
|
|
function(add_test_simple_schema name schema instance)
|
|
add_test(
|
|
NAME ${name}
|
|
COMMAND ${PIPE_IN_TEST_SCRIPT}
|
|
$<TARGET_FILE:json-schema-validate>
|
|
${schema}
|
|
${instance}
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
|
|
endfunction()
|
|
|
|
file(GLOB TEST_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/*)
|
|
|
|
foreach(DIR ${TEST_DIRS})
|
|
if(IS_DIRECTORY ${DIR})
|
|
add_subdirectory(${DIR})
|
|
endif()
|
|
endforeach()
|
|
|
|
add_executable(uri uri.cpp)
|
|
target_link_libraries(uri json-schema-validator)
|
|
|
|
add_test(NAME uri COMMAND uri)
|