mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
56 lines
973 B
C++
56 lines
973 B
C++
|
|
#include "main.h"
|
|
#include <list>
|
|
|
|
std::list<Test*> gTests;
|
|
|
|
void fillTests()
|
|
{
|
|
gTests.push_back(new TestTasks());
|
|
gTests.push_back(new TestHash());
|
|
// gTests.push_back(new LoginTest());
|
|
}
|
|
|
|
int load() {
|
|
// init server config, init seed array
|
|
fillTests();
|
|
for (std::list<Test*>::iterator it = gTests.begin(); it != gTests.end(); it++)
|
|
{
|
|
if ((*it)->init()) printf("Fehler bei Init test: %s\n", (*it)->getName());
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
int run()
|
|
{
|
|
//printf("running tests\n");
|
|
printf("running tests\n");
|
|
for (std::list<Test*>::iterator it = gTests.begin(); it != gTests.end(); it++)
|
|
{
|
|
//printf("running: %s\n", it->getName());
|
|
printf("running test: %s", (*it)->getName());
|
|
if (!(*it)->test()) printf("success\n");
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
void ende()
|
|
{
|
|
for (std::list<Test*>::iterator it = gTests.begin(); it != gTests.end(); it++)
|
|
{
|
|
if (*it) {
|
|
delete *it;
|
|
}
|
|
|
|
}
|
|
gTests.clear();
|
|
}
|
|
|
|
|
|
int main(int argc, char** argv)
|
|
{
|
|
load();
|
|
run();
|
|
ende();
|
|
return 42;
|
|
} |