Add blackbox, valgrind tests

This commit is contained in:
2024-01-30 11:46:49 -08:00
parent eca1b9993a
commit 808ffbcbdf
2 changed files with 27 additions and 10 deletions

View File

@@ -101,15 +101,31 @@ endif()
file(GLOB CORPUS_TESTS ${CMAKE_SOURCE_DIR}/corpus/*)
add_executable(conflict_set_test_driver ConflictSet.cpp TestDriver.cpp)
target_compile_options(conflict_set_test_driver PRIVATE ${TEST_FLAGS})
target_compile_definitions(conflict_set_test_driver PRIVATE ENABLE_FUZZ)
target_include_directories(conflict_set_test_driver
add_executable(fuzz_driver ConflictSet.cpp FuzzTestDriver.cpp)
target_compile_options(fuzz_driver PRIVATE ${TEST_FLAGS})
target_compile_definitions(fuzz_driver PRIVATE ENABLE_FUZZ)
target_include_directories(fuzz_driver
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include)
foreach(TEST ${CORPUS_TESTS})
get_filename_component(hash ${TEST} NAME)
add_test(NAME conflict_set_corpus_${hash} COMMAND conflict_set_test_driver
${TEST})
add_test(NAME conflict_set_fuzz_${hash} COMMAND fuzz_driver ${TEST})
endforeach()
add_executable(driver TestDriver.cpp)
target_link_libraries(driver PRIVATE ${PROJECT_NAME})
find_program(VALGRIND_EXE valgrind)
if(VALGRIND_EXE)
add_test(NAME conflict_set_blackbox_valgrind
COMMAND ${VALGRIND_EXE} --error-exitcode=99 -- $<TARGET_FILE:driver>
${CORPUS_TESTS})
else()
endif()
foreach(TEST ${CORPUS_TESTS})
get_filename_component(hash ${TEST} NAME)
add_test(NAME conflict_set_blackbox_${hash} COMMAND driver ${TEST})
endforeach()
# api smoke tests