2011-06-21 22:04:44 +03:00
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <stdarg.h>
|
|
|
|
|
2011-06-24 14:35:14 +03:00
|
|
|
#include <SDL/SDL.h>
|
|
|
|
|
2011-06-21 22:04:44 +03:00
|
|
|
#include "logger.h"
|
|
|
|
#include "xml_logger.h"
|
|
|
|
#include "plain_logger.h"
|
|
|
|
|
2011-06-28 17:03:38 +03:00
|
|
|
//! Pointers to selected logger implementation
|
2011-06-21 22:04:44 +03:00
|
|
|
RunStartedFp RunStarted = 0;
|
|
|
|
RunEndedFp RunEnded = 0;
|
|
|
|
SuiteStartedFp SuiteStarted = 0;
|
|
|
|
SuiteEndedFp SuiteEnded = 0;
|
|
|
|
TestStartedFp TestStarted = 0;
|
|
|
|
TestEndedFp TestEnded = 0;
|
|
|
|
AssertFp Assert = 0;
|
2011-06-27 22:14:48 +03:00
|
|
|
AssertWithValuesFp AssertWithValues = 0;
|
2011-06-26 23:04:37 +03:00
|
|
|
AssertSummaryFp AssertSummary = 0;
|
2011-06-21 22:04:44 +03:00
|
|
|
LogFp Log = 0;
|
|
|
|
|
2011-06-28 17:03:38 +03:00
|
|
|
/*!
|
|
|
|
* Sets up the XML logger
|
|
|
|
*/
|
2011-06-26 23:04:37 +03:00
|
|
|
int
|
|
|
|
SetupXMLLogger()
|
|
|
|
{
|
|
|
|
RunStarted = XMLRunStarted;
|
|
|
|
RunEnded = XMLRunEnded;
|
|
|
|
|
|
|
|
SuiteStarted = XMLSuiteStarted;
|
|
|
|
SuiteEnded = XMLSuiteEnded;
|
|
|
|
|
|
|
|
TestStarted = XMLTestStarted;
|
|
|
|
TestEnded = XMLTestEnded;
|
|
|
|
|
|
|
|
Assert = XMLAssert;
|
2011-06-27 22:14:48 +03:00
|
|
|
AssertWithValues = XMLAssertWithValues;
|
2011-06-26 23:04:37 +03:00
|
|
|
AssertSummary = XMLAssertSummary;
|
|
|
|
|
|
|
|
Log = XMLLog;
|
|
|
|
}
|
|
|
|
|
2011-06-28 17:03:38 +03:00
|
|
|
/*!
|
|
|
|
* Sets up the plain logger
|
|
|
|
*/
|
2011-06-26 23:04:37 +03:00
|
|
|
int
|
|
|
|
SetupPlainLogger()
|
|
|
|
{
|
|
|
|
RunStarted = PlainRunStarted;
|
|
|
|
RunEnded = PlainRunEnded;
|
|
|
|
|
|
|
|
SuiteStarted = PlainSuiteStarted;
|
|
|
|
SuiteEnded = PlainSuiteEnded;
|
|
|
|
|
|
|
|
TestStarted = PlainTestStarted;
|
|
|
|
TestEnded = PlainTestEnded;
|
|
|
|
|
|
|
|
Assert = PlainAssert;
|
2011-06-27 22:14:48 +03:00
|
|
|
AssertWithValues = PlainAssertWithValues;
|
2011-06-26 23:04:37 +03:00
|
|
|
AssertSummary = PlainAssertSummary;
|
|
|
|
|
|
|
|
Log = PlainLog;
|
|
|
|
}
|