Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
We need cmake 2.8 to compile simgrid
[simgrid.git] / win32_test_app / src / Test.c
1
2 #pragma hdrstop
3
4 #include <TTestRunner.h>
5
6 TestRunner_t test_runner = NULL;
7
8 void terminate(void);
9
10 #pragma argsused
11
12 int main(int argc, char *argv[])
13 {
14   errno_t e;
15   initializeErrno();
16
17   /* Create a test runner. */
18   test_runner = TestRunner_new();
19
20   if (NULL == test_runner)
21     terminate();
22
23   /* Initialize the test runner. */
24   if (E_SUCCESS != TestRunner_initialize(test_runner, argc, argv))
25     terminate();
26
27   /* Launch the test runner. */
28   TestRunner_run(test_runner);
29
30   e = getErrno();
31
32   terminate();
33
34   return e;
35 }
36
37
38 void terminate(void)
39 {
40   errno_t e = getErrno();
41
42   if (NULL != test_runner)
43     TestRunner_free(test_runner);
44
45   printf("\n Program terminated with the exit code : %3d (%s)\n",
46          getErrno(), __errlist[getErrno()]);
47
48   terminateErrno();
49
50   exit(e);
51 }