Skip to content

Commit

Permalink
Catch2 tests moved under the flag BUILD_TESTING and are OFF be default
Browse files Browse the repository at this point in the history
  • Loading branch information
nosmokingsurfer committed Dec 3, 2022
1 parent 0a9a285 commit 72e89b0
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 37 deletions.
1 change: 1 addition & 0 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
cmake -S $PWD -B $PWD/build \
-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=$PWD/bin \
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=$PWD/lib \
-DBUILD_TESTING=TRUE \
&& cmake --build build -j $(nproc)
- name: C++ unit tests
Expand Down
13 changes: 9 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,19 @@ ELSEIF(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
ELSE()
ENDIF(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")

# BUILD_TESTING option handling. By default tests are turned off but the value is cached and can be changed in Cmake-GUI
set(BUILD_TESTING false CACHE BOOL "Build unit tests for MROB modules")

MESSAGE(STATUS "Build Tests: ${BUILD_TESTING}")

IF(ANDROID)
SET(BUILD_TESTING OFF)
SET(BUILD_TESTING false)
ELSE(ANDROID)
SET(BUILD_TESTING ON)
enable_testing()
IF(BUILD_TESTING)
enable_testing()
ENDIF(BUILD_TESTING)
ENDIF(ANDROID)

MESSAGE(STATUS "Build Tests: ${BUILD_TESTING}")

# ===================================================================
INCLUDE_DIRECTORIES(SYSTEM ./external/Eigen)
Expand Down
27 changes: 5 additions & 22 deletions src/geometry/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# locate the additional necessary dependencies, if any


# extra source files
SET(sources
SO3.cpp
Expand All @@ -16,25 +15,9 @@ SET(headers
)

# create the shared library
ADD_LIBRARY(SE3 SHARED ${sources})
#TARGET_LINK_LIBRARIES( .. )
#target_link_libraries(${PROJECT_NAME} ${position_3d_LIBRARY})


#install
#INSTALL(TARGETS people_prediction
# RUNTIME DESTINATION bin
# LIBRARY DESTINATION lib/SE3
# ARCHIVE DESTINATION lib/SE3)

#INSTALL(FILES ${headers} DESTINATION include/iridrivers/people_prediction)
#INSTALL(FILES ${headers_random} DESTINATION include/iridrivers/people_prediction/random)
#INSTALL(FILES ${headers_scene_elements} DESTINATION include/iridrivers/people_prediction/scene_elements)
#INSTALL(FILES ${headers_nav} DESTINATION include/iridrivers/people_prediction/nav)


#INSTALL(FILES ../Findpeople_prediction.cmake DESTINATION ${CMAKE_ROOT}/Modules/)

ADD_LIBRARY(SE3 SHARED ${sources})

ADD_SUBDIRECTORY(examples)
#ADD_SUBDIRECTORY(test)
# build tests if enabled
IF(BUILD_TESTING)
ADD_SUBDIRECTORY(tests)
ENDIF(BUILD_TESTING)
11 changes: 0 additions & 11 deletions src/geometry/examples/CMakeLists.txt

This file was deleted.

9 changes: 9 additions & 0 deletions src/geometry/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/external/Catch2/single_include/)

ADD_EXECUTABLE(test_SE3 test_SE3.cpp)
TARGET_LINK_LIBRARIES(test_SE3 SE3)
ADD_TEST(NAME test_SE3 COMMAND $<TARGET_FILE:test_SE3>)

ADD_EXECUTABLE(test_SE3cov test_SE3cov.cpp)
TARGET_LINK_LIBRARIES(test_SE3cov SE3)
ADD_TEST(NAME test_SE3cov COMMAND $<TARGET_FILE:test_SE3cov>)
File renamed without changes.
File renamed without changes.

0 comments on commit 72e89b0

Please sign in to comment.