#include <KTestSystem.hh>
Kinoko system designed to execute tests.
Definition at line 16 of file KTestSystem.hh.
Classes | |
| struct | TestCase |
| struct | TestData |
Public Member Functions | |
| void | init () override |
| Initializes the system. | |
| void | calc () override |
| Executes a frame. | |
| bool | run () override |
| Executes a run. | |
| void | parseOptions (int argc, char **argv) override |
| Parses non-generic command line options. | |
Static Public Member Functions | |
| static KTestSystem * | CreateInstance () |
| static void | DestroyInstance () |
| static KTestSystem * | Instance () |
Private Member Functions | |
| KTestSystem (const KTestSystem &)=delete | |
| KTestSystem (KTestSystem &&)=delete | |
| template<IntegralType T> | |
| void | checkDesync (const T &t0, const T &t1, const char *name) |
| template<typename T> | |
| void | checkDesync (const T &t0, const T &t1, const char *name) |
| void | checkDesync (const f32 &t0, const f32 &t1, const char *name) |
| void | initSuite () |
| void | startNextTestCase () |
| Starts the next test case. | |
| bool | popTestCase () |
| Pops the current test case and frees the KRKG buffer. | |
| bool | calcTest () |
| Checks one frame in the test. | |
| TestData | findCurrentFrameEntry () |
| Finds the test data of the current frame. | |
| 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. | |
| void | writeTestOutput () const |
| Writes details about the current test to file. | |
| const TestCase & | getCurrentTestCase () const |
| Gets the current test case. | |
Static Private Member Functions | |
| static void | OnInit (System::RaceConfig *config, void *arg) |
| Initializes the race configuration as needed for test cases. | |
Private Attributes | |
| EGG::SceneManager * | m_sceneMgr |
| EGG::RamStream | m_stream |
| std::queue< TestCase > | m_testCases |
| Host::EOption | m_testMode |
| Differentiates between test suite and ghost+krkg. | |
| u16 | m_versionMajor |
| u16 | m_versionMinor |
| u16 | m_frameCount |
| u16 | m_currentFrame |
| bool | m_sync |
Additional Inherited Members | |
| Static Protected Attributes inherited from Kinoko::KSystem | |
| static KSystem * | s_instance = nullptr |
|
private |
Definition at line 249 of file KTestSystem.cc.
|
overrideprivate |
Definition at line 251 of file KTestSystem.cc.
|
overridevirtual |
|
private |
Checks one frame in the test.
Definition at line 306 of file KTestSystem.cc.
|
inlineprivate |
Definition at line 105 of file KTestSystem.hh.
|
inlineprivate |
Definition at line 82 of file KTestSystem.hh.
|
inlineprivate |
Definition at line 64 of file KTestSystem.hh.
|
static |
Definition at line 236 of file KTestSystem.cc.
|
static |
Definition at line 242 of file KTestSystem.cc.
|
private |
Finds the test data of the current frame.
Definition at line 325 of file KTestSystem.cc.
|
private |
Gets the current test case.
In the event that there is no active test case, this gets the next test case.
Definition at line 458 of file KTestSystem.cc.
|
overridevirtual |
|
private |
This reads over the KRKG and generates the list of test cases, before starting the first test case and initializing the race scene.
Definition at line 50 of file KTestSystem.cc.
|
inlinestatic |
Definition at line 26 of file KTestSystem.hh.
|
staticprivate |
Initializes the race configuration as needed for test cases.
| config | The race configuration instance. |
| arg | Unused optional argument. |
Definition at line 466 of file KTestSystem.cc.
|
overridevirtual |
Parses non-generic command line options.
Test mode currently accepts either a suite of tests or a RKG + KRKG.
| argc | The number of arguments. |
| argv | The arguments. |
Implements Kinoko::KSystem.
Definition at line 138 of file KTestSystem.cc.
|
private |
Pops the current test case and frees the KRKG buffer.
Definition at line 296 of file KTestSystem.cc.
|
overridevirtual |
Executes a run.
A run consists of iterating over all tests.
Implements Kinoko::KSystem.
Definition at line 115 of file KTestSystem.cc.
|
private |
Runs a single test case, and ends when the test is finished or when a desync is found.
This will also accumulate results in results.txt.
Definition at line 433 of file KTestSystem.cc.
|
private |
Starts the next test case.
Definition at line 259 of file KTestSystem.cc.
|
private |
Tests the frame against the provided test data.
| data | The test data to compare against. |
Definition at line 386 of file KTestSystem.cc.
|
private |
Writes details about the current test to file.
This is designed to be cumulative across multiple tests.
Definition at line 447 of file KTestSystem.cc.
|
private |
Definition at line 152 of file KTestSystem.hh.
|
private |
Definition at line 151 of file KTestSystem.hh.
|
private |
Definition at line 144 of file KTestSystem.hh.
|
private |
Definition at line 145 of file KTestSystem.hh.
|
private |
Definition at line 153 of file KTestSystem.hh.
|
private |
Definition at line 146 of file KTestSystem.hh.
|
private |
Differentiates between test suite and ghost+krkg.
Definition at line 147 of file KTestSystem.hh.
|
private |
Definition at line 149 of file KTestSystem.hh.
|
private |
Definition at line 150 of file KTestSystem.hh.