Criterion/test/CMakeLists.txt

35 lines
815 B
Text
Raw Normal View History

2015-09-05 15:47:47 -07:00
if (NOT MSVC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS_DEFAULT} -std=gnu99 -Wall -Wextra")
if (CMAKE_CXX_COMPILER_WORKS)
2015-11-25 20:10:09 +01:00
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_DEFAULT} ${CXX11_FLAG} -Wall -Wextra")
endif ()
2015-09-05 15:47:47 -07:00
endif ()
2015-08-21 06:30:20 +02:00
include_directories(../include ../src)
set(TEST_SOURCES
ordered-set.c
)
2015-11-27 15:53:10 +01:00
if (THEORIES)
set(TEST_SOURCES ${TEST_SOURCES}
asprintf.c
)
endif ()
if (CMAKE_CXX_COMPILER_WORKS)
set(TEST_SOURCES ${TEST_SOURCES}
redirect.cc
)
endif ()
add_executable(criterion_unit_tests EXCLUDE_FROM_ALL ${TEST_SOURCES})
target_link_libraries(criterion_unit_tests criterion)
2015-08-21 06:30:20 +02:00
add_dependencies(criterion_tests criterion_unit_tests)
add_test(criterion_unit_tests criterion_unit_tests)
set_property(TEST criterion_unit_tests PROPERTY
ENVIRONMENT "CRITERION_NO_EARLY_EXIT=1" # for coverage
)