-
Notifications
You must be signed in to change notification settings - Fork 0
/
testFramework.c
53 lines (43 loc) · 943 Bytes
/
testFramework.c
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
53
#include <stdio.h>
#include <stdlib.h>
#include "testFramework.h"
#include "Globals.h"
#include "brofiler/Brofiler.h"
#pragma comment(lib, "brofiler/ProfilerCore32.lib")
int num_of_tests = 1000000;
int callTest(UNITTEST *test)
{
return (*test).test();
};
int callTestSuite(UNITTESTSUITE suite)
{
int rc = 1;
UNITTEST* test = suite.tests;
if (suite.setup)
(suite.setup());
for (int i = 0; i < num_of_tests; ++i){
BROFILER_FRAME("Main");
test = suite.tests;
while (test->test != 0)
{
//BROFILER_FRAME("Test");
if (callTest(test++))
{
printf(".");
}
else
{
printf("#");
rc = 0;
}
}
}
if (suite.teardown)
(suite.teardown());
return rc;
}
void testFailed(const char* testName, const int testLine, const char* message)
{
//fprintf(stderr, "%s(%i): ERROR test failed, %s\n", testName, testLine, message);
//OWN_LOG("%s(%i): ERROR test failed, %s\n", testName, testLine, message);
};