Commit a122959
committed
Use ctest, parallelize tests, report coverage
This commit introduces a few improvements to the test framework:
* Support for `ctest`
Tests can now be run with:
```
ctest -j $(nproc)
```
This will automatically take care of running all the tests, including
the MPI tests (with two process) and the GPU tests (if applicable).
Tests run in this way are not run in parallel.
Note, OpenMP threads are not accounted here, so the total number of
cores used is $(nproc) * NUM_OMP_THREADS
* New test tag `NoConcurrent` and new fixture `TempDirFixture`
Since tests can now be run in parallel, we need to tag tests that cannot
be run concurrently (e.g., because they used shared resources).
A common use case of `NoConcurrent` is for file-system operations.
However, this is a better way to deal with this problem: ensuring
isolation and clean up of tests. To help with this, I added a new
fixture, `TempDirFixture`, that automatically creates and destroy
testing directories.
* script to compute coverage
`measure-test-coverage` is a new script that uses the ctest capabilities
and lcov to distill coverage information and produce html reports.
`measure-test-coverage` can be used to:
1. produce the coverage.info objects by running the tests
2. merge different coverage.info objects
3. produce the html report from the coverage.info files
When run locally, `measure-test-coverage report` will probably cover
most of the use cases. The need to handle different coverage.info
objects might become relevant in the future for CI (if test coverage
information is split across different workers)
* Coverage is now computed as part of CI:
With all the previous advancements, we can now compute coverage as part
of CI and produce a report. The report can be downloaded from the job
page on GitHub actions.1 parent e6fe762 commit a122959
File tree
11 files changed
+832
-139
lines changed- .github/workflows
- docs/src/developer
- palace
- scripts
- test/unit
11 files changed
+832
-139
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
| 228 | + | |
228 | 229 | | |
229 | 230 | | |
230 | 231 | | |
| |||
248 | 249 | | |
249 | 250 | | |
250 | 251 | | |
251 | | - | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
252 | 255 | | |
253 | 256 | | |
254 | 257 | | |
255 | 258 | | |
256 | 259 | | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
257 | 265 | | |
258 | 266 | | |
259 | 267 | | |
| |||
428 | 436 | | |
429 | 437 | | |
430 | 438 | | |
| 439 | + | |
431 | 440 | | |
432 | 441 | | |
433 | 442 | | |
| |||
454 | 463 | | |
455 | 464 | | |
456 | 465 | | |
457 | | - | |
| 466 | + | |
458 | 467 | | |
459 | | - | |
460 | | - | |
461 | | - | |
462 | | - | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
463 | 475 | | |
464 | 476 | | |
465 | 477 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
223 | 232 | | |
224 | 233 | | |
0 commit comments