Files
decaf-emu/tools/hardware-test/main.cpp

38 lines
839 B
C++
Raw Normal View History

2016-06-05 04:09:13 -07:00
#include <memory>
#include <spdlog/spdlog.h>
#include "hardwaretests.h"
2016-06-14 01:17:31 +01:00
#include "libcpu/cpu.h"
#include "libcpu/mem.h"
#include "common/decaf_assert.h"
2016-06-05 04:09:13 -07:00
std::shared_ptr<spdlog::logger>
gLog;
static int runResult;
2016-06-05 04:09:13 -07:00
int main(int argc, char *argv[])
{
gLog = std::make_shared<spdlog::logger>("logger", std::make_shared<spdlog::sinks::stdout_sink_st>());
gLog->set_level(spdlog::level::debug);
mem::initialise();
cpu::initialise();
cpu::setJitMode(cpu::jit_mode::enabled);
2016-06-14 01:17:31 +01:00
// We need to run the tests on a core.
2016-06-12 15:35:31 +01:00
cpu::setCoreEntrypointHandler(
[]() {
if (cpu::this_core::id() == 1) {
// Run the tests on only a single core.
runResult = hwtest::runTests("tests/cpu/wiiu") ? 0 : 1;
}
});
cpu::start();
cpu::join();
2016-06-12 15:35:31 +01:00
2016-06-05 04:09:13 -07:00
system("PAUSE");
return runResult;
2016-06-05 04:09:13 -07:00
}