This repository has been archived by the owner on Nov 28, 2023. It is now read-only.
forked from Ristellise/AegisubDC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.test.txt
76 lines (74 loc) · 2.7 KB
/
CMakeLists.test.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
if(UNIX)
add_executable(aegisub-lua EXCLUDE_FROM_ALL
automation/tests/aegisub.cpp
)
target_link_libraries(aegisub-lua PRIVATE libaegisub luabins luajit "Boost::locale")
add_custom_target(test-automation
COMMAND sh -c "$(luarocks path); ${PROJECT_BINARY_DIR}/aegisub-lua tests/busted.lua -p moon tests/modules"
VERBATIM
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}/automation"
)
add_dependencies(test-automation aegisub-lua)
else()
add_custom_target(test-automation)
endif()
find_package(GTest)
if(GTEST_FOUND)
add_executable(gtest-run EXCLUDE_FROM_ALL
tests/tests/access.cpp
tests/tests/audio.cpp
tests/tests/cajun.cpp
tests/tests/calltip_provider.cpp
tests/tests/character_count.cpp
tests/tests/color.cpp
tests/tests/dialogue_lexer.cpp
tests/tests/format.cpp
tests/tests/fs.cpp
tests/tests/hotkey.cpp
tests/tests/iconv.cpp
tests/tests/ifind.cpp
tests/tests/karaoke_matcher.cpp
tests/tests/keyframe.cpp
tests/tests/line_iterator.cpp
tests/tests/line_wrap.cpp
tests/tests/mru.cpp
tests/tests/option.cpp
tests/tests/path.cpp
tests/tests/signals.cpp
tests/tests/split.cpp
tests/tests/syntax_highlight.cpp
tests/tests/thesaurus.cpp
tests/tests/time.cpp
tests/tests/type_name.cpp
tests/tests/util.cpp
tests/tests/uuencode.cpp
tests/tests/vfr.cpp
tests/tests/word_split.cpp
tests/support/main.cpp
tests/support/util.cpp
)
target_compile_definitions(gtest-run PRIVATE CMAKE_BUILD)
target_include_directories(gtest-run PRIVATE "${PROJECT_SOURCE_DIR}/tests/support")
target_link_libraries(gtest-run PRIVATE libaegisub "Boost::filesystem" "GTest::GTest" "Iconv::Iconv")
if(MSVC)
set_target_properties(gtest-run PROPERTIES COMPILE_FLAGS "/Yu${PROJECT_SOURCE_DIR}/tests/support/tests_pre.h" COMPILE_FLAGS "/FI${PROJECT_SOURCE_DIR}/tests/support/tests_pre.h")
else()
target_compile_options(gtest-run PRIVATE -include "${PROJECT_SOURCE_DIR}/tests/support/tests_pre.h")
endif()
if(WIN32)
add_custom_target(test-aegisub
COMMAND "${PROJECT_SOURCE_DIR}/tests/setup.bat"
COMMAND gtest-run
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}/tests"
)
else()
add_custom_target(test-aegisub
COMMAND "${PROJECT_SOURCE_DIR}/tests/setup.sh"
COMMAND gtest-run
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}/tests"
)
endif()
else()
add_custom_target(test-aegisub)
endif()
add_custom_target(test DEPENDS test-automation test-aegisub)