This repository has been archived by the owner on Feb 11, 2021. It is now read-only.
/
xml_logger.h
116 lines (104 loc) · 4.11 KB
1
2
3
4
5
#ifndef _XML_LOGGER_H
#define _XML_LOGGER_H
#include "logger.h"
6
7
8
9
10
11
/*!
* Prints out information about starting the test run in XML
*
* \param parameterCount How many parameters were given
* \param runnerParameters What parameters were given to the runner
* \param eventTime When the execution started
12
* \param data Any additional data logger needs
13
*/
14
void XMLRunStarted(int parameterCount, char *runnerParameters[], time_t eventTime, void *data);
15
16
17
18
19
20
21
22
/*!
* Prints out information about ending the test run in XML
*
* \param testCount How many tests were executed in total
* \param suiteCount How many suite were executed in total
* \param testPassCount How many tests passed in total
* \param testFailCount How many tests failed in total
23
* \param testSkippedCount How many tests were skipped in total
24
25
26
* \param endTime When the execution ended
* \param totalRuntime How long the execution took
*/
27
void XMLRunEnded(int testCount, int suiteCount, int testPassCount, int testFailCount,
28
int testSkippedCount, time_t endTime, double totalRuntime);
29
30
31
32
33
34
35
/*!
* Prints the data about the test suite that'll be executed next in XML
*
* \param suiteName Name of the test suite
* \param eventTime When the execution starts
*/
36
37
void XMLSuiteStarted(const char *suiteName, time_t eventTime);
38
39
40
41
42
43
44
45
46
/*!
* Prints information about the test suite that was just executed in XML
*
* \param testsPassed how many tests passed from this suite
* \param testsFailed how many tests failed from this suite
* \param testsSkipped how many tests were skipped (not implemented)
* \param endTime When the suite execution ended
* \param totalRuntime How long did the suite's execution take
*/
47
void XMLSuiteEnded(int testsPassed, int testsFailed, int testsSkipped,
48
time_t endTime, double totalRuntime);
49
50
51
52
53
54
55
/*!
* Prints the data about the test test that'll be executed next in XML
*
* \param testName Name of the test that'll be executed
* \param suiteName Name of the suite of the test
* \param testDescription Description of the test
56
* \param execKey Execution key for fuzzing
57
58
* \param startTime When the test started to execute
*/
59
60
void XMLTestStarted(const char *testName, const char *suiteName,
const char *testDescription, int execKey, time_t startTime);
61
62
63
64
65
66
67
68
69
70
/*!
* Prints information about the test test that was just executed in XML
*
* \param testName Name of the executed test
* \param suiteName Name of the suite of the test
* \param testResult Did the test fail (!= 0) or pass (== 0)
* \param endTime When the test execution ended
* \param totalRuntime Total runtime of the executed test
*/
71
void XMLTestEnded(const char *testName, const char *suiteName,
72
int testResult, time_t endTime, double totalRuntime);
73
74
75
76
77
78
79
80
81
/*!
* Prints information about plain assert in XML
*
* \param assertName Name of the assert
* \param assertResult Did assert fail (== 0) or success (!= 0)
* \param assertMessage Message of the assert
* \param eventTime When the assert happened
*/
82
void XMLAssert(const char *assertName, int assertResult, const char *assertMessage,
83
84
time_t eventTime);
85
86
87
88
89
90
91
92
93
94
/*!
* Prints information about assert that has actual and expected values in XML
*
* \param assertName Name of the assert
* \param assertResult Did assert fail (== 0) or success (!= 0)
* \param assertMessage Message of the assert
* \param actualValue Actual value of assert
* \param expected Excepted value of assert
* \param eventTime When the assert happened
*/
95
void XMLAssertWithValues(const char *assertName, int assertResult, const char *assertMessage,
96
int actualValue, int expected, time_t eventTime);
97
98
99
100
101
102
103
104
105
/*!
* Prints summary of all assertions of certain tests in XML
*
* \param numAsserts Total assert count for the executed test
* \param numAssertsFailed Count of failed asserts in the test
* \param numAssertsPass Count of passed asserts in the test
* \param eventTime Timestamp of the summary
*/
106
void XMLAssertSummary(int numAsserts, int numAssertsFailed, int numAssertsPass, time_t eventTime);
107
108
109
110
111
112
113
/*!
* Prints given message in XML
*
* \param logMessage Message to be logged
* \param eventTime Timestamp for log message
*/
114
void XMLLog(time_t eventTime, char *fmt, ...);
115
116
#endif