-
Notifications
You must be signed in to change notification settings - Fork 0
/
Entry.cpp
52 lines (49 loc) · 837 Bytes
/
Entry.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifdef WIN32
#include <time.h>
#endif
#include <apollo/Apollo.h>
struct _automatic_terminator
{
_automatic_terminator () { Init(); }
~_automatic_terminator () { Shutdown(); }
};
int main ( int argc, char** argv )
{
srand(time(NULL));
_automatic_terminator at;
SDL_Init(SDL_INIT_TIMER);
#ifndef NDEBUG
if (argc > 1)
{
assert(!strcmp(argv[1], "-test"));
assert(argc > 2);
std::string test = argv[2];
std::vector<std::string> testParameters;
if (argc > 3)
{
for (int i = 3; i < argc; i++)
{
testParameters.push_back(std::string(argv[i]));
}
}
bool testReturnCode = TestHarness::InvokeTest ( test, testParameters );
if (testReturnCode)
{
return 0;
}
else
{
return -1;
}
}
#else
if (0)
{
}
#endif
else
{
MainLoop();
}
return 0;
}