Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Latest commit

 

History

History
63 lines (49 loc) · 1.31 KB

plain_logger.c

File metadata and controls

63 lines (49 loc) · 1.31 KB
 
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
54
55
56
57
58
59
60
61
62
63
#ifndef _PLAIN_LOGGER
#define _PLAIN_LOGGER
#include <stdio.h>
#include "plain_logger.h"
LogOutputFp logger = 0;
void
PlainRunStarted(LogOutputFp outputFn, const char *runnerParameters, time_t eventTime)
{
logger = outputFn;
}
void
PlainRunEnded(time_t endTime, time_t totalRuntime)
{
// \todo add total number of tests, suites, pass/failure test count
}
void
PlainSuiteStarted(const char *suiteName, time_t eventTime)
{
printf("Executing tests in %s\n", suiteName);
}
void
PlainSuiteEnded(int testsPassed, int testsFailed, int testsSkipped,
double endTime, time_t totalRuntime)
{
printf("Suite executed. %d passed, %d failed and %d skipped\n", testsPassed, testsFailed, testsSkipped);
}
void
PlainTestStarted(const char *testName, const char *testDescription, time_t startTime)
{
}
void
PlainTestEnded(const char *testName, const char *testDescription,
int testResult, int numAsserts, time_t endTime, time_t totalRuntime)
{
printf("Asserts:%d\n", numAsserts);
printf("%s: ok\n", testName);
}
void
PlainAssert(const char *assertName, int assertResult, const char *assertMessage,
time_t eventTime)
{
const char *result = (assertResult) ? "passed" : "failed";
printf("%s %s: %s\n", assertName, assertResult, assertMessage);
}
void
PlainLog(const char *logMessage, time_t eventTime)
{
}
#endif