Skip to content

CMake: extract data sources into static library, add Catch2 unit tests and CTest integration#23

Closed
ifilot wants to merge 1 commit into
developfrom
codex/identify-and-implement-missing-unit-tests
Closed

CMake: extract data sources into static library, add Catch2 unit tests and CTest integration#23
ifilot wants to merge 1 commit into
developfrom
codex/identify-and-implement-missing-unit-tests

Conversation

@ifilot
Copy link
Copy Markdown
Owner

@ifilot ifilot commented Mar 9, 2026

Motivation

  • Separate the core data implementation from the GUI target to enable cleaner linking and independent testing of the data layer.
  • Add an automated unit test harness to validate data model behavior and loader error handling.
  • Integrate Catch2 via FetchContent and enable CTest test discovery to run tests in CI.

Description

  • Introduce ATOM_ARCHITECT_DATA_SOURCES and create a new static target atom-architect-data that contains data sources and resources.qrc and links to Qt5::Core, Qt5::Widgets, Qt5::Charts, Eigen3::Eigen, and glm::glm.
  • Remove data source files from the atom-architect executable list and link atom-architect against atom-architect-data instead, preserving platform-specific link rules and resource handling.
  • Add include(CTest) and a BUILD_TESTING block that fetches Catch2 (v3.7.1), defines atom-architect-tests and wires catch_discover_tests for test discovery.
  • Add new unit tests in tests/data_unit_tests.cpp covering Atom selection cycling, Bond construction and special-axis handling, Structure eigenmode validation and selection/freeze behavior, StructureOperator z-alignment, and NebCalculationLoader error reporting.

Testing

  • No automated tests were executed as part of this rollout; the repository is configured to build and discover tests when configured with -DBUILD_TESTING=ON.
  • The test binary atom-architect-tests is added and linked against Catch2::Catch2WithMain and atom-architect-data for unit execution.
  • Tests can be run locally or in CI with cmake -S . -B build -DBUILD_TESTING=ON && cmake --build build && ctest --test-dir build -V.

Codex Task

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant