Files
decaf-emu/tests/cpu/runner-generated/main.cpp

38 lines
938 B
C++
Raw Normal View History

2016-06-05 04:09:13 -07:00
#include "hardwaretests.h"
2017-04-20 13:45:01 +01:00
2017-02-27 23:34:16 +00:00
#include <common/decaf_assert.h>
#include <common/log.h>
2017-04-20 13:45:01 +01:00
#include <libcpu/cpu.h>
#include <libcpu/cpu_config.h>
2017-04-20 13:45:01 +01:00
#include <libcpu/mem.h>
#include <memory>
#include <spdlog/spdlog.h>
#include <spdlog/sinks/stdout_sinks.h>
2016-06-05 04:09:13 -07:00
static int runResult;
2016-06-05 04:09:13 -07:00
int main(int argc, char *argv[])
{
auto logger = std::make_shared<spdlog::logger>("logger", std::make_shared<spdlog::sinks::stdout_sink_st>());
logger->set_level(spdlog::level::debug);
gLog = logger;
2016-06-05 04:09:13 -07:00
auto cpuConfig = cpu::Settings { };
cpuConfig.jit.enabled = true;
cpu::setConfig(cpuConfig);
2016-06-05 04:09:13 -07:00
cpu::initialise();
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(
[](cpu::Core *core) {
2016-06-12 15:35:31 +01:00
if (cpu::this_core::id() == 1) {
// Run the tests on only a single core.
2017-04-21 14:45:23 +01:00
runResult = hwtest::runTests("data/wiiu");
2016-06-12 15:35:31 +01:00
}
});
cpu::start();
cpu::join();
return runResult;
2016-06-05 04:09:13 -07:00
}