Skip to content

Add Lua-behavior and Game::Bake test suites#86

Merged
mblackman merged 1 commit into
mainfrom
pr-test-coverage
Jun 2, 2026
Merged

Add Lua-behavior and Game::Bake test suites#86
mblackman merged 1 commit into
mainfrom
pr-test-coverage

Conversation

@mblackman
Copy link
Copy Markdown
Owner

@mblackman mblackman commented May 31, 2026

Summary

Rebased onto current main and reduced to the two test suites main doesn't already have. The original branch (cut at #60) also added ECS + EventBus suites and a TestHelpers.h, but equivalent coverage landed on main since then (EcsRegistryTest / EcsHierarchyTest / EventBusTest + TestHarness.h via the headless-test PR), so those parts are dropped as redundant.

Two engine-linked ctest binaries:

  • OctarineLuaBehaviorTest — calls bound component methods from Lua and verifies the C++ side mutated: HealthComponent damage/heal round-trip, current_health clamping setter, PositionComponent.value write, registry.has_/get_ accessors, and LuaBinding<HealthComponent>::fromLua defaults.
  • OctarineGameBakeTest — headless Game game; smoke (no window/renderer), Game::Bake end-to-end against tests/fixtures/bake-project, and SceneAssetScanner::CollectRefs provenance + cross-scene delta. Cleans up every bake artifact (manifest + asset_bundle.pak + atlases/) so the source tree stays clean on CI.

Both link octarine_engine, matching how LuaApiSmokeTest / AssetPipelineTest wire in. Shared Check / CheckEq / ReportSummary helpers live in the existing tests/TestHarness.h, extended here with CheckEq + ReportSummary.

Test plan

  • cmake --preset editor-debug -DOCTARINE_ENABLE_TESTS=ON + build — clean
  • ctest -R "LuaBehaviorTest|GameBakeTest" green; every check exercised (bake end-to-end runs, not skipped); fixture dir left clean
  • CI Linux editor-release leg builds + runs all ctest entries green

Two engine-linked ctest binaries on top of the existing smoke / asset /
ECS / EventBus suites:

- OctarineLuaBehaviorTest — calls bound component methods from Lua and
  verifies the C++ side mutated: HealthComponent damage/heal round-trip,
  current_health clamping setter, PositionComponent.value write, registry
  has_/get_ accessors, and LuaBinding<HealthComponent>::fromLua defaults.
  Catches the "binding compiles but method does nothing" class that the
  drift check can't.
- OctarineGameBakeTest — headless `Game game;` smoke (no window/renderer),
  Game::Bake end-to-end against tests/fixtures/bake-project, and
  SceneAssetScanner::CollectRefs provenance + cross-scene delta. Cleans up
  all bake artifacts (manifest + asset_bundle.pak + atlases/) so the source
  tree stays clean on CI.

Both link octarine_engine (the per-layer engine lib), matching how
LuaApiSmokeTest / AssetPipelineTest wire in. Shared Check/CheckEq/
ReportSummary helpers live in the existing tests/TestHarness.h, extended
here with CheckEq + ReportSummary. The ECS and EventBus suites from the
original branch are dropped — equivalent coverage already landed on main
(EcsRegistryTest / EcsHierarchyTest / EventBusTest via the headless-test PR).

Verified: editor-debug build clean; both suites green via ctest, every
check exercised (bake end-to-end runs, not skipped).
@mblackman mblackman changed the title Expand PR test coverage: ECS, EventBus, Lua behavior, and bake suites Add Lua-behavior and Game::Bake test suites Jun 2, 2026
@mblackman mblackman merged commit 1e1d5fb into main Jun 2, 2026
13 checks passed
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