28 lines
717 B
CMake
28 lines
717 B
CMake
if (NOT BUILD_TESTING)
|
|
message("-- Tests disabled")
|
|
return()
|
|
endif()
|
|
message("-- Tests enabled")
|
|
|
|
set(MPACK_TEST
|
|
${MPACK_SRC}
|
|
test.c
|
|
test-buffer.c
|
|
test-common.c
|
|
test-expect.c
|
|
test-file.c
|
|
test-node.c
|
|
test-reader.c
|
|
test-system.c
|
|
test-write.c
|
|
)
|
|
|
|
include_directories("${CMAKE_CURRENT_SOURCE_DIR}")
|
|
|
|
file(COPY test-file.debug test-file.mp test-file.json DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
add_executable(mpack_test ${MPACK_TEST})
|
|
set_target_properties(mpack_test PROPERTIES COMPILE_FLAGS "-Wno-shadow")
|
|
add_test(NAME mpack_test COMMAND "${CMAKE_CURRENT_BINARY_DIR}/mpack_test" WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/../)
|
|
set_property(TEST "mpack_test" PROPERTY ENVIRONMENT "TESTNAME=mpack_test")
|