Skip to content

Improve test suite layering#93

Draft
orting wants to merge 48 commits into
mainfrom
improve-testing
Draft

Improve test suite layering#93
orting wants to merge 48 commits into
mainfrom
improve-testing

Conversation

@orting

@orting orting commented Jul 6, 2026

Copy link
Copy Markdown

Summary

  • add suite-level CTest labels for cxx-unit, dai-unit, and dai-system
  • document the test-layer selectors and local test entrypoints
  • restore the C++ unit-test harness/build under explicit registration
  • update Linux, macOS, and Windows test workflows to build and run C++ unit tests

Notes

  • this branch is based on explicit-registration-phase1
  • this PR is draft-only for now so CI can run on the workflow updates

orting and others added 30 commits July 2, 2026 09:55
Replace file-scope format registration globals with an explicit register_format_models() bootstrap. The format component and the LaTeX formatter now register through function-local statics created on demand instead of relying on static initialization side effects.

Call the bootstrap before Toplevel constructs Metalib, because Metalib snapshots Librarian::intrinsics() via clone() during construction. Registering later leaves the format component out of that snapshot and breaks document-related commands and tests.

This keeps DeclareComponent, DeclareModel, Librarian, and Intrinsics unchanged while proving the explicit-registration pattern on a narrow slice of the codebase.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add register_util_models() as the util-level bootstrap and call it from the early Toplevel startup hook, before Metalib clones the intrinsic registry snapshot.

Migrate the active util registration sites behind explicit per-file bootstrap functions: scope, scope_exchange, depth, scopesel, solver, solver_none, solver_ublas, solver_cxsparse, and the existing format bootstrap. The file-scope registration globals for these compiled util units are removed in favor of function-local statics constructed on demand.

Keep the existing DeclareComponent / DeclareModel / Librarian / Intrinsics machinery intact. This change only switches activation from link-time static initialization to explicit startup registration for the util subsystem.

Validation: native Linux build succeeded; dai_unit_test.document passed; the full Linux system suite held the current baseline with only the two existing failures in dai_system_test.programs.hydraulic and dai_system_test.programs.spawn.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add register_object_model_models() as an early startup bootstrap and call it before util registration, so Metalib snapshots a parser and core parameter-type registry that no longer depends on file-scope static initialization.

Migrate the first object_model slice behind explicit per-file bootstrap functions: parser, parser_file, function, number, stringer, boolean, and integer. The existing DeclareComponent / DeclareModel / DeclareBase / DeclareSubmodel machinery stays intact; only activation changes from translation-unit side effects to explicit startup registration.

Validation: native Linux build succeeded; dai_unit_test.document passed; the full Linux system suite held the current baseline with only the two existing failures in dai_system_test.programs.hydraulic and dai_system_test.programs.spawn.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Extend register_object_model_models() with the unit subsystem and move unit_model.C away from file-scope registration instances. The unit component, SI bases, factor and offset models, and the built-in base units now register through register_unit_models() instead of depending on translation-unit side effects.

This keeps the existing DeclareComponent / DeclareBase / DeclareModel / DeclareParam machinery intact while making unit registration follow the same explicit startup path as the earlier parser and parameter-type slices.

Validation: native Linux build succeeded; dai_unit_test.document passed; the full Linux system suite held the current baseline with only the existing failures in dai_system_test.programs.hydraulic and dai_system_test.programs.spawn.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add register_rate_models() to the object_model startup bootstrap and move rate.C away from file-scope registration instances. The rate component, the direct-rate model, the halftime model, and the built-in zero parameterization now register through explicit startup code instead of translation-unit side effects.

This keeps rate registration aligned with the explicit bootstrap path already used for parser, parameter roots, and unit models while preserving the existing DeclareComponent / DeclareModel / DeclareParam registry behavior.

Validation: native Linux build succeeded; dai_unit_test.document passed; the full Linux system suite held the current baseline with only the existing failures in dai_system_test.programs.hydraulic and dai_system_test.programs.spawn.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Extend the object_model startup bootstrap with the first broad parameter-type model slice: number const/apply/plf/arithmetic/lisp models, integer arithmetic models, and boolean string comparison. These files no longer depend on file-scope registration instances; each now registers through an explicit per-file bootstrap function called from register_object_model_models().

This keeps the existing DeclareBase / DeclareModel registry semantics intact while moving the commonly used derived parameter-type models onto the same explicit startup path as the object_model roots, units, and rate component.

Validation: native Linux build succeeded; dai_unit_test.document passed; the full Linux system suite held the current baseline with only the existing failures in dai_system_test.programs.hydraulic and dai_system_test.programs.spawn.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Complete the object_model migration by moving the remaining compiled registration sites onto explicit startup code. This finishes number source and soil models, the Python-backed function model, the conditional submodel helpers in integer and stringer, and the top-level Toplevel submodel registration without relying on file-scope registration instances.

