Skip to content

test(unit): add unit testing capabilities - #24

Merged
rfprod merged 1 commit into
mainfrom
unit-tests
Nov 5, 2026
Merged

rfprod merged 1 commit into
mainfrom
unit-tests

Conversation

@rfprod

@rfprod rfprod commented Nov 5, 2026

Copy link
Copy Markdown
Owner
  • bump project version from 0.4.2 to 0.4.3;
  • move core sources into a cpp-workspace-core static library linked by the app;
  • add CPP_WORKSPACE_BUILD_TESTS option and a tests/ directory with a GTest suite;
  • change parse_args to take argc by value;
  • change parse_args to take argv as const char* const[], and make it const;
  • extract help_text() from print_help() so the help output can be tested;
  • add gtest/1.15.0 as a Conan test requirement gated by the with_tests option;
  • add -t/--tests and --no-tests flags plus ENABLE_TESTS env var to build.sh;
  • pass CPP_WORKSPACE_BUILD_TESTS to CMake and with_tests to Conan based on the toggle;
  • run ctest and the ncurses++ link check only when tests are enabled;
  • exit with an error if the test binary is missing after the build;
  • include tests/ sources in the clang-format and cppcheck runs in format.sh;
  • add src/storage and tests/ to the cppcheck include paths;

@rfprod rfprod self-assigned this Nov 5, 2026
@rfprod rfprod added Refactor Refactoring related changes. Program Main program logic related changes. Specs: Unit Unit specs related changes. Tools: Shell Shell utility scripts related changes. labels Nov 5, 2026
@rfprod
rfprod enabled auto-merge (squash) November 5, 2026 10:01
@rfprod
rfprod force-pushed the unit-tests branch 2 times, most recently from 78fb7b2 to 24b2965 Compare November 5, 2026 10:20
- [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;
@rfprod
rfprod merged commit d4870bb into main Nov 5, 2026
3 checks passed
@rfprod
rfprod deleted the unit-tests branch November 5, 2026 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Program Main program logic related changes. Refactor Refactoring related changes. Specs: Unit Unit specs related changes. Tools: Shell Shell utility scripts related changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant