Enhance testing framework and UI integration for YAZE
- Added a comprehensive testing framework with support for unit, integration, and UI tests, improving overall test coverage and reliability. - Integrated ImGui Test Engine for UI testing, allowing for real-time feedback and visualization of test results. - Updated CMake configuration to conditionally include testing components based on build options, enhancing flexibility for developers. - Introduced a new command in the CLI for running asset loading tests on ROMs, providing a straightforward way to validate functionality. - Enhanced error handling and resource management during testing, ensuring stability and clarity in test execution. - Improved user interface with a dedicated test dashboard for monitoring test progress and results, enhancing developer experience.
This commit is contained in:
@@ -4,7 +4,9 @@
|
||||
#include "absl/strings/str_format.h"
|
||||
#include "app/core/platform/font_loader.h"
|
||||
#include "app/core/platform/sdl_deleter.h"
|
||||
#include "app/gfx/arena.h"
|
||||
#include "app/gui/style.h"
|
||||
#include "app/test/test_manager.h"
|
||||
#include "imgui/backends/imgui_impl_sdl2.h"
|
||||
#include "imgui/backends/imgui_impl_sdlrenderer2.h"
|
||||
#include "imgui/imgui.h"
|
||||
@@ -71,18 +73,32 @@ absl::Status CreateWindow(Window& window, int flags) {
|
||||
absl::Status ShutdownWindow(Window& window) {
|
||||
SDL_PauseAudioDevice(window.audio_device_, 1);
|
||||
SDL_CloseAudioDevice(window.audio_device_);
|
||||
|
||||
// Stop test engine WHILE ImGui context is still valid
|
||||
test::TestManager::Get().StopUITesting();
|
||||
|
||||
// Shutdown ImGui implementations
|
||||
ImGui_ImplSDL2_Shutdown();
|
||||
ImGui_ImplSDLRenderer2_Shutdown();
|
||||
|
||||
// Destroy ImGui context
|
||||
ImGui::DestroyContext();
|
||||
|
||||
// NOW destroy test engine context (after ImGui context is destroyed)
|
||||
test::TestManager::Get().DestroyUITestingContext();
|
||||
|
||||
// Shutdown graphics arena BEFORE destroying SDL contexts
|
||||
gfx::Arena::Get().Shutdown();
|
||||
|
||||
SDL_DestroyRenderer(Renderer::Get().renderer());
|
||||
SDL_DestroyWindow(window.window_.get());
|
||||
SDL_Quit();
|
||||
return absl::OkStatus();
|
||||
}
|
||||
|
||||
absl::Status HandleEvents(Window &window) {
|
||||
absl::Status HandleEvents(Window& window) {
|
||||
SDL_Event event;
|
||||
ImGuiIO &io = ImGui::GetIO();
|
||||
ImGuiIO& io = ImGui::GetIO();
|
||||
SDL_WaitEvent(&event);
|
||||
ImGui_ImplSDL2_ProcessEvent(&event);
|
||||
switch (event.type) {
|
||||
|
||||
Reference in New Issue
Block a user