#include <KTestSystem.hh>
Kinoko system designed to execute tests.
Definition at line 17 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, std::deque< TestCase, EGG::Allocator< 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 251 of file KTestSystem.cc.
|
overrideprivate |
Definition at line 253 of file KTestSystem.cc.
|
overridevirtual |
|
private |
Checks one frame in the test.
Definition at line 308 of file KTestSystem.cc.
|
inlineprivate |
Definition at line 109 of file KTestSystem.hh.
|
inlineprivate |
Definition at line 86 of file KTestSystem.hh.
|
inlineprivate |
Definition at line 68 of file KTestSystem.hh.
|
static |
Definition at line 238 of file KTestSystem.cc.
|
static |
Definition at line 244 of file KTestSystem.cc.
|
private |
Finds the test data of the current frame.
Definition at line 327 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 460 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 52 of file KTestSystem.cc.
|
inlinestatic |
Definition at line 27 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 468 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 140 of file KTestSystem.cc.
|
private |
Pops the current test case and frees the KRKG buffer.
Definition at line 298 of file KTestSystem.cc.
|
overridevirtual |
Executes a run.
A run consists of iterating over all tests.
Implements Kinoko::KSystem.
Definition at line 117 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 435 of file KTestSystem.cc.
|
private |
Starts the next test case.
Definition at line 261 of file KTestSystem.cc.
|
private |
Tests the frame against the provided test data.
| data | The test data to compare against. |
Definition at line 388 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 449 of file KTestSystem.cc.
|
private |
Definition at line 156 of file KTestSystem.hh.
|
private |
Definition at line 155 of file KTestSystem.hh.
|
private |
Definition at line 148 of file KTestSystem.hh.
|
private |
Definition at line 149 of file KTestSystem.hh.
|
private |
Definition at line 157 of file KTestSystem.hh.
|
private |
Definition at line 150 of file KTestSystem.hh.
|
private |
Differentiates between test suite and ghost+krkg.
Definition at line 151 of file KTestSystem.hh.
|
private |
Definition at line 153 of file KTestSystem.hh.
|
private |
Definition at line 154 of file KTestSystem.hh.