#include <KTestSystem.hh>
Kinoko system designed to execute tests.
Definition at line 14 of file KTestSystem.hh.
|
| 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.
|
| |
◆ KTestSystem()
| KTestSystem::KTestSystem |
( |
| ) |
|
|
private |
◆ ~KTestSystem()
| KTestSystem::~KTestSystem |
( |
| ) |
|
|
overrideprivate |
◆ calc()
| void KTestSystem::calc |
( |
| ) |
|
|
overridevirtual |
◆ calcTest()
| bool KTestSystem::calcTest |
( |
| ) |
|
|
private |
Checks one frame in the test.
- Returns
- Whether the test can continue.
Definition at line 276 of file KTestSystem.cc.
◆ checkDesync() [1/3]
| void KTestSystem::checkDesync |
( |
const f32 & | t0, |
|
|
const f32 & | t1, |
|
|
const char * | name ) |
|
inlineprivate |
◆ checkDesync() [2/3]
| void KTestSystem::checkDesync |
( |
const T & | t0, |
|
|
const T & | t1, |
|
|
const char * | name ) |
|
inlineprivate |
◆ checkDesync() [3/3]
template<typename T >
| void KTestSystem::checkDesync |
( |
const T & | t0, |
|
|
const T & | t1, |
|
|
const char * | name ) |
|
inlineprivate |
◆ CreateInstance()
◆ DestroyInstance()
| void KTestSystem::DestroyInstance |
( |
| ) |
|
|
static |
◆ findCurrentFrameEntry()
Finds the test data of the current frame.
- Returns
- The test data of the current frame.
Definition at line 295 of file KTestSystem.cc.
◆ getCurrentTestCase()
Gets the current test case.
In the event that there is no active test case, this gets the next test case.
- Returns
- The current test case.
Definition at line 428 of file KTestSystem.cc.
◆ init()
| void KTestSystem::init |
( |
| ) |
|
|
overridevirtual |
◆ initSuite()
| void KTestSystem::initSuite |
( |
| ) |
|
|
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 48 of file KTestSystem.cc.
◆ Instance()
◆ OnInit()
Initializes the race configuration as needed for test cases.
- Parameters
-
| config | The race configuration instance. |
| arg | Unused optional argument. |
Definition at line 436 of file KTestSystem.cc.
◆ parseOptions()
| void KTestSystem::parseOptions |
( |
int | argc, |
|
|
char ** | argv ) |
|
overridevirtual |
Parses non-generic command line options.
Test mode currently accepts either a suite of tests or a RKG + KRKG.
- Parameters
-
| argc | The number of arguments. |
| argv | The arguments. |
Implements KSystem.
Definition at line 136 of file KTestSystem.cc.
◆ popTestCase()
| bool KTestSystem::popTestCase |
( |
| ) |
|
|
private |
Pops the current test case and frees the KRKG buffer.
- Returns
- Whether the queue still has elements remaining.
Definition at line 266 of file KTestSystem.cc.
◆ run()
| bool KTestSystem::run |
( |
| ) |
|
|
overridevirtual |
Executes a run.
A run consists of iterating over all tests.
- Returns
- Whether the run was successful or not.
Implements KSystem.
Definition at line 113 of file KTestSystem.cc.
◆ runTest()
| bool KTestSystem::runTest |
( |
| ) |
|
|
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.
- Returns
- Whether the run synchronized or desynchronized.
Definition at line 403 of file KTestSystem.cc.
◆ startNextTestCase()
| void KTestSystem::startNextTestCase |
( |
| ) |
|
|
private |
◆ testFrame()
| void KTestSystem::testFrame |
( |
const TestData & | data | ) |
|
|
private |
Tests the frame against the provided test data.
- Parameters
-
| data | The test data to compare against. |
Definition at line 356 of file KTestSystem.cc.
◆ writeTestOutput()
| void KTestSystem::writeTestOutput |
( |
| ) |
const |
|
private |
Writes details about the current test to file.
This is designed to be cumulative across multiple tests.
Definition at line 417 of file KTestSystem.cc.
◆ m_currentFrame
| u16 KTestSystem::m_currentFrame |
|
private |
◆ m_frameCount
| u16 KTestSystem::m_frameCount |
|
private |
◆ m_sceneMgr
◆ m_stream
◆ m_sync
◆ m_testCases
| std::queue<TestCase> KTestSystem::m_testCases |
|
private |
◆ m_testMode
| Host::EOption KTestSystem::m_testMode |
|
private |
Differentiates between test suite and ghost+krkg.
Definition at line 145 of file KTestSystem.hh.
◆ m_versionMajor
| u16 KTestSystem::m_versionMajor |
|
private |
◆ m_versionMinor
| u16 KTestSystem::m_versionMinor |
|
private |