From 2fc71b2b88a74db91c50ba634d884ddf7d8e774b Mon Sep 17 00:00:00 2001
From: Lars Bilke <lars.bilke@ufz.de>
Date: Tue, 27 Apr 2021 16:11:26 +0200
Subject: [PATCH] [web] Docs for build and test presets.

---
 .../getting-started/build-configuration.md    |  4 ++--
 .../docs/devguide/getting-started/build.md    |  9 ++++++++
 .../docs/devguide/testing/test-data.md        | 23 ++++++++++++++++++-
 3 files changed, 33 insertions(+), 3 deletions(-)

diff --git a/web/content/docs/devguide/getting-started/build-configuration.md b/web/content/docs/devguide/getting-started/build-configuration.md
index 099a90acc1a..77d7230351f 100644
--- a/web/content/docs/devguide/getting-started/build-configuration.md
+++ b/web/content/docs/devguide/getting-started/build-configuration.md
@@ -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.
diff --git a/web/content/docs/devguide/getting-started/build.md b/web/content/docs/devguide/getting-started/build.md
index e5c10f4db5a..d0758b4d5c8 100644
--- a/web/content/docs/devguide/getting-started/build.md
+++ b/web/content/docs/devguide/getting-started/build.md
@@ -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>
diff --git a/web/content/docs/devguide/testing/test-data.md b/web/content/docs/devguide/testing/test-data.md
index 8aa29efe0f3..dc2729ff422 100644
--- a/web/content/docs/devguide/testing/test-data.md
+++ b/web/content/docs/devguide/testing/test-data.md
@@ -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`.
-- 
GitLab