- Added conditional compilation for ImGui test engine features in `test_utils.cc` and `test_utils.h`, enabling the loading of ROMs and opening of editors only when the YAZE_ENABLE_IMGUI_TEST_ENGINE flag is set. - Improved modularity by managing includes based on feature flags, enhancing the flexibility of the testing framework. Benefits: - Streamlined testing process for ImGui-related functionalities. - Enhanced code organization by isolating ImGui test engine dependencies.
24 lines
608 B
C++
24 lines
608 B
C++
#include "test_utils.h"
|
|
#include "app/core/controller.h"
|
|
|
|
namespace yaze {
|
|
namespace test {
|
|
namespace gui {
|
|
|
|
void LoadRomInTest(ImGuiTestContext* ctx, const std::string& rom_path) {
|
|
#ifdef YAZE_ENABLE_IMGUI_TEST_ENGINE
|
|
yaze::core::Controller* controller = (yaze::core::Controller*)ctx->Test->UserData;
|
|
controller->OnEntry(rom_path);
|
|
#endif
|
|
}
|
|
|
|
void OpenEditorInTest(ImGuiTestContext* ctx, const std::string& editor_name) {
|
|
#ifdef YAZE_ENABLE_IMGUI_TEST_ENGINE
|
|
ctx->MenuClick(absl::StrFormat("Editors/%s", editor_name).c_str());
|
|
#endif
|
|
}
|
|
|
|
} // namespace gui
|
|
} // namespace test
|
|
} // namespace yaze
|