| 1 |
add_executable(unit_test unit_test.cxx) |
| 2 |
target_link_libraries(unit_test PRIVATE nuspell Catch2::Catch2WithMain) |
| 3 |
if (MSVC) |
| 4 |
target_compile_options(unit_test PRIVATE "/utf-8") |
| 5 |
# Consider doing this for all the other targets by setting this flag |
| 6 |
# globally for MSVC. ATM we use unicode string literals only here. |
| 7 |
endif() |
| 8 |
|
| 9 |
add_executable(legacy_test legacy_test.cxx) |
| 10 |
target_link_libraries(legacy_test PRIVATE nuspell) |
| 11 |
|
| 12 |
add_executable(verify verify.cxx) |
| 13 |
target_link_libraries(verify PRIVATE nuspell hunspell) |
| 14 |
if (MSVC) |
| 15 |
target_include_directories(verify PRIVATE ${GETOPT_INCLUDE_DIR}) |
| 16 |
target_link_libraries(verify PRIVATE ${GETOPT_LIBRARY}) |
| 17 |
endif() |
| 18 |
|
| 19 |
if (BUILD_SHARED_LIBS AND WIN32) |
| 20 |
add_custom_command(TARGET verify PRE_LINK |
| 21 |
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:nuspell> |
| 22 |
$<TARGET_FILE:hunspell> $<TARGET_FILE_DIR:unit_test>) |
| 23 |
endif() |
| 24 |
|
| 25 |
add_test(NAME unit_test COMMAND unit_test) |
| 26 |
|
| 27 |
file(GLOB v1tests |
| 28 |
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/v1cmdline |
| 29 |
"v1cmdline/*.dic" |
| 30 |
"v1cmdline/*.sug") |
| 31 |
foreach(t ${v1tests}) |
| 32 |
add_test( |
| 33 |
NAME ${t} |
| 34 |
COMMAND legacy_test ${CMAKE_CURRENT_SOURCE_DIR}/v1cmdline/${t}) |
| 35 |
endforeach() |
| 36 |
|
| 37 |
set_tests_properties( |
| 38 |
base_utf.dic |
| 39 |
nepali.dic |
| 40 |
checksharps.sug |
| 41 |
checksharpsutf.sug |
| 42 |
nosuggest.sug |
| 43 |
phone.sug |
| 44 |
utf8_nonbmp.sug |
| 45 |
|
| 46 |
PROPERTIES WILL_FAIL TRUE) |