-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
183 changed files
with
133 additions
and
141,133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
# Find the GTest headers and sources. | ||
# | ||
# Sets the following variables: | ||
# | ||
# * GTestSources_FOUND - system has GTest sources | ||
# * GTestSources_SOURCE_DIR - GTest source dir (with CMakeLists.txt) | ||
# * GTestSources_INCLUDE_DIR - GTest include directory (public headers) | ||
# * GTestSources_VERSION - GTest version (if supported) | ||
# | ||
# You can set the GTEST_ROOT environment variable to be used as a | ||
# hint by FindGTestSources to locate googletest source directory. | ||
# | ||
# Tested with the Ubuntu package `libgtest-dev` and the googletest | ||
# repository hosted on GitHub and cloned to the local machine. | ||
# | ||
# Supported versions: v1.6, v1.7, v1.8. | ||
# | ||
# Also, this module adds the following macros: | ||
# | ||
# * gtest_add_tests (as in FindGTest.cmake) | ||
|
||
find_package(GTest QUIET) | ||
|
||
if(NOT GTestSources_SOURCE_DIR) | ||
find_path(GTestSources_SOURCE_DIR src/gtest.cc | ||
HINTS $ENV{GTEST_ROOT} | ||
${GTEST_ROOT} | ||
PATHS /usr/src/gtest | ||
/usr/src/googletest | ||
PATH_SUFFIXES googletest) | ||
endif() | ||
|
||
if(NOT GTestSources_INCLUDE_DIR) | ||
# Look for local headers *before* /usr/include (hence the NO_X_PATH params) | ||
find_path(GTestSources_INCLUDE_DIR gtest/gtest.h | ||
HINTS ${GTestSources_SOURCE_DIR} | ||
$ENV{GTEST_ROOT} | ||
${GTEST_ROOT} | ||
PATH_SUFFIXES include | ||
NO_CMAKE_PATH | ||
NO_CMAKE_ENVIRONMENT_PATH) | ||
endif() | ||
|
||
set(_cmake_include_dirs ${CMAKE_REQUIRED_INCLUDES}) | ||
|
||
include(CheckCXXSourceCompiles) | ||
list(APPEND CMAKE_REQUIRED_INCLUDES ${GTestSources_INCLUDE_DIR}) | ||
|
||
check_cxx_source_compiles(" | ||
#include <gtest/gtest.h> | ||
int main() { | ||
typedef const char* (testing::TestInfo::*fun)() const; | ||
fun f = &testing::TestInfo::type_param; | ||
return 0; | ||
}" | ||
_gtest_compatible_1_6_0) | ||
|
||
check_cxx_source_compiles(" | ||
#include <gtest/gtest.h> | ||
int main() { | ||
typedef bool (testing::TestInfo::*fun)() const; | ||
fun f = &testing::TestInfo::is_reportable; | ||
return 0; | ||
}" | ||
_gtest_compatible_1_7_0) | ||
|
||
check_cxx_source_compiles(" | ||
#include <gtest/gtest.h> | ||
int main() { | ||
typedef const char* (testing::TestInfo::*fun)() const; | ||
fun f = &testing::TestInfo::file; | ||
return 0; | ||
}" | ||
_gtest_compatible_1_8_0) | ||
|
||
if(_gtest_compatible_1_8_0) | ||
set(GTestSources_VERSION 1.8.0) | ||
elseif(_gtest_compatible_1_7_0) | ||
set(GTestSources_VERSION 1.7.0) | ||
elseif(_gtest_compatible_1_6_0) | ||
set(GTestSources_VERSION 1.6.0) | ||
else() | ||
message(STATUS "FindGTestSources.cmake reports unhandled GTest version (<1.6.0)") | ||
set(GTestSources_VERSION GTestSources_VERSION-NOT_FOUND) | ||
endif() | ||
|
||
set(CMAKE_REQUIRED_INCLUDES "${_cmake_include_dirs}") | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(GTestSources REQUIRED_VARS GTestSources_SOURCE_DIR | ||
GTestSources_INCLUDE_DIR | ||
VERSION_VAR GTestSources_VERSION) | ||
|
||
mark_as_advanced(GTestSources_SOURCE_DIR | ||
GTestSources_INCLUDE_DIR) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,50 @@ | ||
option(ENABLE_tests "Choose if you want to compile tests" ON) | ||
find_package(GTestSources 1.6.0 QUIET) | ||
|
||
if(NOT GTestSources_FOUND AND (NOT DEFINED ENABLE_tests OR ENABLE_tests)) | ||
message(WARNING "GTestSources package not found, disabling tests") | ||
endif() | ||
|
||
cmake_dependent_option(ENABLE_tests "Enable/disable unit tests" ON | ||
GTestSources_FOUND OFF) | ||
|
||
if(ENABLE_tests) | ||
|
||
add_subdirectory(gtest-1.7.0) | ||
enable_testing() | ||
find_package(YARP REQUIRED) | ||
|
||
add_subdirectory(${GTestSources_SOURCE_DIR} ${CMAKE_BINARY_DIR}/gtest) | ||
|
||
get_property(_common_includes GLOBAL PROPERTY ROBOTICSLAB_KINEMATICS_DYNAMICS_INCLUDE_DIRS) | ||
|
||
find_package(YARP REQUIRED) | ||
include_directories(${GTestSources_INCLUDE_DIR} | ||
${YARP_INCLUDE_DIRS} | ||
${_common_includes}) | ||
|
||
get_property(_common_includes GLOBAL PROPERTY ROBOTICSLAB_KINEMATICS_DYNAMICS_INCLUDE_DIRS) | ||
add_executable(testKinRepresentation testKinRepresentation.cpp) | ||
add_dependencies(testKinRepresentation COLOR_DEBUG) | ||
target_link_libraries(testKinRepresentation gtest_main KinematicRepresentationLib) | ||
|
||
include_directories(${gtest_SOURCE_DIR}/include | ||
${gtest_SOURCE_DIR} | ||
${YARP_INCLUDE_DIRS} | ||
${_common_includes}) | ||
add_executable(testKdlSolver testKdlSolver.cpp) | ||
add_dependencies(testKdlSolver COLOR_DEBUG) | ||
target_link_libraries(testKdlSolver YARP::YARP_OS YARP::YARP_dev gtest_main) | ||
|
||
add_executable(testKinRepresentation testKinRepresentation.cpp) | ||
add_dependencies(testKinRepresentation COLOR_DEBUG) | ||
target_link_libraries(testKinRepresentation gtest_main KinematicRepresentationLib) | ||
add_executable(testKdlSolverFromFile testKdlSolverFromFile.cpp) | ||
add_dependencies(testKdlSolverFromFile COLOR_DEBUG) | ||
target_link_libraries(testKdlSolverFromFile YARP::YARP_OS YARP::YARP_dev gtest_main) | ||
|
||
add_executable(testKdlSolver testKdlSolver.cpp) | ||
add_dependencies(testKdlSolver COLOR_DEBUG) | ||
target_link_libraries(testKdlSolver YARP::YARP_OS YARP::YARP_dev gtest_main) | ||
add_executable(testAsibotSolverFromFile testAsibotSolverFromFile.cpp) | ||
add_dependencies(testAsibotSolverFromFile COLOR_DEBUG) | ||
target_link_libraries(testAsibotSolverFromFile YARP::YARP_OS YARP::YARP_dev gtest_main KinematicRepresentationLib) | ||
|
||
add_executable(testKdlSolverFromFile testKdlSolverFromFile.cpp) | ||
add_dependencies(testKdlSolverFromFile COLOR_DEBUG) | ||
target_link_libraries(testKdlSolverFromFile YARP::YARP_OS YARP::YARP_dev gtest_main) | ||
add_executable(testKdlTrajectory testKdlTrajectory.cpp) | ||
add_dependencies(testKdlTrajectory COLOR_DEBUG) | ||
target_link_libraries(testKdlTrajectory YARP::YARP_OS YARP::YARP_dev gtest_main TrajectoryLib) | ||
|
||
add_executable(testAsibotSolverFromFile testAsibotSolverFromFile.cpp) | ||
add_dependencies(testAsibotSolverFromFile COLOR_DEBUG) | ||
target_link_libraries(testAsibotSolverFromFile YARP::YARP_OS YARP::YARP_dev gtest_main KinematicRepresentationLib) | ||
add_executable(testBasicCartesianControl testBasicCartesianControl.cpp) | ||
add_dependencies(testBasicCartesianControl COLOR_DEBUG) | ||
target_link_libraries(testBasicCartesianControl YARP::YARP_OS YARP::YARP_dev gtest_main) | ||
|
||
add_executable(testKdlTrajectory testKdlTrajectory.cpp) | ||
add_dependencies(testKdlTrajectory COLOR_DEBUG) | ||
target_link_libraries(testKdlTrajectory YARP::YARP_OS YARP::YARP_dev gtest_main TrajectoryLib) | ||
else() | ||
|
||
add_executable(testBasicCartesianControl testBasicCartesianControl.cpp) | ||
add_dependencies(testBasicCartesianControl COLOR_DEBUG) | ||
target_link_libraries(testBasicCartesianControl YARP::YARP_OS YARP::YARP_dev gtest_main) | ||
set(ENABLE_tests OFF CACHE BOOL "Enable/disable unit tests" FORCE) | ||
|
||
endif() |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.