****************************************************************************/
#include "QtTest/private/qabstracttestlogger_p.h"
-#include "QtTest/private/qtestlog_p.h"
#include "QtTest/qtestassert.h"
#include "QtCore/qbytearray.h"
}
-void QAbstractTestLogger::startLogging()
+void QAbstractTestLogger::startLogging(const char *filename)
{
QTEST_ASSERT(!QTest::stream);
- const char *out = QTestLog::outputFileName();
- if (!out) {
+ if (!filename) {
QTest::stream = stdout;
return;
}
#if defined(_MSC_VER) && _MSC_VER >= 1400 && !defined(Q_OS_WINCE)
- if (::fopen_s(&QTest::stream, out, "wt")) {
+ if (::fopen_s(&QTest::stream, filename, "wt")) {
#else
- QTest::stream = ::fopen(out, "wt");
+ QTest::stream = ::fopen(filename, "wt");
if (!QTest::stream) {
#endif
- printf("Unable to open file for logging: %s", out);
+ printf("Unable to open file for logging: %s", filename);
::exit(1);
}
}
QAbstractTestLogger() {}
virtual ~QAbstractTestLogger() {}
- virtual void startLogging();
+ virtual void startLogging(const char *filename);
virtual void stopLogging();
virtual void enterTestFunction(const char *function) = 0;
#endif
}
-void QPlainTestLogger::startLogging()
+void QPlainTestLogger::startLogging(const char *filename)
{
- QAbstractTestLogger::startLogging();
+ QAbstractTestLogger::startLogging(filename);
char buf[1024];
if (QTestLog::verboseLevel() < 0) {
QPlainTestLogger();
~QPlainTestLogger();
- void startLogging();
+ void startLogging(const char *filename);
void stopLogging();
void enterTestFunction(const char *function);
QTEST_ASSERT(!QTest::testLogger);
QTest::initLogger();
QTest::testLogger->registerRandomSeed(randomSeed);
- QTest::testLogger->startLogging();
+ QTest::testLogger->startLogging(QTest::outFile);
QTest::oldMessageHandler = qInstallMsgHandler(QTest::messageHandler);
}
{
QTEST_ASSERT(!QTest::testLogger);
QTest::initLogger();
- QTest::testLogger->startLogging();
+ QTest::testLogger->startLogging(QTest::outFile);
QTest::oldMessageHandler = qInstallMsgHandler(QTest::messageHandler);
}
delete filelogger;
}
-void QTestLogger::startLogging()
+void QTestLogger::startLogging(const char *filename)
{
- QAbstractTestLogger::startLogging();
+ QAbstractTestLogger::startLogging(filename);
switch(format){
case TLF_LightXml:{
TLF_XunitXml = 2
};
- void startLogging();
+ void startLogging(const char *filename);
void stopLogging();
void enterTestFunction(const char *function);
{
}
-void QXmlTestLogger::startLogging()
+void QXmlTestLogger::startLogging(const char *filename)
{
- QAbstractTestLogger::startLogging();
+ QAbstractTestLogger::startLogging(filename);
QTestCharBuffer buf;
if (xmlmode == QXmlTestLogger::Complete) {
QXmlTestLogger(XmlMode mode = Complete);
~QXmlTestLogger();
- void startLogging();
+ void startLogging(const char *filename);
void stopLogging();
void enterTestFunction(const char *function);