Skip to content

Commit

Permalink
configure tests as optional in CMake and adjust GitHub Actions workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
farukeryilmaz committed Jan 8, 2024
1 parent 77ceb31 commit 88bc5cb
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/platform_gnu_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
with:
submodules: 'true'
- name: Configure
run: cmake -S . -B build
run: cmake -S . -B build -DBYTEPACK_BUILD_TESTS=ON
- name: Build
run: cmake --build build
- name: Run tests
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/platform_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
with:
submodules: 'true'
- name: Configure
run: cmake -S . -B build
run: cmake -S . -B build -DBYTEPACK_BUILD_TESTS=ON
- name: Build
run: cmake --build build
- name: Run tests
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/platform_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
with:
submodules: 'true'
- name: Configure
run: cmake -S . -B build -DCMAKE_CXX_STANDARD=20
run: cmake -S . -B build -DCMAKE_CXX_STANDARD=20 -DBYTEPACK_BUILD_TESTS=ON
- name: Build
run: cmake --build build --config Release
- name: Run tests
Expand Down
12 changes: 8 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ endif()
add_library(bytepack INTERFACE)
target_include_directories(bytepack INTERFACE ${PROJECT_SOURCE_DIR}/include)

add_subdirectory(extern/Catch2)

enable_testing()
add_subdirectory(test)
# Option for building tests
option(BYTEPACK_BUILD_TESTS "Build the BytePack tests" OFF)
if(BYTEPACK_BUILD_TESTS)
message("Build the BytePack tests")
add_subdirectory(extern/Catch2)
enable_testing()
add_subdirectory(test)
endif()

0 comments on commit 88bc5cb

Please sign in to comment.