forked from CleverRaven/Cataclysm-DDA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
55 lines (49 loc) · 2.12 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
45
46
47
48
49
50
51
52
53
54
55
cmake_minimum_required(VERSION 3.1.4)
if (BUILD_TESTING)
file(GLOB CATACLYSM_DDA_TEST_SOURCES
${CMAKE_SOURCE_DIR}/tests/*.cpp)
# Enabling benchmarks
add_definitions(-DCATCH_CONFIG_ENABLE_BENCHMARKING)
if(LOCALIZE)
# Need to build the test .mo file for the tests to pass.
# Unfortunately we currently need to put this in the source dir, not the
# build dir
set(TEST_LANG ${CMAKE_SOURCE_DIR}/data/mods/TEST_DATA/lang)
set(TEST_MO ${TEST_LANG}/mo/ru/LC_MESSAGES/TEST_DATA.mo)
add_custom_command(
OUTPUT ${TEST_MO}
MAIN_DEPENDENCY ${TEST_LANG}/po/ru.po
COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -f -o ${TEST_MO} ${TEST_LANG}/po/ru.po)
add_custom_target(test_mo DEPENDS ${TEST_MO})
endif()
if (TILES)
add_executable(cata_test-tiles ${CATACLYSM_DDA_TEST_SOURCES})
if (LOCALIZE)
add_dependencies(cata_test-tiles test_mo)
endif()
target_link_libraries(cata_test-tiles PRIVATE cataclysm-tiles-common)
add_test(NAME test-tiles
COMMAND cata_test-tiles --rng-seed time
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
# ctest -C RelWithDebInfo -j 2 -V -L ^gha$
list(APPEND _n 1 2)
list(APPEND _args "[slow] ~starting_items" "~[slow] ~[.],starting_items")
foreach(n args IN ZIP_LISTS _n _args)
add_test(NAME test-tiles-gha-${n}
COMMAND cata_test-tiles --min-duration 20 --use-colour yes --rng-seed time
--user-dir=test_user_dir_${n} ${args}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
set_tests_properties(test-tiles-gha-${n} PROPERTIES LABELS "gha")
endforeach()
endif ()
if (CURSES)
add_executable(cata_test ${CATACLYSM_DDA_TEST_SOURCES})
if (LOCALIZE)
add_dependencies(cata_test test_mo)
endif()
target_link_libraries(cata_test PRIVATE cataclysm-common)
add_test(NAME test
COMMAND cata_test --rng-seed time
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
endif ()
endif ()