#pragma GCC diagnostic ignored "-Wclass-memaccess" // [__GNUC__ >= 8] warning: 'memset/memcpy' clearing/writing an object of type 'xxxx' with no trivial copy-assignment; use assignment or value-initialization instead
structImGuiTest;// Data for a test registered with IM_REGISTER_TEST()
structImGuiTestContext;// Context while a test is running
structImGuiTestCoroutineInterface;// Interface to expose coroutine functions (imgui_te_coroutine provides a default implementation for C++11 using std::thread, but you may use your own)
structImGuiTestEngine;// Test engine instance
structImGuiTestEngineIO;// Test engine public I/O
structImGuiTestItemInfo;// Info queried from item (id, geometry, status flags, debug label)
structImGuiTestItemList;// A list of items
structImGuiTestInputs;// Simulated user inputs (will be fed into ImGuiIO by the test engine)
structImGuiTestRunTask;// A queued test (test + runflags)
typedefintImGuiTestFlags;// Flags: See ImGuiTestFlags_
typedefintImGuiTestCheckFlags;// Flags: See ImGuiTestCheckFlags_
typedefintImGuiTestLogFlags;// Flags: See ImGuiTestLogFlags_
typedefintImGuiTestRunFlags;// Flags: See ImGuiTestRunFlags_
// Test group: this is mostly used to categorize tests in our testing UI. (Stored in ImGuiTest)
enumImGuiTestGroup:int
{
ImGuiTestGroup_Unknown=-1,
ImGuiTestGroup_Tests=0,
ImGuiTestGroup_Perfs=1,
ImGuiTestGroup_COUNT
};
// Flags (stored in ImGuiTest)
enumImGuiTestFlags_
{
ImGuiTestFlags_None=0,
ImGuiTestFlags_NoGuiWarmUp=1<<0,// Disable running the GUI func for 2 frames before starting test code. For tests which absolutely need to start before GuiFunc.
ImGuiTestFlags_NoAutoFinish=1<<1,// By default, tests with no TestFunc (only a GuiFunc) will end after warmup. Setting this require test to call ctx->Finish().
ImGuiTestFlags_NoRecoveryWarnings=1<<2// Disable state recovery warnings (missing End/Pop calls etc.) for tests which may rely on those.
//ImGuiTestFlags_RequireViewports = 1 << 10
};
// Flags for IM_CHECK* macros.
enumImGuiTestCheckFlags_
{
ImGuiTestCheckFlags_None=0,
ImGuiTestCheckFlags_SilentSuccess=1<<0
};
// Flags for ImGuiTestContext::Log* functions.
enumImGuiTestLogFlags_
{
ImGuiTestLogFlags_None=0,
ImGuiTestLogFlags_NoHeader=1<<0// Do not display frame count and depth padding
};
enumImGuiTestRunFlags_
{
ImGuiTestRunFlags_None=0,
ImGuiTestRunFlags_GuiFuncDisable=1<<0,// Used internally to temporarily disable the GUI func (at the end of a test, etc)
ImGuiTestRunFlags_GuiFuncOnly=1<<1,// Set when user selects "Run GUI func"
ImGuiTestRunFlags_NoSuccessMsg=1<<2,
ImGuiTestRunFlags_EnableRawInputs=1<<3,// Disable input submission to let test submission raw input event (in order to test e.g. IO queue)
ImGuiTestRunFlags_RunFromGui=1<<4,// Test ran manually from GUI, will disable watchdog.
ImGuiTestRunFlags_RunFromCommandLine=1<<5,// Test queued from command-line.
// Flags for ImGuiTestContext::RunChildTest()
ImGuiTestRunFlags_NoError=1<<10,
ImGuiTestRunFlags_ShareVars=1<<11,// Share generic vars and custom vars between child and parent tests (custom vars need to be same type)
ImGuiTestRunFlags_ShareTestContext=1<<12,// Share ImGuiTestContext instead of creating a new one (unsure what purpose this may be useful for yet)
IMGUI_APIImGuiTestEngine*ImGuiTestEngine_CreateContext();// Create test engine
IMGUI_APIvoidImGuiTestEngine_DestroyContext(ImGuiTestEngine*engine);// Destroy test engine. Call after ImGui::DestroyContext() so test engine specific ini data gets saved.
IMGUI_APIvoidImGuiTestEngine_Start(ImGuiTestEngine*engine,ImGuiContext*ui_ctx);// Bind to a dear imgui context. Start coroutine.
IMGUI_APIvoidImGuiTestEngine_Stop(ImGuiTestEngine*engine);// Stop coroutine and export if any. (Unbind will lazily happen on context shutdown)
IMGUI_APIvoidImGuiTestEngine_PostSwap(ImGuiTestEngine*engine);// Call every frame after framebuffer swap, will process screen capture and call test_io.ScreenCaptureFunc()
// Function bound to right-clicking on a test and selecting "Open source" in the UI
// - Easy: you can make this function call OS shell to "open" the file (e.g. ImOsOpenInShell() helper).
// - Better: bind this function to a custom setup which can pass line number to a text editor (e.g. see 'imgui_test_suite/tools/win32_open_with_sublime.cmd' example)
ImGuiTestCoroutineInterface*CoroutineFuncs=NULL;// (Required) Coroutine functions (see imgui_te_coroutines.h)
ImFuncPtr(ImGuiTestEngineSrcFileOpenFunc)SrcFileOpenFunc=NULL;// (Optional) To open source files from test engine UI
ImFuncPtr(ImGuiScreenCaptureFunc)ScreenCaptureFunc=NULL;// (Optional) To capture graphics output (application _MUST_ call ImGuiTestEngine_PostSwap() function after swapping is framebuffer)
void*SrcFileOpenUserData=NULL;// (Optional) User data for SrcFileOpenFunc
void*ScreenCaptureUserData=NULL;// (Optional) User data for ScreenCaptureFunc
// Options: Main
boolConfigSavedSettings=true;// Load/Save settings in main context .ini file.
ImGuiTestRunSpeedConfigRunSpeed=ImGuiTestRunSpeed_Fast;// Run tests in fast/normal/cinematic mode
boolConfigStopOnError=false;// Stop queued tests on test error
boolConfigBreakOnError=false;// Break debugger on test error by calling IM_DEBUG_BREAK()
boolConfigKeepGuiFunc=false;// Keep test GUI running at the end of the test
boolConfigRestoreFocusAfterTests=true;// Restore focus back after running tests
boolConfigCaptureEnabled=true;// Master enable flags for capturing and saving captures. Disable to avoid e.g. lengthy saving of large PNG files.
boolConfigCaptureOnError=false;
boolConfigNoThrottle=false;// Disable vsync for performance measurement or fast test running
boolConfigMouseDrawCursor=true;// Enable drawing of Dear ImGui software mouse cursor when running tests
floatConfigFixedDeltaTime=0.0f;// Use fixed delta time instead of calculating it from wall clock
intPerfStressAmount=1;// Integer to scale the amount of items submitted in test
charGitBranchName[64]="";// e.g. fill in branch name (e.g. recorded in perf samples .csv)
// Options: Speed of user simulation
floatMouseSpeed=600.0f;// Mouse speed (pixel/second) when not running in fast mode
floatMouseWobble=0.25f;// (0.0f..1.0f) How much wobble to apply to the mouse (pixels per pixel of move distance) when not running in fast mode
floatScrollSpeed=1400.0f;// Scroll speed (pixel/second) when not running in fast mode
floatTypingSpeed=20.0f;// Char input speed (characters/second) when not running in fast mode
floatActionDelayShort=0.15f;// Time between short actions
floatActionDelayStandard=0.40f;// Time between most actions
// Options: Screen/video capture
charVideoCaptureEncoderPath[256]="";// Video encoder executable path, e.g. "path/to/ffmpeg.exe".
charVideoCaptureEncoderParams[256]="";// Video encoder parameters for .MP4 captures, e.g. see IMGUI_CAPTURE_DEFAULT_VIDEO_PARAMS_FOR_FFMPEG
charGifCaptureEncoderParams[512]="";// Video encoder parameters for .GIF captures, e.g. see IMGUI_CAPTURE_DEFAULT_GIF_PARAMS_FOR_FFMPEG
charVideoCaptureExtension[8]=".mp4";// Video file extension (default, may be overridden by test).
// Options: Watchdog. Set values to FLT_MAX to disable.
// Interactive GUI applications that may be slower tend to use higher values.
floatConfigWatchdogWarning=30.0f;// Warn when a test exceed this time (in second)
floatConfigWatchdogKillTest=60.0f;// Attempt to stop running a test when exceeding this time (in second)
floatConfigWatchdogKillApp=FLT_MAX;// Stop application when exceeding this time (in second)
// Options: Export
// While you can manually call ImGuiTestEngine_Export(), registering filename/format here ensure the crash handler will always export if application crash.
constchar*Name=NULL;// Literal, generally not owned unless NameOwned=true
ImGuiTestGroupGroup=ImGuiTestGroup_Unknown;// Coarse groups: 'Tests' or 'Perf'
boolNameOwned=false;//
constchar*SourceFile=NULL;// __FILE__
intSourceLine=0;// __LINE__
intSourceLineEnd=0;// Calculated by ImGuiTestEngine_StartCalcSourceLineEnds()
intArgVariant=0;// User parameter. Generally we use it to run variations of a same test by sharing GuiFunc/TestFunc
ImGuiTestFlagsFlags=ImGuiTestFlags_None;// See ImGuiTestFlags_
ImFuncPtr(ImGuiTestGuiFunc)GuiFunc=NULL;// GUI function (optional if your test are running over an existing GUI application)
ImFuncPtr(ImGuiTestTestFunc)TestFunc=NULL;// Test function
void*UserData=NULL;// General purpose user data (if assigning capturing lambdas on GuiFunc/TestFunc you may not need to use this)
//ImVector<ImGuiTestRunTask> Dependencies; // Registered via AddDependencyTest(), ran automatically before our test. This is a simpler wrapper to calling ctx->RunChildTest()
// Last Test Output/Status
// (this is the only part that may change after registration)
ImGuiTestOutputOutput;
// User variables (which are instantiated when running the test)
// Setup after test registration with SetVarsDataType<>(), access instance during test with GetVars<>().
// This is mostly useful to communicate between GuiFunc and TestFunc. If you don't use both you may not want to use it!
size_tVarsSize=0;
ImGuiTestVarsConstructor*VarsConstructor=NULL;
ImGuiTestVarsPostConstructor*VarsPostConstructor=NULL;// To override constructor default (in case the default are problematic on the first GuiFunc frame)