This way the validator can be used static/global loading once a root-schema. As no try/catch-compound can be placed around, it has to be a valid schema. Related to #70
37 lines
1.1 KiB
CMake
37 lines
1.1 KiB
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)
|
|
|
|
add_executable(errors errors.cpp)
|
|
target_link_libraries(errors json-schema-validator)
|
|
add_test(NAME errors COMMAND errors)
|
|
|
|
add_executable(issue-70 issue-70.cpp)
|
|
target_link_libraries(issue-70 json-schema-validator)
|
|
add_test(NAME issue-70 COMMAND issue-70)
|
|
|
|
add_executable(issue-70-root-schema-constructor issue-70-root-schema-constructor.cpp)
|
|
target_link_libraries(issue-70-root-schema-constructor json-schema-validator)
|
|
add_test(NAME issue-70-root-schema-constructor COMMAND issue-70-root-schema-constructor)
|