https://github.com/exercism/cpp-test-runner
https://github.com/exercism/cpp-test-runner
community-contributions-paused exercism-test-runner exercism-tooling maintained
Last synced: 28 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/exercism/cpp-test-runner
- Owner: exercism
- License: agpl-3.0
- Created: 2020-04-13T13:35:03.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2024-11-22T05:59:57.000Z (6 months ago)
- Last Synced: 2025-04-29T06:32:07.951Z (about 1 month ago)
- Topics: community-contributions-paused, exercism-test-runner, exercism-tooling, maintained
- Language: C++
- Size: 276 KB
- Stars: 2
- Watchers: 9
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Exercism C++ Test Runner
Docker image used for automatic testing of the C++ track's exercises.
This test runner, much like the ones for other tracks, **must** respect the [specified interface][test-runner-interface].
Since the test runners are deployed as Docker images the [related specification][test-runner-docker] **must** be respected for the Dockerfile.
# Running tests
To run tests:
1. Open project's root in terminal
2. Run `./test.sh`This will compile and run tests for all exercises in the `tests` folder, it will fail if the output file `result.json` is different from the expected one for the exercise.
If you want to run specific tests:
1. Open project's root in terminal
2. Run `./test.sh `In both cases you can show more informations, like Docker output, by using the flag `-v` or `--verbose`.
# How it works
On the C++ track we use CMake for building the exercises and [Catch][catch-lib] as its test framework.
Catch can report the tests results in [JUnit][junit] formatted xml when enabled, we do so during the config step in `run.sh` by running the built executable with certain flags, when this is done a file `output.xml` is generated during build time.
This file is parsed with Python and the [junitparser][junitparser-lib] library in the `process.py` script that outputs a `results.json` file that respects the test runners specifications.
[test-runner-interface]: https://exercism.org/docs/building/tooling/test-runners/interface
[test-runner-docker]: https://exercism.org/docs/building/tooling/test-runners/docker
[cmake]: https://cmake.org/
[catch-lib]: https://github.com/catchorg/Catch2
[junit]: https://junit.org/junit5/
[junitparser-lib]: https://github.com/gastlygem/junitparser