|
|
To obtain the detailed code coverage report, you can either
|
|
|
- login to gitlab, select the latest CI pipeline, select the `coverage` job (run it, if not yet done), click on "Download", unpack and store the coverage report
|
|
|
- locally, run
|
|
|
```
|
|
|
cmake .. -DCMAKE_BUILD_TYPE=Coverage -DUSE_Pythia8_C8=C8
|
|
|
make -j4 && ctest -j4 && make coverage
|
|
|
```
|
|
|
|
|
|
In both cases, the coverage is accessible in `coverage-report/index.html`.
|
|
|
|
|
|
Recommendation:
|
|
|
|
|
|
If you create a new code with a method/function call, anything like:
|
|
|
```
|
|
|
double newFunctionA();
|
|
|
class newClass { public: int newMethodB(); };
|
|
|
```
|
|
|
You must provide a unit-test that calls and tests the new functionality:
|
|
|
```
|
|
|
TEST_CASE("NewTest") {
|
|
|
double resultA = newFunctionA();
|
|
|
CHECK(resultA == Approx(expected_resultA));
|
|
|
|
|
|
newClass obj;
|
|
|
int resultB = obj.newMethodB();
|
|
|
CHECK(resultB == Approx(expected_resultAB));
|
|
|
}
|
|
|
```
|
|
|
Note, it is in particular important, that for any branch in your code (`if`, `switch`, etc.) you must provide suitable input parameters for the unit-test to go all the branch options. Make sure
|
|
|
you always `CHECK` expected behavior!
|
|
|
|
|
|
|
|
|
See more details on units test: [Guidelines for Unit Tests](Guidelines for Unit Tests). |
|
|
\ No newline at end of file |