Speeding up PPC tests significantly.
This commit is contained in:
parent
6c59881eee
commit
ca8d658ffe
|
@ -176,10 +176,6 @@ class TestRunner {
|
||||||
memory_size = 64 * 1024 * 1024;
|
memory_size = 64 * 1024 * 1024;
|
||||||
memory.reset(new Memory());
|
memory.reset(new Memory());
|
||||||
memory->Initialize();
|
memory->Initialize();
|
||||||
|
|
||||||
processor.reset(new Processor(memory.get(), nullptr, nullptr));
|
|
||||||
processor->Setup();
|
|
||||||
processor->set_debug_info_flags(DebugInfoFlags::kDebugInfoAll);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~TestRunner() {
|
~TestRunner() {
|
||||||
|
@ -189,6 +185,14 @@ class TestRunner {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Setup(TestSuite& suite) {
|
bool Setup(TestSuite& suite) {
|
||||||
|
// Reset memory.
|
||||||
|
memory->Reset();
|
||||||
|
|
||||||
|
// Setup a fresh processor.
|
||||||
|
processor.reset(new Processor(memory.get(), nullptr, nullptr));
|
||||||
|
processor->Setup();
|
||||||
|
processor->set_debug_info_flags(DebugInfoFlags::kDebugInfoAll);
|
||||||
|
|
||||||
// Load the binary module.
|
// Load the binary module.
|
||||||
auto module = std::make_unique<xe::cpu::RawModule>(processor.get());
|
auto module = std::make_unique<xe::cpu::RawModule>(processor.get());
|
||||||
if (!module->LoadFile(START_ADDRESS, suite.bin_file_path)) {
|
if (!module->LoadFile(START_ADDRESS, suite.bin_file_path)) {
|
||||||
|
@ -417,12 +421,12 @@ bool RunTests(const std::wstring& test_name) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TestRunner runner;
|
||||||
for (auto& test_suite : test_suites) {
|
for (auto& test_suite : test_suites) {
|
||||||
XELOGI("%ls.s:", test_suite.name.c_str());
|
XELOGI("%ls.s:", test_suite.name.c_str());
|
||||||
|
|
||||||
for (auto& test_case : test_suite.test_cases) {
|
for (auto& test_case : test_suite.test_cases) {
|
||||||
XELOGI(" - %s", test_case.name.c_str());
|
XELOGI(" - %s", test_case.name.c_str());
|
||||||
TestRunner runner;
|
|
||||||
ProtectedRunTest(test_suite, runner, test_case, failed_count,
|
ProtectedRunTest(test_suite, runner, test_case, failed_count,
|
||||||
passed_count);
|
passed_count);
|
||||||
}
|
}
|
||||||
|
|
|
@ -270,6 +270,10 @@ void Memory::UnmapViews() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Memory::Reset() {
|
||||||
|
// TODO(benvanik): zero memory, free all heap page tables, etc.
|
||||||
|
}
|
||||||
|
|
||||||
BaseHeap* Memory::LookupHeap(uint32_t address) {
|
BaseHeap* Memory::LookupHeap(uint32_t address) {
|
||||||
if (address < 0x40000000) {
|
if (address < 0x40000000) {
|
||||||
return &heaps_.v00000000;
|
return &heaps_.v00000000;
|
||||||
|
|
|
@ -226,6 +226,9 @@ class Memory {
|
||||||
// mapping to the file system fails.
|
// mapping to the file system fails.
|
||||||
bool Initialize();
|
bool Initialize();
|
||||||
|
|
||||||
|
// Resets all memory to zero and resets all allocations.
|
||||||
|
void Reset();
|
||||||
|
|
||||||
// Full file name and path of the memory-mapped file backing all memory.
|
// Full file name and path of the memory-mapped file backing all memory.
|
||||||
const std::wstring& file_name() const { return file_name_; }
|
const std::wstring& file_name() const { return file_name_; }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue