2015-09-05 21:06:18 +02:00
|
|
|
if (NOT MSVC)
|
|
|
|
set(CMAKE_C_FLAGS "-std=c99 -Wall -Wextra -pedantic")
|
2015-09-07 01:58:15 +02:00
|
|
|
set(CMAKE_CXX_FLAGS "-std=c++11 -Wall -Wextra")
|
2015-09-05 21:06:18 +02:00
|
|
|
endif ()
|
2015-07-28 19:03:46 +02:00
|
|
|
|
|
|
|
include_directories(../include)
|
|
|
|
|
|
|
|
set(SAMPLES
|
2015-09-07 01:42:15 +02:00
|
|
|
signal.c
|
|
|
|
exit.c
|
|
|
|
report.c
|
|
|
|
suites.c
|
|
|
|
fixtures.c
|
|
|
|
asserts.c
|
|
|
|
more-suites.c
|
|
|
|
long-messages.c
|
|
|
|
description.c
|
|
|
|
other-crashes.c
|
|
|
|
simple.c
|
|
|
|
theories.c
|
|
|
|
|
|
|
|
signal.cc
|
|
|
|
exit.cc
|
2015-09-07 05:42:25 +02:00
|
|
|
report.cc
|
2015-09-07 01:42:15 +02:00
|
|
|
suites.cc
|
|
|
|
fixtures.cc
|
|
|
|
asserts.cc
|
|
|
|
more-suites.cc
|
|
|
|
long-messages.cc
|
|
|
|
description.cc
|
|
|
|
other-crashes.cc
|
|
|
|
simple.cc
|
2015-07-28 19:03:46 +02:00
|
|
|
)
|
|
|
|
|
2015-07-29 11:58:51 +02:00
|
|
|
set(SCRIPTS
|
|
|
|
tap_test
|
|
|
|
early_exit
|
|
|
|
verbose
|
|
|
|
list
|
|
|
|
fail_fast
|
|
|
|
help
|
|
|
|
)
|
|
|
|
|
2015-08-21 00:26:51 +02:00
|
|
|
if (HAVE_PCRE)
|
|
|
|
set(SCRIPTS ${SCRIPTS} pattern)
|
|
|
|
endif ()
|
|
|
|
|
2015-07-28 19:03:46 +02:00
|
|
|
foreach(sample ${SAMPLES})
|
2015-09-07 01:42:15 +02:00
|
|
|
add_executable(${sample}.bin ${sample})
|
|
|
|
target_link_libraries(${sample}.bin criterion)
|
|
|
|
add_test(${sample} ${sample}.bin)
|
2015-09-07 01:15:31 +02:00
|
|
|
set_property(TEST ${sample} PROPERTY
|
|
|
|
ENVIRONMENT "CRITERION_ALWAYS_SUCCEED=1"
|
|
|
|
)
|
|
|
|
|
2015-09-06 03:29:41 +02:00
|
|
|
if (NOT MSVC) # we disable the scripted tests when building with MSVC
|
2015-09-07 01:42:15 +02:00
|
|
|
add_test(${sample}_compare sh ${CMAKE_CURRENT_LIST_DIR}/tests/run_test.sh "${CMAKE_CURRENT_LIST_DIR}" . . ${sample}.bin)
|
2015-09-06 03:29:41 +02:00
|
|
|
set_property(TEST ${sample}_compare PROPERTY
|
|
|
|
ENVIRONMENT "LC_ALL=en_US.utf8"
|
|
|
|
ENVIRONMENT "CRITERION_ALWAYS_SUCCEED=1"
|
|
|
|
ENVIRONMENT "CRITERION_SHORT_FILENAME=1"
|
|
|
|
)
|
|
|
|
endif ()
|
2015-07-29 11:58:51 +02:00
|
|
|
endforeach()
|
|
|
|
|
2015-09-06 02:45:58 +02:00
|
|
|
if (NOT MSVC) # we disable the scripted tests when building with MSVC
|
|
|
|
|
2015-07-29 11:58:51 +02:00
|
|
|
foreach(script ${SCRIPTS})
|
2015-07-31 09:06:32 +02:00
|
|
|
add_test(${script} sh ${CMAKE_CURRENT_LIST_DIR}/tests/${script}.sh)
|
2015-08-04 15:50:13 +02:00
|
|
|
set_property(TEST ${script} PROPERTY
|
|
|
|
ENVIRONMENT "CRITERION_ALWAYS_SUCCEED=1"
|
|
|
|
)
|
2015-08-20 07:20:29 +02:00
|
|
|
|
2015-08-21 00:21:48 +02:00
|
|
|
add_test(${script}_compare sh ${CMAKE_CURRENT_LIST_DIR}/tests/run_test.sh "${CMAKE_CURRENT_LIST_DIR}" . "${CMAKE_CURRENT_LIST_DIR}" tests/${script})
|
2015-08-20 07:20:29 +02:00
|
|
|
set_property(TEST ${script}_compare PROPERTY
|
2015-08-20 17:45:28 +02:00
|
|
|
ENVIRONMENT "LC_ALL=en_US.utf8"
|
2015-08-20 07:20:29 +02:00
|
|
|
ENVIRONMENT "CRITERION_ALWAYS_SUCCEED=1"
|
2015-08-20 08:33:22 +02:00
|
|
|
ENVIRONMENT "CRITERION_SHORT_FILENAME=1"
|
2015-08-20 07:20:29 +02:00
|
|
|
)
|
2015-07-28 19:03:46 +02:00
|
|
|
endforeach()
|
2015-09-06 02:45:58 +02:00
|
|
|
|
|
|
|
endif()
|