With this change, register_object_model_models() covers the full compiled object_model tree: parser and parser_file, function and optional Python support, number/string/boolean/integer roots and derived parameter-type models, rate, unit, and the top-level object-model entry point.

Validation: native Linux build succeeded; dai_unit_test.document passed; the full Linux system suite held the current baseline with only the existing failures in dai_system_test.programs.hydraulic and dai_system_test.programs.spawn.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add a dedicated UI subsystem bootstrap and call it during early startup from Toplevel. This moves the compiled UI registration sites in ui.C and uifilter.C behind register_ui_models(), using internal per-file bootstrap functions instead of file-scope DeclareComponent / DeclareBase / DeclareModel instances.

This starts phase 4 with the smallest leaf subsystem while keeping UI registration on the same explicit startup path as object_model and util.

Validation: native Linux build succeeded; dai_unit_test.document passed; the full Linux system suite held the current baseline with only the existing failures in dai_system_test.programs.hydraulic and dai_system_test.programs.spawn.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use daisy.exe for packaged Windows test runs so the Python-based dai_unit_test and dai_system_test harnesses can launch the installed binary correctly. This addresses the CreateProcess/FileNotFound failure caused by pointing the Windows test runner at bin/daisy instead of bin/daisy.exe.

Also centralize platform-specific system-test disables inside the dai_system_test() helper so known failures stay visible during configure and remain registered in CTest as disabled tests. For now: macOS disables groundwater-deep, hydraulic, and spawn; Linux and Windows disable hydraulic and spawn.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Point the Windows dai_unit_test and dai_system_test harnesses at the actual packaged executable, bin/daisy-bin.exe. The Windows ZIP does not install daisy.exe, and using the real packaged binary keeps the test runner aligned with the packaged DLL layout in the same bin directory.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Extend the centralized Windows system-test skip list with vernalization-default and groundwater-deep so the Windows workflow can report the current known-failure set explicitly as disabled tests alongside the existing hydraulic and spawn skips.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Start the programs subsystem migration with an explicit register_program_models() bootstrap and wire it into early startup from Toplevel. This first slice moves the program component root, file programs, and the extract/listsum registration cluster off file-scope registration instances and behind explicit per-file bootstrap functions.

Validation: native Linux build succeeded; dai_unit_test.document passed; the full Linux system suite passed with the current known failures reported as disabled tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Closes #91

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add tutorial/exercises baselines and the current reference baseline for doc verification. The reference baseline was generated before the xref path-deduplication fix and before switching Fixed Components to alphabetical ordering, so some reference-manual diffs are currently expected.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Recommend the platform Makefile targets as the local developer entrypoints for Daisy tests, while keeping direct ctest usage documented as a lower-level option.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
orting and others added 2 commits July 6, 2026 10:39
Recommend the platform Makefile targets as the local developer entrypoints for Daisy tests, clarify the prerequisites for direct ctest usage, and keep the distinction between local usage and explicit CI workflow steps clear in the documentation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add suite-level CTest labels for C++ unit tests, .dai unit tests, and .dai system tests; document the selectors; restore the C++ unit-test harness so the suite builds under explicit registration; and update the CI workflows to configure and run the C++ unit tests on Linux, macOS, and Windows.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@orting orting changed the base branch from explicit-registration-phase1 to main July 6, 2026 09:43
orting and others added 16 commits July 6, 2026 11:45
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Make the C++ unit-test support library static for Windows linkage, only link Boost::system when that imported target exists so macOS config-package builds succeed, and add missing Daisy registration declarations to eliminate missing-declaration warnings for explicit registration functions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Time::now() is only used by the C++ unit tests in this repository, but it should still convert tm_year to a full calendar year.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep the PR workflows as one explicit job per platform while retaining the safer dependency and archive lookup hardening.

Also stop rewriting the copied managed Python dylib install name on macOS, which avoids install_name_tool failures on current runner images.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Update the Flatpak launcher so persisted lib and sample data are refreshed when the packaged content changes, avoiding stale runtime files after reinstalls or upgrades.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add a standalone packaged-test bundle and runner for install verification outside the build tree. Bundle dai tests, baselines, and Python helpers; align packaged discovery with disabled CI tests; and document the Flatpak data and temp-directory behavior needed for packaged runs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep build-time C++ checks in the build jobs, then verify the packaged artifacts in downstream package-test jobs using the standalone test bundle. Linux now tests the installed .deb, while macOS and Windows test their packaged zip outputs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use the built .deb for Linux package verification, install make in the Windows build job for test-bundle creation, and fix staged macOS dylib references so packaged tests can load SuiteSparse at runtime.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

1 participant