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_exercise.md
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,12 @@
1
1
# Boost.Test and CTest in Action: SideMade Exercise
2
2
3
-
In this exercise, you extend and automate the unit tests of the [SideMade code](https://github.com/Simulation-Software-Engineering/testing-boost-exercise-wt2223), on which we worked during the lecture.
3
+
In this exercise, you extend and automate the unit tests of the [SideMade code](https://github.com/Simulation-Software-Engineering/testing-boost-exercise-wt2425), on which we worked during the lecture.
4
4
5
-
Deadline: **Thursday, February 9th, 2023, 09:00**
5
+
Deadline: **Thursday, February 5, 2025, 09:00**
6
6
7
7
## Preparation and Submission
8
8
9
-
10
-
- Import the [testing boost exercise repository](https://github.com/Simulation-Software-Engineering/testing-boost-exercise-wt2223) in your own account/namespace on GitHub and name it `testing-boost-exercise` again. **Note**: We cannot work with forks here because GitHub Actions may not work in pull requests without explicit approval of the owner of the target repository
9
+
- Import the [testing boost exercise repository](https://github.com/Simulation-Software-Engineering/testing-boost-exercise-wt2425) in your own account/namespace on GitHub and name it `testing-boost-exercise` again. **Note**: We cannot work with forks here because GitHub Actions may not work in pull requests without explicit approval of the owner of the target repository
11
10
- Create a new branch `extend-tests` from `main` and work in this branch.
12
11
- To submit, open a PR from `extend-tests` to `main` in your own repository. Then paste a link to this PR in a new issue in the original repository. Use `[GITLAB-USERNAME] Boost test exercise` as title of the issue.
13
12
@@ -25,12 +24,13 @@ Deadline: **Thursday, February 9th, 2023, 09:00**
25
24
- Test: Check whether all tests run successfully.
26
25
- Add a corresponding [GitHub workflow status badge](https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/adding-a-workflow-status-badge) to the `README.md`.
27
26
28
-
## Optional Task
27
+
## Optional Tasks
29
28
30
29
- Extend the automation with a [build matrix](https://docs.github.com/en/actions/using-jobs/using-a-build-matrix-for-your-jobs). Test whether your code builds in Debug and in Release mode, and with the gcc and the clang compiler. Make use of CMake variables to modify these parameters.
30
+
- Implement more tests.
31
31
32
32
## Hints and Remarks
33
33
34
34
- When importing a project on GitHub, it could be that by default actions are disabled. You can enable them via `Settings -> Actions -> General -> Allow all actions`.
35
35
- Be careful: the style job should not format the code, but rather report whether the code was formatted correctly or not. There are different ways how to do this. You could use the option `--dry-run`, but then you still need to interpret warnings as errors with `-Werror`. Or you could format inplace (`-i`) and use `git diff`.
36
-
- Try to use the build from the build job for the tests in the test job by uploading and downloading the build as an artifact. Problem is that this way file permissions are not preserved. You can work around this problem, by archiving. See [the official workaround](https://github.com/actions/upload-artifact#maintaining-file-permissions-and-case-sensitive-files).
36
+
- Try to use the build from the build job for the tests in the test job by uploading and downloading the build as an artifact. Previously, there was an issue with file permissions, where archiving was [a known workaround](https://github.com/actions/upload-artifact/tree/v3.2.1?tab=readme-ov-file#maintaining-file-permissions-and-case-sensitive-files). This should no longer be a problem.
Copy file name to clipboardExpand all lines: 05_testing_and_ci/boost_testing_precice_demo.md
+11-7Lines changed: 11 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,22 @@ 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`)
52
+
53
+
## CTest in Parallel
54
+
55
+
- Build preCICE and run tests via `ctest -j 16`, runs tests in parallel, automatic feature of CTest
Copy file name to clipboardExpand all lines: timetable.md
+1-2Lines changed: 1 addition & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -132,8 +132,7 @@
132
132
133
133
## 13.2 – Wed, January 29, 2025
134
134
135
-
-**15** min.: Lecture evaluation
136
-
-**75** min.: [Boost.Test and CTest in Action: SideMade Exercise](https://github.com/Simulation-Software-Engineering/Lecture-Material/blob/main/05_testing_and_ci/boost_testing_exercise.md)
135
+
-**90** min.: [Boost.Test and CTest in Action: SideMade Exercise](https://github.com/Simulation-Software-Engineering/Lecture-Material/blob/main/05_testing_and_ci/boost_testing_exercise.md)
0 commit comments