mirror of
https://github.com/aseprite/aseprite.git
synced 2024-10-06 06:50:07 +00:00
Use ctest to run tests
This commit is contained in:
parent
d70dc87253
commit
795c4d5a87
@ -23,4 +23,4 @@ before_script:
|
|||||||
|
|
||||||
script:
|
script:
|
||||||
- "make"
|
- "make"
|
||||||
- "make -k run_non_ui_tests"
|
- "ctest --output-on-failure"
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
# CMake setup
|
# CMake setup
|
||||||
cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
|
cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
|
||||||
|
enable_testing()
|
||||||
|
|
||||||
if(COMMAND cmake_policy)
|
if(COMMAND cmake_policy)
|
||||||
# CMP0003: Libraries linked via full path no longer produce linker search paths.
|
# CMP0003: Libraries linked via full path no longer produce linker search paths.
|
||||||
|
@ -178,6 +178,7 @@ function(find_tests dir dependencies)
|
|||||||
get_filename_component(testname ${testsourcefile} NAME_WE)
|
get_filename_component(testname ${testsourcefile} NAME_WE)
|
||||||
|
|
||||||
add_executable(${testname} ${testsourcefile})
|
add_executable(${testname} ${testsourcefile})
|
||||||
|
add_test(NAME ${testname} COMMAND ${testname})
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
# Fix problem compiling gen from a Visual Studio solution
|
# Fix problem compiling gen from a Visual Studio solution
|
||||||
@ -191,20 +192,7 @@ function(find_tests dir dependencies)
|
|||||||
set_target_properties(${testname}
|
set_target_properties(${testname}
|
||||||
PROPERTIES COMPILE_FLAGS ${extra_definitions})
|
PROPERTIES COMPILE_FLAGS ${extra_definitions})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_custom_target(run_${testname}
|
|
||||||
COMMAND ${testname}
|
|
||||||
DEPENDS ${testname})
|
|
||||||
|
|
||||||
set(local_runs ${local_runs} run_${testname})
|
|
||||||
|
|
||||||
string(REGEX MATCH "_ui_tests" test_requires_ui ${testname})
|
|
||||||
if (NOT test_requires_ui STREQUAL "_ui_tests")
|
|
||||||
set(local_non_ui_runs ${local_non_ui_runs} run_${testname})
|
|
||||||
endif()
|
|
||||||
endforeach()
|
endforeach()
|
||||||
set(all_runs ${all_runs} ${local_runs} PARENT_SCOPE)
|
|
||||||
set(non_ui_runs ${non_ui_runs} ${local_non_ui_runs} PARENT_SCOPE)
|
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
find_tests(base base-lib)
|
find_tests(base base-lib)
|
||||||
@ -217,7 +205,3 @@ find_tests(ui ui-lib)
|
|||||||
find_tests(app/file app-lib)
|
find_tests(app/file app-lib)
|
||||||
find_tests(app app-lib)
|
find_tests(app app-lib)
|
||||||
find_tests(. app-lib)
|
find_tests(. app-lib)
|
||||||
|
|
||||||
# To run tests
|
|
||||||
add_custom_target(run_all_tests DEPENDS ${all_runs})
|
|
||||||
add_custom_target(run_non_ui_tests DEPENDS ${non_ui_runs})
|
|
||||||
|
Loading…
Reference in New Issue
Block a user