summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Valavanis <valavanisalex@gmail.com>2016-06-09 09:04:46 +0000
committerAlexander Valavanis <valavanisalex@gmail.com>2016-06-09 09:04:46 +0000
commitf931da0fd590275ed17fe3c53842fe5c541b87c0 (patch)
tree132337fd009abe18ab38a866cf409919d2255cf0
parent[Bug #1574561] Italian translation updates for 0.92.x. (diff)
parentFix testing dependencies (diff)
downloadinkscape-f931da0fd590275ed17fe3c53842fe5c541b87c0.tar.gz
inkscape-f931da0fd590275ed17fe3c53842fe5c541b87c0.zip
Fix make test target
(bzr r14968)
-rw-r--r--CMakeLists.txt35
-rw-r--r--CMakeScripts/DefineDependsandFlags.cmake8
-rw-r--r--testfiles/CMakeLists.txt (renamed from test/CMakeLists.txt)5
-rw-r--r--testfiles/doc-per-case-test.cpp (renamed from test/doc-per-case-test.cpp)0
-rw-r--r--testfiles/doc-per-case-test.h (renamed from test/doc-per-case-test.h)0
-rw-r--r--testfiles/src/attributes-test.cpp (renamed from test/src/attributes-test.cpp)0
-rw-r--r--testfiles/src/color-profile-test.cpp (renamed from test/src/color-profile-test.cpp)0
-rw-r--r--testfiles/src/dir-util-test.cpp (renamed from test/src/dir-util-test.cpp)0
-rw-r--r--testfiles/unittest.cpp (renamed from test/unittest.cpp)0
9 files changed, 18 insertions, 30 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 91a090371..9d7b15dfe 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -70,18 +70,6 @@ set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin CACHE INTERNAL "" )
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib CACHE INTERNAL "" )
# -----------------------------------------------------------------------------
-# Test Harness
-# -----------------------------------------------------------------------------
-set(GMOCK_DIR "${CMAKE_SOURCE_DIR}/gtest/gmock-1.7.0"
- CACHE PATH "The path to the GoogleMock test framework.")
-
-if(EXISTS "${GMOCK_DIR}" AND IS_DIRECTORY "${GMOCK_DIR}")
- set(GMOCK_PRESENT ON)
-else()
- message("No gmock/gtest found! Perhaps you wish to run 'bash download-gtest.sh' to download it.")
-endif()
-
-# -----------------------------------------------------------------------------
# Options
# -----------------------------------------------------------------------------
option(WITH_DBUS "Compile with support for DBus interface" OFF)
@@ -90,7 +78,6 @@ option(WITH_GNOME_VFS "Compile with support for Gnome VFS" ON)
option(WITH_SVG2 "Compile with support for new SVG2 features" ON)
option(WITH_LPETOOL "Compile with LPE Tool and experimental LPEs enabled" ON)
#option(WITH_INKJAR "Enable support for openoffice files (SVG jars)" ON)
-option(WITH_GTEST "Compile with Google Test support" ${GMOCK_PRESENT})
option(WITH_OPENMP "Compile with OpenMP support" ON)
option(WITH_PROFILING "Turn on profiling" OFF) # Set to true if compiler/linker should enable profiling
@@ -104,6 +91,19 @@ option(WITH_LIBWPG "Compile with support of libwpg for WordPerfect Graphics" ON)
option(WITH_NLS "Compile with Native Language Support (using gettext)" ON)
option(WITH_GTK3_EXPERIMENTAL "Enable compilation with GTK+3 (EXPERIMENTAL!)" OFF)
+# -----------------------------------------------------------------------------
+# Test Harness
+# -----------------------------------------------------------------------------
+set(GMOCK_DIR "${CMAKE_SOURCE_DIR}/gtest/gmock-1.7.0"
+ CACHE PATH "The path to the GoogleMock test framework.")
+
+if(EXISTS "${GMOCK_DIR}" AND IS_DIRECTORY "${GMOCK_DIR}")
+ set(GMOCK_PRESENT ON)
+else()
+ set(GMOCK_PRESENT OFF)
+ message("No gmock/gtest found! Perhaps you wish to run 'bash download-gtest.sh' to download it.")
+endif()
+
include(CMakeScripts/ConfigPaths.cmake) # Installation Paths
include(CMakeScripts/DefineDependsandFlags.cmake) # Includes, Compiler Flags, and Link Libraries
include(CMakeScripts/HelperMacros.cmake) # Misc Utility Macros
@@ -210,12 +210,11 @@ add_custom_target(clean-all
)
#-----------------------------------------------------------------------------
-
-add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND})
-
-if(WITH_GTEST)
+if(GMOCK_PRESENT)
+ set(CMAKE_CTEST_COMMAND ctest -V)
enable_testing()
- add_subdirectory(test EXCLUDE_FROM_ALL)
+ add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND})
+ add_subdirectory(testfiles)
endif()
# Canonicalize the flags to speed up recompilation using ccache/etc.
diff --git a/CMakeScripts/DefineDependsandFlags.cmake b/CMakeScripts/DefineDependsandFlags.cmake
index 0f4ba46c6..706860a00 100644
--- a/CMakeScripts/DefineDependsandFlags.cmake
+++ b/CMakeScripts/DefineDependsandFlags.cmake
@@ -274,14 +274,6 @@ else()
add_definitions(-UWITH_LPETOOL -ULPE_ENABLE_TEST_EFFECTS)
endif()
-if(WITH_GTEST)
- if(EXISTS "${GMOCK_DIR}" AND IS_DIRECTORY "${GMOCK_DIR}")
-
- else()
- set(WITH_GTEST off)
- endif()
-endif()
-
# ----------------------------------------------------------------------------
# CMake's builtin
# ----------------------------------------------------------------------------
diff --git a/test/CMakeLists.txt b/testfiles/CMakeLists.txt
index 8da39d627..ad022d21e 100644
--- a/test/CMakeLists.txt
+++ b/testfiles/CMakeLists.txt
@@ -1,9 +1,6 @@
# -----------------------------------------------------------------------------
#
# -----------------------------------------------------------------------------
-
-set(CMAKE_CTEST_COMMAND ctest -V)
-
add_subdirectory(${GMOCK_DIR} ${CMAKE_BINARY_DIR}/gmock)
include_directories(SYSTEM ${GMOCK_DIR}/gtest/include
@@ -60,8 +57,8 @@ target_link_libraries(unittest
${INKSCAPE_LIBS}
)
-add_test(BaseTest ${EXECUTABLE_OUTPUT_PATH}/unittest)
+add_test(BaseTest ${EXECUTABLE_OUTPUT_PATH}/unittest)
add_dependencies(check unittest)
#
diff --git a/test/doc-per-case-test.cpp b/testfiles/doc-per-case-test.cpp
index da75b1e65..da75b1e65 100644
--- a/test/doc-per-case-test.cpp
+++ b/testfiles/doc-per-case-test.cpp
diff --git a/test/doc-per-case-test.h b/testfiles/doc-per-case-test.h
index b6f01403a..b6f01403a 100644
--- a/test/doc-per-case-test.h
+++ b/testfiles/doc-per-case-test.h
diff --git a/test/src/attributes-test.cpp b/testfiles/src/attributes-test.cpp
index 41c0274ec..41c0274ec 100644
--- a/test/src/attributes-test.cpp
+++ b/testfiles/src/attributes-test.cpp
diff --git a/test/src/color-profile-test.cpp b/testfiles/src/color-profile-test.cpp
index 365be687a..365be687a 100644
--- a/test/src/color-profile-test.cpp
+++ b/testfiles/src/color-profile-test.cpp
diff --git a/test/src/dir-util-test.cpp b/testfiles/src/dir-util-test.cpp
index 32b3fce74..32b3fce74 100644
--- a/test/src/dir-util-test.cpp
+++ b/testfiles/src/dir-util-test.cpp
diff --git a/test/unittest.cpp b/testfiles/unittest.cpp
index 0ec8f0383..0ec8f0383 100644
--- a/test/unittest.cpp
+++ b/testfiles/unittest.cpp