test(rom): add role-based ROM selection

This commit is contained in:
scawful
2025-12-22 14:49:04 -05:00
parent df866b3f7f
commit 42ae359abc
30 changed files with 488 additions and 265 deletions

View File

@@ -7,6 +7,7 @@
#include "app/editor/dungeon/dungeon_editor_v2.h"
#include "rom/rom.h"
#include "gtest/gtest.h"
#include "test/test_utils.h"
#include "zelda3/dungeon/room.h"
#include "zelda3/game_data.h"
@@ -21,16 +22,12 @@ namespace test {
class DungeonEditorIntegrationTest : public ::testing::Test {
protected:
void SetUp() override {
// Use the real ROM (try multiple locations)
TestRomManager::SkipIfRomMissing(RomRole::kVanilla,
"DungeonEditorIntegrationTest");
rom_ = std::make_unique<Rom>();
auto status = rom_->LoadFromFile("assets/zelda3.sfc");
if (!status.ok()) {
status = rom_->LoadFromFile("build/bin/zelda3.sfc");
}
if (!status.ok()) {
status = rom_->LoadFromFile("zelda3.sfc");
}
ASSERT_TRUE(status.ok()) << "Could not load zelda3.sfc from any location";
const std::string rom_path = TestRomManager::GetRomPath(RomRole::kVanilla);
auto status = rom_->LoadFromFile(rom_path);
ASSERT_TRUE(status.ok()) << "Could not load ROM from " << rom_path;
// Load Zelda3-specific game data
game_data_ = std::make_unique<zelda3::GameData>(rom_.get());