Criterion/samples/CMakeLists.txt
ailu 7143118b5c api: added cr_skip_test()
Added cr_skip_test to skip a test during runtime. Also merged the old
disable system with the new one. All skipped tests are printed by
normal_log_post_suite(), so there is no need for a logger function for
runtime skipepd tests.
Fixes #131.
2016-09-03 23:06:35 +02:00

70 lines
1.5 KiB
CMake

if (NOT MSVC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS_DEFAULT} -std=c99 -Wall -Wextra -pedantic")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_DEFAULT} ${CXX11_FLAG} -Wall -Wextra -pedantic")
if (MINGW)
# see http://sourceforge.net/p/mingw/bugs/2250/
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__NO_INLINE__")
endif ()
endif ()
include_directories(../include)
set(SAMPLES
signal.c
report.c
suites.c
fixtures.c
asserts.c
more-suites.c
description.c
simple.c
timeout.c
redirect.c
parameterized.c
log.c
skip.c
)
if (CMAKE_CXX_COMPILER_WORKS)
set(SAMPLES ${SAMPLES}
signal.cc
report.cc
suites.cc
fixtures.cc
asserts.cc
more-suites.cc
description.cc
simple.cc
redirect.cc
parameterized.cc
log.cc
skip.cc
)
endif ()
if (THEORIES)
set(SAMPLES ${SAMPLES} theories.c)
if (CMAKE_CXX_COMPILER_WORKS)
set(SAMPLES ${SAMPLES} theories.cc)
endif ()
endif ()
add_custom_target(criterion_samples)
add_dependencies(criterion_tests criterion_samples)
macro(add_samples DIR_ SAMPLES_)
foreach(sample ${SAMPLES_})
add_executable(${sample}.bin EXCLUDE_FROM_ALL ${sample})
add_dependencies(criterion_samples ${sample}.bin)
target_link_libraries(${sample}.bin criterion)
add_test(${sample} ${sample}.bin)
set_property(TEST ${sample} PROPERTY
ENVIRONMENT "CRITERION_ALWAYS_SUCCEED=1"
)
endforeach()
endmacro()
add_samples("${CMAKE_CURRENT_LIST_DIR}/tests" "${SAMPLES}")
add_subdirectory(tests)