Repository navigation
test(unit): add unit testing capabilities - #24
Merged
Merged
Conversation
rfprod
enabled auto-merge (squash)
November 5, 2026 10:01
rfprod
force-pushed
the
unit-tests
branch
2 times, most recently
from
November 5, 2026 10:20
78fb7b2 to
24b2965
Compare
- [x] bump project version from `0.4.2` to `0.4.3`; - [x] move core sources into a `cpp-workspace-core` static library linked by the app; - [x] add `CPP_WORKSPACE_BUILD_TESTS` option and a `tests/` directory with a `GTest` suite; - [x] change `parse_args` to take argc by value; - [x] change `parse_args` to take argv as `const char* const[]`, and make it `const`; - [x] extract `help_text()` from `print_help()` so the help output can be tested; - [x] add `gtest/1.15.0` as a `Conan` test requirement gated by the with_tests option; - [x] add `-t/--tests` and `--no-tests` flags plus `ENABLE_TESTS` env var to `build.sh`; - [x] pass `CPP_WORKSPACE_BUILD_TESTS` to `CMake` and with_tests to Conan based on the toggle; - [x] run ctest and the `ncurses++` link check only when tests are enabled; - [x] exit with an error if the test binary is missing after the build; - [x] include `tests/` sources in the `clang-format` and `cppcheck` runs in `format.sh`; - [x] add `src/storage` and `tests/` to the `cppcheck` include paths;
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
0.4.2to0.4.3;cpp-workspace-corestatic library linked by the app;CPP_WORKSPACE_BUILD_TESTSoption and atests/directory with aGTestsuite;parse_argsto take argc by value;parse_argsto take argv asconst char* const[], and make itconst;help_text()fromprint_help()so the help output can be tested;gtest/1.15.0as aConantest requirement gated by the with_tests option;-t/--testsand--no-testsflags plusENABLE_TESTSenv var tobuild.sh;CPP_WORKSPACE_BUILD_TESTStoCMakeand with_tests to Conan based on the toggle;ncurses++link check only when tests are enabled;tests/sources in theclang-formatandcppcheckruns informat.sh;src/storageandtests/to thecppcheckinclude paths;