Skip to content

Commit

Permalink
Added OSMANIP_TESTS option to the build system.
Browse files Browse the repository at this point in the history
  • Loading branch information
JustWhit3 committed Jul 26, 2023
1 parent 083cfad commit b0ba4e8
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ if( CMAKE_BUILD_TYPE STREQUAL "Debug" )
endif()

# Compiling unit tests
if( CMAKE_BUILD_TYPE STREQUAL "Debug" )
option( OSMANIP_TESTS "Enable / disable tests." ON )
if( CMAKE_BUILD_TYPE STREQUAL "Debug" AND OSMANIP_TESTS )
add_subdirectory( test/unit_tests )
else()
message( STATUS "Skipping tests." )
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,7 @@ sudo cmake --build build --target install
```

> :warning: remember to install the library before launching include tests, or an error will appear.
> :warning: if you want to build the library in debug mode, but without compiling tests use also the option `-DOSMANIP_TESTS=OFF`.
Tests are produced using `-Wall -Wextra -pedantic` flags. To check them you need some prerequisites:

Expand Down
2 changes: 1 addition & 1 deletion deps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ if( EXISTS "${LOC_PATH}" )
endif()

# Debug deps
if( CMAKE_BUILD_TYPE STREQUAL "Debug" )
if( CMAKE_BUILD_TYPE STREQUAL "Debug" AND OSMANIP_TESTS )
add_subdirectory( doctest )
endif()
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ services:
command: >
bash -c "cd /proj
&& rm -rf build
&& cmake -B build -DCMAKE_BUILD_TYPE=Debug
&& cmake -B build
&& cmake --build build"
# gcc 10
Expand Down

0 comments on commit b0ba4e8

Please sign in to comment.