Skip to content
Snippets Groups Projects
Commit 2fc71b2b authored by Lars Bilke's avatar Lars Bilke Committed by Dmitri Naumov
Browse files

[web] Docs for build and test presets.

parent 0850a616
No related branches found
No related tags found
No related merge requests found
......@@ -24,7 +24,7 @@ To separate source code from generated files such as compiled libraries, executa
For configuring a build the open source tool [CMake](http://www.cmake.org) is used. `CMakeLists.txt` files replace traditional Makefiles or IDE project files.
We provide CMake configuration presets defined in [CMakePresets.json](https://gitlab.opengeosys.org/ogs/ogs/-/blob/master/CMakePresets.json) for simple build configuration (**Note:** Requires CMake $\geq$ 3.19! Otherwise see [Configure manually](#option-configure-manually)). See the following table for commonly used presets:
We provide CMake configuration presets defined in [CMakePresets.json](https://gitlab.opengeosys.org/ogs/ogs/-/blob/master/CMakePresets.json) for simple build configuration (**Note:** Requires CMake $\geq$ 3.20! Otherwise see [Configure manually](#option-configure-manually)). See the following table for commonly used presets:
### Available CMake presets
......@@ -45,7 +45,7 @@ In the source directory run `cmake`:
```bash
# Usage: cmake -S [path-to-source] --preset=[preset-name]
cmake -S . --preset=release
cmake -S . --preset release
```
This will create a build-directory outside the source tree (`../build/release`) with the default CMake options and the Release configuration.
......
......@@ -49,6 +49,15 @@ Therefore, we recommend restricting the number of parallel compilations to be us
Another option is to build just the process you are interested in by configuring with the CMake option `OGS_BUILD_PROCESSES`, e.g.: `cmake -DOGS_BUILD_PROCESSES=HT ....`. In this case you should be able to compile with full parallelization.
<h3>Build with CMake presets</h3>
Similar to the configure presets there are build presets, e.g. in your source-directory:
```bash
cmake --build --preset release # equivalent to running ninja above
cmake --build --preset release -j 2 -t ogs # build the ogs-target with 2 threads
```
</div>
</div>
......
......@@ -26,10 +26,31 @@ AddTest(
)
```
Tests are then run with `make ctest` or for more verbose output with `ctest -VV` (you may also use other [ctest options](https://cmake.org/cmake/help/v3.4/manual/ctest.1.html)). If the checker has some errors they are displayed. `RUNTIME` specifies the typical runtime in seconds on an Intel Xeon E5-2680 v2 @ 2.80 GHz with 500 GiB RAM (`envinf1`). Tests with a `RUNTIME > {{< dataFile "versions.ctest.large_runtime" >}}` are considered `LARGE`-tests.
Tests are then run with `ninja ctest` or for more verbose output with `ctest -VV` (you may also use other [ctest options](https://cmake.org/cmake/help/v3.4/manual/ctest.1.html)). If the checker has some errors they are displayed. `RUNTIME` specifies the typical runtime in seconds on an Intel Xeon E5-2680 v2 @ 2.80 GHz with 500 GiB RAM (`envinf1`). Tests with a `RUNTIME > {{< dataFile "versions.ctest.large_runtime" >}}` are considered `LARGE`-tests.
The functionality is very flexible and more wrappers and checker can be added later on. e.g. for running some statistics on output files and comparing them with statistics from reference files.
<div class="note">
<h3>Run tests with CMake presets</h3>
Similar to the configure and build presets there are test presets, e.g. in your source-directory:
```bash
ctest --preset release # equivalent to running `ninja ctest` above
ctest --preset release -j 6 --label-regex Utils # run 6 tests in parallel which have a Utils label
```
**To sum up:** from a clean source directory you can fully configure, build and test ogs with these 3 commands:
```bash
cmake -S . --preset release
cmake --build --preset release
ctest --preset release
```
</div>
## Test Data
Test data is stored in `Tests/Data`. Generated test output files should be found in `[build-dir]/Tests/Data`.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment