1
cmake_minimum_required(VERSION 2.4)
3
string(REGEX REPLACE "^.*/" "" main_dir_name ${CMAKE_SOURCE_DIR})
4
string(REPLACE ${CMAKE_SOURCE_DIR} ${main_dir_name} this_dir ${CMAKE_CURRENT_SOURCE_DIR})
5
message("-- Tests to run for " ${this_dir})
7
# Anything in this dir which ends with "test.c" is considered a test.
8
file(GLOB tests "*test.c")
9
foreach(test_source_fullpath ${tests})
10
string(REGEX REPLACE "^.*/" "" test_source ${test_source_fullpath})
11
string(REPLACE "test.c" "test" test_bin ${test_source})
12
message(" " ${test_source})
13
add_executable(${test_bin} ${test_source})
14
target_link_libraries(${test_bin} crypto benc)
15
add_test(${test_bin} ${test_bin})
17
# Add an empty line after tests.