@@ -1465,9 +1465,8 @@ void ImGuiTestEngine_GetResult(ImGuiTestEngine* engine, int& count_tested, int&
1465
1465
for (int n = 0 ; n < engine->TestsAll .Size ; n++)
1466
1466
{
1467
1467
ImGuiTest* test = engine->TestsAll [n];
1468
- if (test->Output .Status == ImGuiTestStatus_Unknown)
1468
+ if (test->Output .Status == ImGuiTestStatus_Unknown || test-> Output . Status == ImGuiTestStatus_Queued )
1469
1469
continue ;
1470
- IM_ASSERT (test->Output .Status != ImGuiTestStatus_Queued);
1471
1470
IM_ASSERT (test->Output .Status != ImGuiTestStatus_Running);
1472
1471
count_tested++;
1473
1472
if (test->Output .Status == ImGuiTestStatus_Success)
@@ -2004,30 +2003,32 @@ void ImGuiTestEngine_ErrorRecoveryRun(ImGuiTestEngine* engine)
2004
2003
2005
2004
void ImGuiTestEngine_CrashHandler ()
2006
2005
{
2006
+ ImGuiContext& g = *GImGui;
2007
+ ImGuiTestEngine* engine = (ImGuiTestEngine*)g.TestEngine ;
2008
+ ImGuiTest* crashed_test = (engine->TestContext && engine->TestContext ->Test ) ? engine->TestContext ->Test : nullptr ;
2009
+
2010
+ ImOsConsoleSetTextColor (ImOsConsoleStream_StandardError, ImOsConsoleTextColor_BrightRed);
2011
+ if (crashed_test != nullptr )
2012
+ fprintf (stderr, " **ImGuiTestEngine_CrashHandler()** Crashed while running \" %s\" :(\n " , crashed_test->Name );
2013
+ else
2014
+ fprintf (stderr, " **ImGuiTestEngine_CrashHandler()** Crashed :(\n " );
2015
+
2007
2016
static bool handled = false ;
2008
2017
if (handled)
2009
2018
return ;
2010
2019
handled = true ;
2011
2020
2012
- ImGuiContext& g = *GImGui;
2013
- ImGuiTestEngine* engine = (ImGuiTestEngine*)g.TestEngine ;
2014
-
2015
2021
// Write stop times, because thread executing tests will no longer run.
2016
2022
engine->BatchEndTime = ImTimeGetInMicroseconds ();
2017
- for ( int i = 0 ; i < engine-> TestsAll . Size ; i++ )
2023
+ if (crashed_test && crashed_test-> Output . Status == ImGuiTestStatus_Running )
2018
2024
{
2019
- if (engine->TestContext )
2020
- if (ImGuiTest* test = engine->TestContext ->Test )
2021
- if (test->Output .Status == ImGuiTestStatus_Running)
2022
- {
2023
- test->Output .Status = ImGuiTestStatus_Error;
2024
- test->Output .EndTime = engine->BatchEndTime ;
2025
- break ;
2026
- }
2025
+ crashed_test->Output .Status = ImGuiTestStatus_Error;
2026
+ crashed_test->Output .EndTime = engine->BatchEndTime ;
2027
2027
}
2028
2028
2029
2029
// Export test run results.
2030
2030
ImGuiTestEngine_Export (engine);
2031
+ ImGuiTestEngine_PrintResultSummary (engine);
2031
2032
}
2032
2033
2033
2034
#ifdef _WIN32
0 commit comments