Add basic unit test support
Add class that can automatically perform defined tests on user request. Developers that wish to implemet unit tests for some functionality must extend that class (`TestCase`) and add it to the manifest, so that Acedia can read, register and later use it to perform tests.
This commit is contained in:
parent
427d6fea58
commit
a4a1c21cd7
3 changed files with 264 additions and 0 deletions
|
|
@ -31,6 +31,9 @@ var private Acedia selfReference;
|
|||
// Array of predefined services that must be started along with Acedia mutator.
|
||||
var private array< class<Service> > systemServices;
|
||||
|
||||
// All unit tests loaded from all packages.
|
||||
var private array< class<TestCase> > testCases;
|
||||
|
||||
static public final function Acedia GetInstance()
|
||||
{
|
||||
return default.selfReference;
|
||||
|
|
@ -69,6 +72,12 @@ private final function LoadManifest(class<Manifest> manifestClass)
|
|||
manifestClass.default.features[i].static.EnableMe();
|
||||
}
|
||||
}
|
||||
// Load unit tests
|
||||
for (i = 0; i < manifestClass.default.testCases.length; i += 1)
|
||||
{
|
||||
if (manifestClass.default.testCases[i] == none) continue;
|
||||
testCases[testCases.length] = manifestClass.default.testCases[i];
|
||||
}
|
||||
}
|
||||
|
||||
private final function LaunchServices()
|
||||
|
|
|
|||
Reference in a new issue