Skip to content

Add C++11 doctest unit tests, CI workflow, uv Python test setup, and bugfixes - #42

Open
awillats wants to merge 16 commits into
CLOCTools:masterfrom
awillats:feat/cpp-unit-tests-ci
Open

awillats wants to merge 16 commits into
CLOCTools:masterfrom
awillats:feat/cpp-unit-tests-ci

Conversation

@awillats

Copy link
Copy Markdown

Summary of Changes

  • C++11 Unit Test Harness & CI:
    • Vendored doctest.h v2.4.11 + MIT LICENSE.txt in tests/doctest/ (gated by LDSCTRLEST_BUILD_TESTS).
    • Added 6 C++11 unit test suites in tests/ and python-tests CI job in .github/workflows/build.yml.
    • Updated vcpkg.json (0.8.1 -> 0.9.0), README.md (ldsCtrlEst_h), CMakeLists.txt (PROJECT_URL), and python/pyproject.toml + python/uv.lock (pytest, numpy, matplotlib).
  • Bugfixes (Red-Green-Refactor):
    • src/lds.cpp (ForceSymPD): Fixed off-diagonal arma::datum::eps precedence, used scale-aware diagonal shift, and terminated on X.is_sympd().
    • include/ldsCtrlEst_h/lds_sctrl.h:231 (SwitchedController::InitVars): Fixed Kc_u_list_ copy-paste typo (Kc_inty_ -> Kc_u_).
    • src-fit/lds_poisson_fit_em.cpp:179 (FitEM::MaximizeOutput): Fixed unequal-trial-length OOB loop bound (x_[0].n_cols -> x_[k].n_cols).
  • Documentation & Pinning:
    • include/ldsCtrlEst_h/lds_ctrl.h:520,535 (kControlTypeIntY): Preserved sys_.cx() - cx_ref_ for v0.9, documented cx vs. y semantics, and added a PLDS pinning test in tests/test_ctrl.cpp.

Verification

  • Release ctest --output-on-failure: 11/11 passed (3.02 s); ./tests/lds_unit_tests: 24/24 cases, 2,348/2,348 assertions passed.
  • ASan + UBSan (Debug): 11/11 passed (5.71 s, 0 sanitizer errors).
  • python/ (uv run pytest tests/ -q): 192 passed (16.97 s).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants