Skip to content

Commit 5b9c410

Browse files
committed
build tests option
1 parent ff24673 commit 5b9c410

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

.gitlab-ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ build:
88
tags:
99
- Ubuntu2004-64bit
1010
script:
11-
- cmake -DCODE_COVERAGE=ON .
11+
- cmake -DCODE_COVERAGE=ON -DBUILD_TESTS=ON.
1212
- make
1313
- ctest --output-on-failure
1414
- make maxpluslibcoverage

CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.14.0 FATAL_ERROR)
22
project(MaxPLusLib)
33

44
option(CODE_COVERAGE "Compile for code coverage (default OFF)." OFF)
5+
option(BUILD_TESTS "Build tests" OFF)
56

67
set(CPM_USE_LOCAL_PACKAGES ON)
78
include(config/get_cpm.cmake)

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ This creates a static library that can be used with the provided include files.
2222
Use the following to run the tests and coverage results.
2323

2424
``` bash
25-
cmake -DCODE_COVERAGE=ON .
25+
cmake -DCODE_COVERAGE=ON -DBUILD_TESTS=ON.
2626
ctest
2727
make maxpluslibcoverage
2828
```

src/CMakeLists.txt

+5-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ add_subdirectory(algebra)
55
add_subdirectory(base)
66
add_subdirectory(game)
77
add_subdirectory(graph)
8-
add_subdirectory(testbench)
8+
9+
if (BUILD_TESTS)
10+
add_subdirectory(testbench)
11+
endif (BUILD_TESTS)
12+
913

1014
set(MAXPLUSLIB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../include)
1115
target_include_directories(maxplus PUBLIC

0 commit comments

Comments
 (0)