This repository was archived by the owner on Dec 3, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Testing
James D edited this page Jun 23, 2021
·
4 revisions
Atomic uses catch2 for unit testing. If you want to contribute please make yourself familar with it by reading their documentation.
If you are a contributor and are submitting a pull request, ensure you also have any unit tests present as well. These unit tests should test the individual functionality of your pull requests. For bug fixes, please create a test that checks the bug and shows that your code is making it pass.
Example - Testing the addition of 2 Fixed Sized Integer Vectors
TEST_CASE("Fixed Sized Vector Addition - Integer Cumulative", "[fixed-vector][addition][cumulative]") {
const atomic::linalg::fvector<int, 3> v1 = { 1,2,3 };
const atomic::linalg::fvector<int, 4> v2 = { 1,2,3,4 };
const atomic::linalg::fvector<int, 4> exp = { 2,4,6,4 };
const auto res1 = v1 + v2;
const auto res2 = v2 + v1;
REQUIRE(res1 == exp);
REQUIRE(typeid(res1) == typeid(exp));
REQUIRE(res2 == exp);
REQUIRE(typeid(res2) == typeid(exp));
}Atomic uses GitHub Actions for Integration Testing. Any pull requests must pass all of the integration testing before they can be reviewed for merging.
It currently has the following workflows (development branch)
├── .github/
| └──workflows/linux.yml
| └──workflows/windows.yml
| └──workflows/macintosh.yml
| └──workflows/clang-format.yml
| └──workflows/cppcheck.yml
| └──workflows/check.yml
| └──workflows/clang-tidy.yml
| └──workflows/security.yml
| └──workflows/release.yml
| └──workflows/coverage.yml
| └──workflows/documentation.yml
-
linux.yml: Builds Atomic and Tests on various Linux configurations. -
windows.yml: Builds Atomic and Tests on various Windows configurations. -
macintosh.yml: Builds Atomic and Tests on various Macintosh configurations. -
clang-format.yml: Runs Clang-Format analysis on Atomic code. -
cppcheck.yml: Runs Cpp-Check static analysis on Atomic code. -
check.yml: Runs some custom checks on Atomic code like license and header guard checks. -
clang-tidy.yml: Runs Clang-Tidy static analysis on Atomic code. -
security.yml: Runs Security checks on Atomic code. -
release.yml: Creates automated releases for specific branches. -
coverage.yml: Create Code coverage reports by running tests with gcov. -
documetation.yml: Creates documentation for Atomic using Dokky.