Skip to content

Add deterministic headless TestHost foundation - #93

Merged
ProGraMajster merged 2 commits into
masterfrom
codex/issue-64-testhost-phase1
Aug 21, 2026
Merged

Add deterministic headless TestHost foundation#93
ProGraMajster merged 2 commits into
masterfrom
codex/issue-64-testhost-phase1

Conversation

@ProGraMajster

Copy link
Copy Markdown
Owner

Summary

Implement Phase 1 of #64 with a supported headless testing package built on real ModernFormsNext runtime behavior.

New package

ModernFormsNext.Testing

Phase 1 capabilities

  • deterministic application/window hosting
  • UI dispatcher
  • explicit layout
  • layout-until-stable
  • resize
  • logical DPI/render scale
  • structural control-tree snapshots
  • diagnostics
  • deterministic cleanup

Production seams

  • Dispatcher: an internal scoped registration temporarily installs a deterministic implementation while preserving the production priority queue, FIFO behavior, exception propagation/capture, and the previous UI dispatcher. The scope is always restored even if draining fails; normal applications never call the seam and no global test-mode switch changes runtime ordering.
  • Form/window factory: Form construction first checks an internal execution-context-local factory scope. When no TestHost scope exists, the existing FrameworkBootstrap and IWindowingPlatform native path runs unchanged. Headless backends can only be created inside the owning TestHost scope.
  • AnimationScheduler: the only scheduler addition is an internal, non-initializing diagnostics read. TestHost does not replace the clock, disable timing globally, or alter runtime scheduling; deterministic close cancels only entries owned by hosted controls.

The final review also hardened failure cleanup for dispatcher drain, layout, and Closing failures, preserved cleanup of other windows, rejected invalid default viewports, and made structural snapshot paths unambiguous by including sibling indices.

Validation

  • ModernFormsNext.Testing tests: 46/46
  • Designer/runtime parity: 78/78
  • Designer tests: 275/275
  • all tests: 1264/1264
  • Android backend tests: 72/72; Debug and Release Android targets built (no emulator/device claim)
  • Windows backend tests: 7/7
  • cross-platform sample tests: 16/16
  • Debug solution build: passed, 0 warnings / 0 errors
  • Release solution build: passed, 0 warnings / 0 errors
  • VSIX Debug and Release: passed
  • DocFX metadata/build: passed, 0 warnings / 0 errors
  • release documentation scripts: 32 assertions; 4/4 archives validated
  • packages: 9 nupkg / 8 snupkg validated
  • ModernFormsNext.Testing symbols and exact-SHA SourceLink: passed
  • isolated local package install smoke: passed
  • git diff --check: clean

Not included

  • input/focus
  • TestClock
  • bitmap rendering/snapshots
  • fake lifecycle/services
  • native E2E

Implements Phase 1 of #64

- add supported headless application and window hosting for tests
- use production control and layout behavior
- provide deterministic dispatcher, resize and DPI configuration
- expose detached control-tree and layout snapshots
- guarantee deterministic cleanup and host isolation
- prepare the foundation for future input, clock and rendering phases
@ProGraMajster
ProGraMajster merged commit 6506e21 into master Aug 21, 2026
1 check passed
@ProGraMajster
ProGraMajster deleted the codex/issue-64-testhost-phase1 branch August 21, 2026 19:05
@github-project-automation github-project-automation Bot moved this from Backlog to Done in ModernFormsNext Roadmap Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant