-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
44 lines (38 loc) · 1.39 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
cmake_minimum_required(VERSION 2.6)
project(konohatest)
enable_testing()
macro(add_konoha_test test_name)
add_test(${test_name} ${TEST_BIN} ${ARGN})
set_tests_properties(${test_name} PROPERTIES TIMEOUT 10)
endmacro(add_konoha_test test_name)
if(NOT TARGET)
message(FATAL_ERROR "please set TARGET")
endif(NOT TARGET)
if(NOT TEST_BIN)
message(FATAL_ERROR "please set TEST_BIN")
endif(NOT TEST_BIN)
if(${TARGET} STREQUAL "IronKonoha")
message(STATUS "setting for IronKonoha")
elseif(${TARGET} STREQUAL "IronKonoha_mono")
message(STATUS "setting for IronKonoha on mono")
set(TEST_BIN mono ${TEST_BIN})
elseif(${TARGET} STREQUAL "JKonoha")
message(STATUS "setting for JKonoha")
set(TEST_BIN java -jar ${TEST_BIN})
elseif(${TARGET} STREQUAL "JSKonoha")
message(STATUS "setting for JSKonoha")
set(TEST_BIN sh +x ${CMAKE_CURRENT_SOURCE_DIR}/jskonoha.sh -x -j ${TEST_BIN})
macro(add_konoha_test test_name)
add_test(${test_name} ${TEST_BIN} -k ${ARGN} -o
${CMAKE_CURRENT_BINARY_DIR}/${test_name}.xml)
set_tests_properties(${test_name} PROPERTIES TIMEOUT 10)
endmacro(add_konoha_test test_name)
else()
message(FATAL_ERROR "undefined TARGET")
endif()
file(GLOB_RECURSE test_files ${CMAKE_CURRENT_SOURCE_DIR}/Release/*.k)
foreach(f ${test_files})
string(REPLACE // / f ${f})
string(REPLACE ${CMAKE_CURRENT_SOURCE_DIR}/Release/ "" test_name ${f})
add_konoha_test(${test_name} ${f})
endforeach(f ${test_files})