Base class for editor integration tests. More...
#include <editor_integration_test.h>
Public Member Functions | |
EditorIntegrationTest () | |
~EditorIntegrationTest () | |
absl::Status | Initialize () |
int | RunTest () |
virtual void | RegisterTests (void *engine) |
virtual absl::Status | Update () |
Protected Member Functions | |
absl::Status | LoadTestRom (const std::string &filename) |
absl::Status | SaveTestRom (const std::string &filename) |
absl::Status | TestEditorInitialize (editor::Editor *editor) |
absl::Status | TestEditorLoad (editor::Editor *editor) |
absl::Status | TestEditorSave (editor::Editor *editor) |
absl::Status | TestEditorUpdate (editor::Editor *editor) |
absl::Status | TestEditorCut (editor::Editor *editor) |
absl::Status | TestEditorCopy (editor::Editor *editor) |
absl::Status | TestEditorPaste (editor::Editor *editor) |
absl::Status | TestEditorUndo (editor::Editor *editor) |
absl::Status | TestEditorRedo (editor::Editor *editor) |
absl::Status | TestEditorFind (editor::Editor *editor) |
absl::Status | TestEditorClear (editor::Editor *editor) |
Private Attributes | |
core::Controller | controller_ |
std::unique_ptr< Rom > | test_rom_ |
core::Window | window_ |
std::unique_ptr< gfx::SDL2Renderer > | test_renderer_ |
Base class for editor integration tests.
This class provides common functionality for testing editors in the application. It sets up the test environment and provides helper methods for ROM operations.
For UI interaction testing, use the ImGui test engine API directly within your test functions:
ImGuiTest* test = IM_REGISTER_TEST(engine, "test_suite", "test_name"); test->TestFunc = [](ImGuiTestContext* ctx) { ctx->SetRef("Window Name"); ctx->ItemClick("Button Name"); };
Definition at line 36 of file editor_integration_test.h.
yaze::test::EditorIntegrationTest::EditorIntegrationTest | ( | ) |
Definition at line 23 of file editor_integration_test.cc.
yaze::test::EditorIntegrationTest::~EditorIntegrationTest | ( | ) |
Definition at line 31 of file editor_integration_test.cc.
absl::Status yaze::test::EditorIntegrationTest::Initialize | ( | ) |
Definition at line 40 of file editor_integration_test.cc.
References yaze::gui::ColorsYaze(), controller_, yaze::core::CreateWindow(), RegisterTests(), RETURN_IF_ERROR, yaze::core::Controller::set_active(), test_renderer_, yaze::core::Controller::window(), and window_.
Referenced by RunTest().
int yaze::test::EditorIntegrationTest::RunTest | ( | ) |
Definition at line 77 of file editor_integration_test.cc.
References controller_, yaze::core::Controller::DoRender(), Initialize(), yaze::core::Controller::IsActive(), yaze::core::Controller::OnInput(), and Update().
|
inlinevirtual |
Definition at line 52 of file editor_integration_test.h.
Referenced by Initialize().
|
virtual |
Definition at line 99 of file editor_integration_test.cc.
Referenced by RunTest().
|
protected |
Definition at line 112 of file editor_integration_test.cc.
References test_rom_.
|
protected |
Definition at line 117 of file editor_integration_test.cc.
References yaze::Rom::SaveSettings::backup, yaze::Rom::SaveSettings::filename, yaze::Rom::SaveSettings::save_new, and test_rom_.
|
protected |
Definition at line 128 of file editor_integration_test.cc.
References yaze::editor::Editor::Initialize().
|
protected |
Definition at line 136 of file editor_integration_test.cc.
References yaze::editor::Editor::Load().
|
protected |
Definition at line 143 of file editor_integration_test.cc.
References yaze::editor::Editor::Save().
|
protected |
Definition at line 150 of file editor_integration_test.cc.
References yaze::editor::Editor::Update().
|
protected |
Definition at line 157 of file editor_integration_test.cc.
References yaze::editor::Editor::Cut().
|
protected |
Definition at line 164 of file editor_integration_test.cc.
References yaze::editor::Editor::Copy().
|
protected |
Definition at line 171 of file editor_integration_test.cc.
References yaze::editor::Editor::Paste().
|
protected |
Definition at line 178 of file editor_integration_test.cc.
References yaze::editor::Editor::Undo().
|
protected |
Definition at line 185 of file editor_integration_test.cc.
References yaze::editor::Editor::Redo().
|
protected |
Definition at line 192 of file editor_integration_test.cc.
References yaze::editor::Editor::Find().
|
protected |
Definition at line 199 of file editor_integration_test.cc.
References yaze::editor::Editor::Clear().
|
private |
Definition at line 78 of file editor_integration_test.h.
Referenced by Initialize(), and RunTest().
|
private |
Definition at line 83 of file editor_integration_test.h.
Referenced by LoadTestRom(), and SaveTestRom().
|
private |
Definition at line 84 of file editor_integration_test.h.
Referenced by Initialize().
|
private |
Definition at line 85 of file editor_integration_test.h.
Referenced by Initialize().