[aseprite] 64/250: Use ctest to run tests
Tobias Hansen
thansen at moszumanska.debian.org
Sun Dec 20 15:27:12 UTC 2015
This is an automated email from the git hooks/post-receive script.
thansen pushed a commit to branch master
in repository aseprite.
commit 795c4d5a8792be746c1d77e8aa5fd0e344b10a9b
Author: David Capello <davidcapello at gmail.com>
Date: Mon Sep 21 16:45:25 2015 -0300
Use ctest to run tests
---
.travis.yml | 2 +-
CMakeLists.txt | 1 +
src/CMakeLists.txt | 18 +-----------------
3 files changed, 3 insertions(+), 18 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index d667252..759498a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -23,4 +23,4 @@ before_script:
script:
- "make"
- - "make -k run_non_ui_tests"
+ - "ctest --output-on-failure"
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 629f3dd..6173c2f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -5,6 +5,7 @@
# CMake setup
cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
+enable_testing()
if(COMMAND cmake_policy)
# CMP0003: Libraries linked via full path no longer produce linker search paths.
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index dd1d794..3cdce95 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -178,6 +178,7 @@ function(find_tests dir dependencies)
get_filename_component(testname ${testsourcefile} NAME_WE)
add_executable(${testname} ${testsourcefile})
+ add_test(NAME ${testname} COMMAND ${testname})
if(MSVC)
# Fix problem compiling gen from a Visual Studio solution
@@ -191,20 +192,7 @@ function(find_tests dir dependencies)
set_target_properties(${testname}
PROPERTIES COMPILE_FLAGS ${extra_definitions})
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()
- set(all_runs ${all_runs} ${local_runs} PARENT_SCOPE)
- set(non_ui_runs ${non_ui_runs} ${local_non_ui_runs} PARENT_SCOPE)
endfunction()
find_tests(base base-lib)
@@ -217,7 +205,3 @@ find_tests(ui ui-lib)
find_tests(app/file app-lib)
find_tests(app 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})
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/aseprite.git
More information about the Pkg-games-commits
mailing list