Skip to content

Commit 36034a0

Browse files
committed
Rename test executable and restructure Build section in README
1 parent 7f12da5 commit 36034a0

File tree

3 files changed

+52
-27
lines changed

3 files changed

+52
-27
lines changed

.github/workflows/main.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ jobs:
2121
- name: Run CMake
2222
run: cmake --preset conan-debug -DUSE_COVERAGE=ON .
2323
- name: Compile
24-
run: cmake --build build/Debug --target testScipPP
24+
run: cmake --build build/Debug --target tests
2525
- name: Run Tests
26-
run: ./build/Debug/test/testScipPP --log_format=JUNIT --log_level=all --log_sink=boosttest.xml
26+
run: ./build/Debug/test/tests --log_format=JUNIT --log_level=all --log_sink=boosttest.xml
2727
- name: Install GCovr
2828
run: pip install gcovr
2929
- name: Extract Coverage
@@ -47,9 +47,9 @@ jobs:
4747
- name: Run CMake
4848
run: cmake --preset conan-default .
4949
- name: Compile
50-
run: cmake --build build --preset conan-release --target testScipPP
50+
run: cmake --build build --preset conan-release --target tests
5151
- name: Run Tests
52-
run: ./build/test/Release/testScipPP.exe
52+
run: ./build/test/Release/tests.exe
5353
test_without_conan:
5454
runs-on: ubuntu-latest
5555
steps:
@@ -67,9 +67,9 @@ jobs:
6767
- name: Build SCIP++
6868
run: |
6969
CMAKE_PREFIX_PATH=./lib/cmake/scip:./boost/boost/lib/cmake/Boost-1.81.0 cmake -DBUILD_TESTS=ON .
70-
make -j testScipPP
70+
make -j tests
7171
- name: Run tests
72-
run: ./test/testScipPP
72+
run: ./test/tests
7373
test_release_inx:
7474
strategy:
7575
matrix:
@@ -85,9 +85,9 @@ jobs:
8585
- name: Run CMake
8686
run: cmake --preset conan-release .
8787
- name: Compile
88-
run: cmake --build build/Release --target testScipPP
88+
run: cmake --build build/Release --target tests
8989
- name: Run Tests
90-
run: ./build/Release/test/testScipPP
90+
run: ./build/Release/test/tests
9191
clang_tidy:
9292
runs-on: ubuntu-latest
9393
steps:

readme.md

Lines changed: 41 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -132,22 +132,47 @@ SCIP* scip = model.scip();
132132

133133
## Build
134134

135+
### Without Conan
136+
135137
We use [Conan](https://conan.io/center/) as package manager.
136138
That is not required! As long as `find_package(scip CONFIG REQUIRED)` (and `find_package(Boost CONFIG REQUIRED)` for
137139
the tests) work(s), any kind of dependency management system can be used.
138140

139-
### Build & Install
141+
Build and install:
142+
143+
```bash
144+
cmake .
145+
make ScipPP
146+
make install
147+
```
148+
149+
Build and run tests:
150+
151+
```bash
152+
cmake -DBUILD_TESTS=ON .
153+
make tests
154+
./test/tests
155+
```
156+
157+
### With Conan v2 and CMake v3.19 or later
140158

141-
Assuming you are using Conan v2 and a CMake version that supports presets (v3.19 and above), run:
159+
Build and install:
142160

143161
```bash
144-
conan install -of . .
162+
conan install .
145163
cmake --preset conan-release .
146164
cmake --build build/Release --target ScipPP
147165
cmake --install build/Release
148166
```
149167

150-
### If pre-compiled dependencies are not available
168+
Build and run tests:
169+
170+
```bash
171+
conan install -o with_tests=True .
172+
cmake --preset conan-release .
173+
cmake --build build/Release --target tests
174+
build/Release/test/tests
175+
```
151176

152177
If your setting of OS, compiler, C++ or stdlib version is one where conan-center does not host pre-compiled binaries,
153178
add `--build=missing` when you run `conan install`. The dependencies will then be built from source (don't worry, they
@@ -163,31 +188,31 @@ or try to build locally from sources using the '--build=missing' argument
163188
change the install-command to
164189

165190
```bash
166-
conan install -of . --build=missing .
191+
conan install --build=missing .
167192
```
168193

169-
### If you are using a CMake version without support for presets
194+
### With Conan v2 and CMake v3.18 or earlier
195+
196+
When CMake presets are not support, use the toolchain file that conan generates.
197+
198+
Build and install:
170199

171200
```bash
172-
conan install -of . .
201+
conan install .
173202
cmake . -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=./build/Release/generators/conan_toolchain.cmake -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_BUILD_TYPE=Release
174203
make ScipPP
175204
make install
176205
```
177206

178-
### Test
179-
180-
Using Conan, the option `with_tests` has to be set to true.
207+
Build and run tests:
181208

182209
```bash
183-
conan install -of . -o with_tests=True .
184-
cmake --preset conan-release .
185-
cmake --build build/Release --target testScipPP
186-
./build/Release/test/testScipPP
210+
conan install -o with_tests=True .
211+
cmake . -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=./build/Release/generators/conan_toolchain.cmake -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_BUILD_TYPE=Release
212+
make tests
213+
./build/Release/test/tests
187214
```
188215

189-
When using purely CMake, add `-DBUILD_TESTS=ON`.
190-
191216
## Utils
192217

193218
Use `gen_constexpr_parameters` to transform all SCIP parameters into constexpr `scippp::params::Param<T>` objects which

test/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ if (NOT TARGET Boost::unit_test_framework)
66
endif ()
77

88
file(GLOB TEST_SOURCES *.cpp)
9-
add_executable(testScipPP ${TEST_SOURCES})
10-
target_include_directories(testScipPP SYSTEM PRIVATE ${Boost_INCLUDE_DIRS})
11-
target_link_libraries(testScipPP PRIVATE ScipPP Boost::unit_test_framework)
9+
add_executable(tests ${TEST_SOURCES})
10+
target_include_directories(tests SYSTEM PRIVATE ${Boost_INCLUDE_DIRS})
11+
target_link_libraries(tests PRIVATE ScipPP Boost::unit_test_framework)

0 commit comments

Comments
 (0)