2011-08-06 18:55:33 +03:00
|
|
|
/*
|
|
|
|
Copyright (C) 2011 Markus Kauppila <markus.kauppila@gmail.com>
|
|
|
|
|
|
|
|
This software is provided 'as-is', without any express or implied
|
|
|
|
warranty. In no event will the authors be held liable for any damages
|
|
|
|
arising from the use of this software.
|
|
|
|
|
|
|
|
Permission is granted to anyone to use this software for any purpose,
|
|
|
|
including commercial applications, and to alter it and redistribute it
|
|
|
|
freely, subject to the following restrictions:
|
|
|
|
|
|
|
|
1. The origin of this software must not be misrepresented; you must not
|
|
|
|
claim that you wrote the original software. If you use this software
|
|
|
|
in a product, an acknowledgment in the product documentation would be
|
|
|
|
appreciated but is not required.
|
|
|
|
2. Altered source versions must be plainly marked as such, and must not be
|
|
|
|
misrepresented as being the original software.
|
|
|
|
3. This notice may not be removed or altered from any source distribution.
|
|
|
|
*/
|
|
|
|
|
2011-06-21 22:04:44 +03:00
|
|
|
#ifndef _PLAIN_LOGGER_H
|
|
|
|
#define _PLAIN_LOGGER_H
|
|
|
|
|
2011-08-02 12:46:40 +03:00
|
|
|
#include <SDL/SDL_stdinc.h>
|
2011-08-06 17:35:58 +03:00
|
|
|
#include "../runner/logger.h"
|
2011-08-02 12:46:40 +03:00
|
|
|
|
2011-06-21 22:04:44 +03:00
|
|
|
|
2011-06-27 23:10:13 +03:00
|
|
|
/*!
|
|
|
|
* Prints out information about starting the test run.
|
|
|
|
*
|
|
|
|
* \param parameterCount How many parameters were given
|
|
|
|
* \param runnerParameters What parameters were given to the runner
|
2011-07-25 19:33:32 +03:00
|
|
|
* \param runSeed Fuzzer seed of the harness
|
2011-06-27 23:10:13 +03:00
|
|
|
* \param eventTime When the execution started
|
2011-07-27 17:48:07 +03:00
|
|
|
* \param loggerData LoggerData structure which contains data for the logger
|
2011-06-30 17:11:39 +03:00
|
|
|
*
|
2011-06-27 23:10:13 +03:00
|
|
|
*/
|
2011-07-25 19:33:32 +03:00
|
|
|
void PlainRunStarted(int parameterCount, char *runnerParameters[], char *runSeed,
|
2011-07-27 17:48:07 +03:00
|
|
|
time_t eventTime, LoggerData *data);
|
2011-06-21 22:04:44 +03:00
|
|
|
|
2011-06-27 23:10:13 +03:00
|
|
|
/*!
|
|
|
|
* Prints out information about ending the test run.
|
|
|
|
*
|
|
|
|
* \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
|
2011-07-14 21:04:31 +03:00
|
|
|
* \param testSkippedCount How many tests were skipped in total
|
2011-06-27 23:10:13 +03:00
|
|
|
* \param testFailCount How many tests failed in total
|
|
|
|
* \param endTime When the execution ended
|
|
|
|
* \param totalRuntime How long the execution took
|
|
|
|
*/
|
2011-06-22 17:41:37 +03:00
|
|
|
void PlainRunEnded(int testCount, int suiteCount, int testPassCount, int testFailCount,
|
2011-07-11 21:09:28 +03:00
|
|
|
int testSkippedCount, time_t endTime, double totalRuntime);
|
2011-06-21 22:04:44 +03:00
|
|
|
|
2011-06-27 23:10:13 +03:00
|
|
|
/*!
|
|
|
|
* Prints the data about the test suite that'll be executed next
|
|
|
|
*
|
|
|
|
* \param suiteName Name of the test suite
|
|
|
|
* \param eventTime When the execution starts
|
|
|
|
*/
|
2011-06-21 22:04:44 +03:00
|
|
|
void PlainSuiteStarted(const char *suiteName, time_t eventTime);
|
|
|
|
|
2011-06-27 23:10:13 +03:00
|
|
|
/*!
|
|
|
|
* Prints information about the test suite that was just executed
|
|
|
|
*
|
|
|
|
* \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
|
|
|
|
*/
|
2011-06-21 22:04:44 +03:00
|
|
|
void PlainSuiteEnded(int testsPassed, int testsFailed, int testsSkipped,
|
2011-06-27 21:41:34 +03:00
|
|
|
time_t endTime, double totalRuntime);
|
2011-06-21 22:04:44 +03:00
|
|
|
|
2011-06-27 23:10:13 +03:00
|
|
|
/*!
|
|
|
|
* Prints the data about the test test that'll be executed next
|
|
|
|
*
|
|
|
|
* \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
|
2011-07-24 18:21:53 +03:00
|
|
|
* \param execKey Execution key for fuzzing
|
2011-06-27 23:10:13 +03:00
|
|
|
* \param startTime When the test started to execute
|
|
|
|
*/
|
2011-06-22 17:41:37 +03:00
|
|
|
void PlainTestStarted(const char *testName, const char *suiteName,
|
2011-08-02 12:46:40 +03:00
|
|
|
const char *testDescription, Uint64 execKey, time_t startTime);
|
2011-06-21 22:04:44 +03:00
|
|
|
|
2011-06-27 23:10:13 +03:00
|
|
|
/*!
|
|
|
|
* Prints information about the test test that was just executed
|
|
|
|
*
|
|
|
|
* \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
|
|
|
|
*/
|
2011-06-22 17:41:37 +03:00
|
|
|
void PlainTestEnded(const char *testName, const char *suiteName,
|
2011-06-27 21:41:34 +03:00
|
|
|
int testResult, time_t endTime, double totalRuntime);
|
2011-06-26 23:04:37 +03:00
|
|
|
|
2011-06-21 22:04:44 +03:00
|
|
|
|
2011-06-27 23:10:13 +03:00
|
|
|
/*!
|
|
|
|
* Prints information about plain assert
|
|
|
|
*
|
|
|
|
* \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
|
|
|
|
*/
|
2011-06-21 22:04:44 +03:00
|
|
|
void PlainAssert(const char *assertName, int assertResult, const char *assertMessage,
|
2011-06-27 22:14:48 +03:00
|
|
|
time_t eventTime);
|
|
|
|
|
2011-06-27 23:10:13 +03:00
|
|
|
/*!
|
|
|
|
* Prints information about assert that has actual and expected values
|
|
|
|
*
|
|
|
|
* \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
|
|
|
|
*/
|
2011-06-27 22:14:48 +03:00
|
|
|
void PlainAssertWithValues(const char *assertName, int assertResult, const char *assertMessage,
|
2011-06-27 23:10:13 +03:00
|
|
|
int actualValue, int expected, time_t eventTime);
|
2011-06-21 22:04:44 +03:00
|
|
|
|
2011-06-27 23:10:13 +03:00
|
|
|
/*!
|
|
|
|
* Prints summary of all assertions of certain tests
|
|
|
|
*
|
|
|
|
* \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
|
|
|
|
*/
|
2011-06-27 21:41:34 +03:00
|
|
|
void PlainAssertSummary(int numAsserts, int numAssertsFailed, int numAssertsPass, time_t eventTime);
|
2011-06-26 23:04:37 +03:00
|
|
|
|
2011-06-27 23:10:13 +03:00
|
|
|
/*!
|
|
|
|
* Prints given message
|
|
|
|
*
|
|
|
|
* \param logMessage Message to be logged
|
|
|
|
* \param eventTime Timestamp for log message
|
|
|
|
*/
|
2011-07-18 16:37:02 +03:00
|
|
|
void PlainLog(time_t eventTime, char *fmt, ...);
|
2011-06-21 22:04:44 +03:00
|
|
|
|
|
|
|
#endif
|