dear-imgui-test-engine
Safe, idiomatic Rust integration for Dear ImGui Test Engine on top of dear-imgui-rs.
- Engine lifetime helpers: create/start/stop/destroy via RAII.
- Test queue helpers: queue tests/perfs, inspect queue/running state.
- Runtime controls: speed, verbosity, capture, abort.
- UI integration: show built-in test engine windows in an active ImGui frame.
For native build/link options, see extensions/dear-imgui-test-engine-sys/README.md.
Links
- Upstream: https://github.com/ocornut/imgui_test_engine
- Low-level crate:
dear-imgui-test-engine-sys - Example:
examples/imgui_test_engine_basic.rs
Compatibility
| Item | Version |
|---|---|
| Crate | 0.11.0 |
| dear-imgui-rs | 0.11.0 |
| dear-imgui-test-engine-sys | 0.11.0 |
See also: docs/COMPATIBILITY.md.
Quick Start
[]
= "0.11.0"
= "0.11.0"
use dear_imgui_rs as imgui;
use dear_imgui_test_engine as test_engine;
let mut engine = create;
let mut imgui_ctx = create;
engine
.try_start
.expect;
// In your frame loop
let ui = imgui_ctx.frame;
engine.show_windows;
// Queue all tests from CLI context
let _ = engine.queue_tests;
// On shutdown, stop the engine before dropping the ImGui context.
engine.shutdown;
Notes
dear-imgui-test-engine-sysautomatically enables the requiredIMGUI_ENABLE_TEST_ENGINEdefine ondear-imgui-sys.- If you care about preserving test engine
.inisettings, prefer:engine.stop()- drop the ImGui context
- drop the engine
- This lets the upstream context hook unbind cleanly during
ImGui::DestroyContext().
engine.shutdown()is more robust if you can't guarantee drop order, but may not preserve.inisettings.- Upstream Dear ImGui Test Engine has its own license terms; review
extensions/dear-imgui-test-engine-sys/third-party/imgui_test_engine/imgui_test_engine/LICENSE.txtbefore shipping commercial products.
Features
capture(default): enable screenshot/video capture helpers.freetype: passthrough todear-imgui-rs/freetypeanddear-imgui-test-engine-sys/freetype.
Demo Tests
This crate bundles a small set of built-in demo tests (for validating integration):
let mut engine = create;
engine.register_default_tests;
To write tests from Rust without dealing with C++ callbacks, use script tests:
engine.add_script_test?;
Script tests do not provide a GuiFunc (they don't draw any UI). They are meant to drive UI that your
application already renders every frame.
Build notes
- This crate enables
dear-imgui-rs/test-engine(and thereforedear-imgui-sys/test-engine) because the upstream Test Engine relies on ImGui hook symbols. dear-imgui-sysprovides the hook symbols whentest-engineis enabled. This avoids workspace feature-unification causing linker errors.- If your tests don't seem to interact with the UI, ensure you actually depend on
dear-imgui-test-engine(ordear-imgui-test-engine-sys) and callengine.start()/try_start().