Skip to content

Commit

Permalink
Do not compile test by default
Browse files Browse the repository at this point in the history
Signed-off-by: Raul Sanchez-Mateos <[email protected]>
  • Loading branch information
rsanchez15 committed Sep 28, 2023
1 parent 0c20499 commit 21c3f73
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ jobs:
colcon build --executor parallel --event-handlers console_direct+ desktop_notification- `
--metas ./src/fastdds_python/.github/workflows/test.meta `
--cmake-args -DCMAKE_C_COMPILER_LAUNCHER="${{ env.ccache_symlinks_path }}" `
-DCMAKE_CXX_COMPILER_LAUNCHER="${{ env.ccache_symlinks_path }}"
-DCMAKE_CXX_COMPILER_LAUNCHER="${{ env.ccache_symlinks_path }}" `
-DBUILD_TESTING=ON
- name: Run tests
shell: pwsh
Expand Down Expand Up @@ -140,8 +141,13 @@ jobs:

- name: Build workspace
run: >
colcon build --event-handlers=console_direct+ --metas ./src/fastdds_python/.github/workflows/test.meta \
--cmake-args -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
colcon build \
--event-handlers=console_direct+ \
--metas ./src/fastdds_python/.github/workflows/test.meta \
--cmake-args \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DBUILD_TESTING=ON
- name: Run tests
run: |
Expand Down
11 changes: 10 additions & 1 deletion fastdds_python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ endif()

project(fastdds_python VERSION 1.2.2)

# Set BUILD_TESTING to OFF by default.
if(NOT BUILD_TESTING)
message(STATUS "Tests not compiled by default")
set(BUILD_TESTING OFF CACHE BOOL "Enable testing" FORCE)
endif()

###############################################################################
# Dependencies
###############################################################################
Expand All @@ -50,4 +56,7 @@ add_subdirectory(src/swig)
###############################################################################
enable_testing()
include(CTest)
add_subdirectory(test)

if (BUILD_TESTING)
add_subdirectory(test)
endif()

0 comments on commit 21c3f73

Please sign in to comment.