You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 05_testing_and_ci/boost_testing_precice_demo.md
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -10,15 +10,15 @@ Look around preCICE in the terminal + text editor.
10
10
- Imports `testing/Testing.hpp`, there we handle UTF imports
11
11
- Test suite for `math` namespace and test suite per file (here `math/differences.hpp`)
12
12
-`BOOST_CHECK` actually not recommended to use. Is used internally by `BOOST_TEST`.
13
-
- Powerful macro `PRECICE_TEST(1_rank)`; here it means that this test is run on one MPI rank
14
-
- Tests are normally run on 4 MPI ranks to test parallel implementation and to mimic different coupled solvers
13
+
- Powerful macro `PRECICE_TEST()` to setup test context (resources, singletons, not data)
15
14
16
15
## Unit vs. Integration Tests
17
16
18
17
- Clear separation in preCICE: integration tests only directly use API of preCICE.
19
18
- They are located in `tests` folder.
20
-
- Look at `tests/serial/initialize-data/Explicit.cpp`
21
-
- Explain `PRECICE_TEST` and how it is used
19
+
- Look at `tests/serial/initialize-data/Explicit.cpp`:
20
+
- Explain `PRECICE_TEST_SETUP` and how it is used: test is run on two MPI ranks living in seperate MPI communicators.
21
+
- Information can be accessed via `context`.
22
22
- More information: [blog post on bssw.io on multiphysics testing](https://bssw.io/blog_posts/overcoming-complexity-in-testing-multiphysics-coupling-software)
23
23
24
24
## White-Box Testing
@@ -34,18 +34,18 @@ Look around preCICE in the terminal + text editor.
34
34
- Has public and private members. We want to check the private members in tests.
35
35
- Does not `friend` every test, but only `WaveformFixture`
36
36
-`src/testing/WaveformFixture.hpp` has functions to access private members
37
-
- This fixture is used in many tests in `src/time/tests/WaveformTests`
37
+
- This fixture is used in many tests in `src/time/tests/WaveformTests` (but not handed over to test like normal UTF fixtures)
38
38
39
39
## Test Matrices
40
40
41
41
- Look at `tests/serial/mapping-nearest-projection/QuadMappingDiagonalNearestProjectionEdgesTallKite.cpp`:
42
42
- Define test matrix with data sets: `boost::unit_test::data::make`
43
43
44
-
## Test Context
44
+
## Boost Test Context
45
45
46
46
- Look at `src/mapping/tests/NearestProjectionMappingTest.cpp`:
47
47
-`BOOST_TEST_CONTEXT` outputs context information on failure
48
48
49
49
## CMake
50
50
51
-
- Look at `cmake/CTestConfig.cmake`: More things tested than only UTF
51
+
- Look at `cmake/CTestConfig.cmake`: Complicated, but more things tested than only UTF (search for `add_test`)
0 commit comments