diff --git a/CMakeLists.txt b/CMakeLists.txt index b16eb48..7e2d919 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,10 +2,6 @@ cmake_minimum_required(VERSION 3.2.2) cmake_policy(SET CMP0048 NEW) project(Criterion VERSION 1.2.2) -get_cmake_property(_variableNames VARIABLES) -foreach (_variableName ${_variableNames}) - message(STATUS "${_variableName}=${${_variableName}}") -endforeach() set(LOCALEDIR ${CMAKE_INSTALL_PREFIX}/share/locale) set(GettextTranslate_ALL) @@ -75,6 +71,8 @@ set(INTERFACE_FILES include/criterion/stats.h ) +enable_testing() + add_subdirectory(samples) include_directories(include src) diff --git a/samples/CMakeLists.txt b/samples/CMakeLists.txt index a0ccb37..42aee2d 100644 --- a/samples/CMakeLists.txt +++ b/samples/CMakeLists.txt @@ -18,7 +18,25 @@ set(SAMPLES simple ) +set(SCRIPTS + tap_test + early_exit + verbose + list + pattern + fail_fast + help +) + foreach(sample ${SAMPLES}) add_executable(${sample} ${sample}.c) target_link_libraries(${sample} criterion) + add_test(${sample} ${sample}) + set_property(TEST ${sample} PROPERTY + ENVIRONMENT "CRITERION_ALWAYS_SUCCEED=1" + ) +endforeach() + +foreach(script ${SCRIPTS}) + add_test(${script} ${CMAKE_CURRENT_LIST_DIR}/tests/${script}.sh) endforeach()