test(rom): add role-based ROM selection
This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "framework/headless_editor_test.h"
|
||||
#include "app/editor/overworld/overworld_editor.h"
|
||||
#include "rom/rom.h"
|
||||
#include "rom/snes.h"
|
||||
#include "gtest/gtest.h"
|
||||
#include "test/test_utils.h"
|
||||
#include "zelda3/game_data.h"
|
||||
|
||||
namespace yaze {
|
||||
@@ -16,16 +19,11 @@ class OverworldEditorTest : public HeadlessEditorTest {
|
||||
HeadlessEditorTest::SetUp();
|
||||
|
||||
// Load ROM
|
||||
const char* paths[] = {"assets/zelda3.sfc", "build/bin/zelda3.sfc", "zelda3.sfc"};
|
||||
bool loaded = false;
|
||||
for (const char* path : paths) {
|
||||
rom_ = std::make_unique<Rom>();
|
||||
if (rom_->LoadFromFile(path).ok()) {
|
||||
loaded = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
ASSERT_TRUE(loaded) << "Could not load zelda3.sfc from any location";
|
||||
TestRomManager::SkipIfRomMissing(RomRole::kVanilla, "OverworldEditorTest");
|
||||
const std::string rom_path = TestRomManager::GetRomPath(RomRole::kVanilla);
|
||||
rom_ = std::make_unique<Rom>();
|
||||
ASSERT_TRUE(rom_->LoadFromFile(rom_path).ok())
|
||||
<< "Could not load ROM from " << rom_path;
|
||||
|
||||
// Load GameData
|
||||
game_data_ = std::make_unique<zelda3::GameData>(rom_.get());
|
||||
|
||||
Reference in New Issue
Block a user