You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
188 lines
6.7 KiB
188 lines
6.7 KiB
|
4 years ago
|
include(GoogleTest)
|
||
|
7 months ago
|
include(functions/copy_files)
|
||
|
4 years ago
|
|
||
|
|
add_library(libdevilutionx_so SHARED)
|
||
|
3 years ago
|
set_target_properties(libdevilutionx_so PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
||
|
1 year ago
|
|
||
|
|
target_link_dependencies(libdevilutionx_so PUBLIC libdevilutionx)
|
||
|
4 years ago
|
set_target_properties(libdevilutionx_so PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
||
|
|
|
||
|
6 months ago
|
add_library(test_main OBJECT test/main.cpp)
|
||
|
1 year ago
|
target_link_dependencies(test_main PUBLIC libdevilutionx_so GTest::gtest GTest::gmock)
|
||
|
4 years ago
|
|
||
|
|
set(tests
|
||
|
|
animationinfo_test
|
||
|
|
appfat_test
|
||
|
|
automap_test
|
||
|
|
cursor_test
|
||
|
|
dead_test
|
||
|
|
diablo_test
|
||
|
5 years ago
|
drlg_common_test
|
||
|
4 years ago
|
drlg_l1_test
|
||
|
4 years ago
|
drlg_l2_test
|
||
|
4 years ago
|
drlg_l3_test
|
||
|
4 years ago
|
drlg_l4_test
|
||
|
4 years ago
|
effects_test
|
||
|
|
inv_test
|
||
|
2 years ago
|
items_test
|
||
|
4 years ago
|
math_test
|
||
|
4 years ago
|
missiles_test
|
||
|
|
pack_test
|
||
|
|
player_test
|
||
|
|
quests_test
|
||
|
|
scrollrt_test
|
||
|
|
stores_test
|
||
|
1 year ago
|
tile_properties_test
|
||
|
4 years ago
|
timedemo_test
|
||
|
4 years ago
|
writehero_test
|
||
|
|
)
|
||
|
2 years ago
|
set(standalone_tests
|
||
|
2 years ago
|
codec_test
|
||
|
2 years ago
|
crawl_test
|
||
|
1 year ago
|
data_file_test
|
||
|
2 years ago
|
file_util_test
|
||
|
2 years ago
|
format_int_test
|
||
|
1 year ago
|
ini_test
|
||
|
11 months ago
|
palette_blending_test
|
||
|
2 years ago
|
parse_int_test
|
||
|
1 year ago
|
path_test
|
||
|
1 year ago
|
vision_test
|
||
|
1 year ago
|
random_test
|
||
|
|
rectangle_test
|
||
|
|
static_vector_test
|
||
|
2 years ago
|
str_cat_test
|
||
|
2 years ago
|
utf8_test
|
||
|
2 years ago
|
)
|
||
|
1 year ago
|
if(NOT USE_SDL1)
|
||
|
|
list(APPEND standalone_tests text_render_integration_test)
|
||
|
|
endif()
|
||
|
2 years ago
|
set(benchmarks
|
||
|
2 years ago
|
clx_render_benchmark
|
||
|
2 years ago
|
crawl_benchmark
|
||
|
1 year ago
|
dun_render_benchmark
|
||
|
10 months ago
|
light_render_benchmark
|
||
|
11 months ago
|
palette_blending_benchmark
|
||
|
1 year ago
|
path_benchmark
|
||
|
|
)
|
||
|
4 years ago
|
|
||
|
6 months ago
|
include(test/Fixtures.cmake)
|
||
|
4 years ago
|
|
||
|
2 years ago
|
foreach(test_target ${tests} ${standalone_tests} ${benchmarks})
|
||
|
6 months ago
|
add_executable(${test_target} "test/${test_target}.cpp")
|
||
|
3 years ago
|
set_target_properties(${test_target} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
||
|
4 years ago
|
if(GPERF)
|
||
|
|
target_link_libraries(${test_target} PUBLIC ${GPERFTOOLS_LIBRARIES})
|
||
|
|
endif()
|
||
|
4 years ago
|
endforeach()
|
||
|
|
|
||
|
2 years ago
|
foreach(test_target ${tests} ${standalone_tests})
|
||
|
|
gtest_discover_tests(${test_target})
|
||
|
|
endforeach()
|
||
|
|
|
||
|
2 years ago
|
foreach(test_target ${tests})
|
||
|
|
target_link_libraries(${test_target} PRIVATE test_main)
|
||
|
|
endforeach()
|
||
|
|
|
||
|
|
foreach(test_target ${standalone_tests})
|
||
|
2 years ago
|
target_link_libraries(${test_target} PRIVATE GTest::gtest_main)
|
||
|
2 years ago
|
target_include_directories(${test_target} PRIVATE "${PROJECT_SOURCE_DIR}/Source")
|
||
|
|
endforeach()
|
||
|
|
|
||
|
2 years ago
|
foreach(target ${benchmarks})
|
||
|
|
target_link_libraries(${target} PRIVATE benchmark::benchmark benchmark::benchmark_main)
|
||
|
|
target_include_directories(${target} PRIVATE "${PROJECT_SOURCE_DIR}/Source")
|
||
|
|
endforeach()
|
||
|
|
|
||
|
6 months ago
|
add_library(app_fatal_for_testing OBJECT test/app_fatal_for_testing.cpp)
|
||
|
2 years ago
|
target_sources(app_fatal_for_testing INTERFACE $<TARGET_OBJECTS:app_fatal_for_testing>)
|
||
|
|
|
||
|
6 months ago
|
add_library(language_for_testing OBJECT test/language_for_testing.cpp)
|
||
|
2 years ago
|
target_sources(language_for_testing INTERFACE $<TARGET_OBJECTS:language_for_testing>)
|
||
|
|
|
||
|
1 year ago
|
target_link_dependencies(codec_test PRIVATE libdevilutionx_codec app_fatal_for_testing)
|
||
|
9 months ago
|
target_link_dependencies(clx_render_benchmark
|
||
|
|
PRIVATE
|
||
|
|
DevilutionX::SDL
|
||
|
|
tl
|
||
|
|
app_fatal_for_testing
|
||
|
|
language_for_testing
|
||
|
|
libdevilutionx_clx_render
|
||
|
|
libdevilutionx_load_clx
|
||
|
|
libdevilutionx_log
|
||
|
|
libdevilutionx_surface
|
||
|
|
)
|
||
|
1 year ago
|
target_link_dependencies(crawl_test PRIVATE libdevilutionx_crawl)
|
||
|
|
target_link_dependencies(crawl_benchmark PRIVATE libdevilutionx_crawl)
|
||
|
1 year ago
|
target_link_dependencies(data_file_test PRIVATE libdevilutionx_txtdata app_fatal_for_testing language_for_testing)
|
||
|
1 year ago
|
target_link_dependencies(dun_render_benchmark PRIVATE libdevilutionx_so)
|
||
|
|
target_link_dependencies(file_util_test PRIVATE libdevilutionx_file_util app_fatal_for_testing)
|
||
|
|
target_link_dependencies(format_int_test PRIVATE libdevilutionx_format_int language_for_testing)
|
||
|
|
target_link_dependencies(ini_test PRIVATE libdevilutionx_ini app_fatal_for_testing)
|
||
|
10 months ago
|
target_link_dependencies(light_render_benchmark PRIVATE libdevilutionx_light_render DevilutionX::SDL libdevilutionx_surface libdevilutionx_paths app_fatal_for_testing)
|
||
|
11 months ago
|
target_link_dependencies(palette_blending_test PRIVATE libdevilutionx_palette_blending DevilutionX::SDL libdevilutionx_strings GTest::gmock app_fatal_for_testing)
|
||
|
8 months ago
|
target_link_dependencies(palette_blending_benchmark
|
||
|
|
PRIVATE
|
||
|
|
DevilutionX::SDL
|
||
|
|
libdevilutionx_palette_blending
|
||
|
|
libdevilutionx_palette_kd_tree
|
||
|
|
app_fatal_for_testing
|
||
|
|
)
|
||
|
1 year ago
|
target_link_dependencies(parse_int_test PRIVATE libdevilutionx_parse_int)
|
||
|
1 year ago
|
target_link_dependencies(path_test PRIVATE libdevilutionx_pathfinding libdevilutionx_direction app_fatal_for_testing)
|
||
|
1 year ago
|
target_link_dependencies(vision_test PRIVATE libdevilutionx_vision)
|
||
|
1 year ago
|
target_link_dependencies(path_benchmark PRIVATE libdevilutionx_pathfinding app_fatal_for_testing)
|
||
|
1 year ago
|
target_link_dependencies(random_test PRIVATE libdevilutionx_random)
|
||
|
|
target_link_dependencies(static_vector_test PRIVATE libdevilutionx_random app_fatal_for_testing)
|
||
|
1 year ago
|
target_link_dependencies(str_cat_test PRIVATE libdevilutionx_strings)
|
||
|
9 months ago
|
if(DEVILUTIONX_SCREENSHOT_FORMAT STREQUAL DEVILUTIONX_SCREENSHOT_FORMAT_PNG AND NOT USE_SDL1)
|
||
|
|
target_link_dependencies(text_render_integration_test
|
||
|
|
PRIVATE
|
||
|
|
DevilutionX::SDL
|
||
|
|
GTest::gmock
|
||
|
|
GTest::gtest
|
||
|
|
tl
|
||
|
|
app_fatal_for_testing
|
||
|
|
language_for_testing
|
||
|
|
libdevilutionx_primitive_render
|
||
|
|
libdevilutionx_strings
|
||
|
|
libdevilutionx_surface
|
||
|
|
libdevilutionx_surface_to_png
|
||
|
|
libdevilutionx_text_render
|
||
|
|
)
|
||
|
7 months ago
|
copy_files(
|
||
|
|
FILES
|
||
|
|
basic-colors.png
|
||
|
|
basic.png
|
||
|
|
horizontal_overflow.png
|
||
|
|
horizontal_overflow-colors.png
|
||
|
|
kerning_fit_spacing-colors.png
|
||
|
|
kerning_fit_spacing.png
|
||
|
|
kerning_fit_spacing__align_center-colors.png
|
||
|
|
kerning_fit_spacing__align_center.png
|
||
|
|
kerning_fit_spacing__align_center__newlines.png
|
||
|
|
kerning_fit_spacing__align_center__newlines_in_fmt-colors.png
|
||
|
|
kerning_fit_spacing__align_center__newlines_in_value-colors.png
|
||
|
|
kerning_fit_spacing__align_right-colors.png
|
||
|
|
kerning_fit_spacing__align_right.png
|
||
|
|
vertical_overflow.png
|
||
|
|
vertical_overflow-colors.png
|
||
|
6 months ago
|
SRC_PREFIX test/fixtures/text_render_integration_test/
|
||
|
7 months ago
|
OUTPUT_DIR "${DEVILUTIONX_TEST_FIXTURES_OUTPUT_DIRECTORY}/text_render_integration_test"
|
||
|
|
OUTPUT_VARIABLE _text_render_integration_test_fixtures
|
||
|
|
)
|
||
|
|
add_custom_target(text_render_integration_test_resources
|
||
|
|
DEPENDS
|
||
|
|
"${DEVILUTIONX_ASSETS_OUTPUT_DIRECTORY}/fonts/12-00.clx"
|
||
|
|
"${DEVILUTIONX_ASSETS_OUTPUT_DIRECTORY}/fonts/goldui.trn"
|
||
|
|
"${DEVILUTIONX_ASSETS_OUTPUT_DIRECTORY}/fonts/golduis.trn"
|
||
|
|
"${DEVILUTIONX_ASSETS_OUTPUT_DIRECTORY}/fonts/grayuis.trn"
|
||
|
|
"${DEVILUTIONX_ASSETS_OUTPUT_DIRECTORY}/fonts/grayui.trn"
|
||
|
|
"${DEVILUTIONX_ASSETS_OUTPUT_DIRECTORY}/ui_art/diablo.pal"
|
||
|
|
${_text_render_integration_test_fixtures}
|
||
|
|
)
|
||
|
|
add_dependencies(text_render_integration_test text_render_integration_test_resources)
|
||
|
11 months ago
|
endif()
|
||
|
1 year ago
|
target_link_dependencies(utf8_test PRIVATE libdevilutionx_utf8)
|
||
|
2 years ago
|
|
||
|
6 months ago
|
target_include_directories(writehero_test PRIVATE 3rdParty/PicoSHA2)
|