3#include "host/KSystem.hh"
4#include "host/Option.hh"
6#include <egg/core/SceneManager.hh>
7#include <egg/math/Quat.hh>
9#include <game/system/RaceConfig.hh>
24 static void DestroyInstance();
63 template <IntegralType T>
64 void checkDesync(
const T &t0,
const T &t1,
const char *name) {
71 m_currentFrame, m_frameCount);
74 REPORT(
"DESYNC! Name: %s", name);
75 REPORT(
"Expected: %d", t0);
76 REPORT(
"Observed: %d", t1);
82 void checkDesync(
const T &t0,
const T &t1,
const char *name) {
87 m_sceneMgr->currentScene()->heap()->enableAllocation();
91 m_currentFrame, m_frameCount);
94 REPORT(
"DESYNC! Name: %s", name);
97 REPORT(
"Expected: %s", s0.c_str());
98 REPORT(
"Observed: %s", s1.c_str());
100 m_sceneMgr->currentScene()->heap()->disableAllocation();
105 void checkDesync(
const f32 &t0,
const f32 &t1,
const char *name) {
110 m_sceneMgr->currentScene()->heap()->enableAllocation();
114 m_currentFrame, m_frameCount);
117 REPORT(
"DESYNC! Name: %s", name);
118 std::string s0 = std::to_string(t0);
119 std::string s1 = std::to_string(t1);
120 REPORT(
"Expected: 0x%08X | %s", f2u(t0), s0.c_str());
121 REPORT(
"Observed: 0x%08X | %s", f2u(t1), s1.c_str());
123 m_sceneMgr->currentScene()->heap()->disableAllocation();
142 static void OnInit(System::RaceConfig *config,
void *arg);
144 EGG::SceneManager *m_sceneMgr;
145 EGG::RamStream m_stream;
146 std::queue<TestCase> m_testCases;
Base interface for a Kinoko system.
Kinoko system designed to execute tests.
bool popTestCase()
Pops the current test case and frees the KRKG buffer.
Host::EOption m_testMode
Differentiates between test suite and ghost+krkg.
bool run() override
Executes a run.
TestData findCurrentFrameEntry()
Finds the test data of the current frame.
void parseOptions(int argc, char **argv) override
Parses non-generic command line options.
void startNextTestCase()
Starts the next test case.
void writeTestOutput() const
Writes details about the current test to file.
bool calcTest()
Checks one frame in the test.
const TestCase & getCurrentTestCase() const
Gets the current test case.
void testFrame(const TestData &data)
Tests the frame against the provided test data.
bool runTest()
Runs a single test case, and ends when the test is finished or when a desync is found.
static void OnInit(System::RaceConfig *config, void *arg)
Initializes the race configuration as needed for test cases.
void calc() override
Executes a frame.
void init() override
Initializes the system.
A quaternion, used to represent 3D rotation.