#include <qabstracttestlogger_p.h>
Inheritance diagram for QAbstractTestLogger:

Definition at line 38 of file qabstracttestlogger_p.h.
Public Types | |
| enum | IncidentTypes |
| enum | MessageTypes |
Public Member Functions | |
| QAbstractTestLogger () | |
| virtual | ~QAbstractTestLogger () |
| virtual void | startLogging () |
| virtual void | stopLogging () |
| virtual void | enterTestFunction (const char *function)=0 |
| virtual void | leaveTestFunction ()=0 |
| virtual void | addIncident (IncidentTypes type, const char *description, const char *file=0, int line=0)=0 |
| virtual void | addMessage (MessageTypes type, const char *message, const char *file=0, int line=0)=0 |
Static Public Member Functions | |
| static void | outputString (const char *msg) |
| static bool | isTtyOutput () |
| QAbstractTestLogger::QAbstractTestLogger | ( | ) | [inline] |
| virtual QAbstractTestLogger::~QAbstractTestLogger | ( | ) | [inline, virtual] |
| void QAbstractTestLogger::startLogging | ( | ) | [virtual] |
Definition at line 60 of file qabstracttestlogger.cpp.
References QTestLog::outputFileName(), printf, QTEST_ASSERT, and QTest::stream.
Referenced by QTestLog::startLogging(), QPlainTestLogger::startLogging(), and QXmlTestLogger::startLogging().
00061 { 00062 QTEST_ASSERT(!QTest::stream); 00063 00064 const char *out = QTestLog::outputFileName(); 00065 if (!out) { 00066 QTest::stream = stdout; 00067 return; 00068 } 00069 #if defined(_MSC_VER) && _MSC_VER >= 1400 00070 if (::fopen_s(&QTest::stream, out, "wt")) { 00071 #else 00072 QTest::stream = ::fopen(out, "wt"); 00073 if (!QTest::stream) { 00074 #endif 00075 printf("Unable to open file for logging: %s", out); 00076 ::exit(1); 00077 } 00078 }
Here is the call graph for this function:

| void QAbstractTestLogger::stopLogging | ( | ) | [virtual] |
Definition at line 80 of file qabstracttestlogger.cpp.
References QTEST_ASSERT, and QTest::stream.
Referenced by QPlainTestLogger::stopLogging(), QXmlTestLogger::stopLogging(), and QTestLog::stopLogging().
00081 { 00082 QTEST_ASSERT(QTest::stream); 00083 if (QTest::stream != stdout) 00084 fclose(QTest::stream); 00085 QTest::stream = 0; 00086 }
| virtual void QAbstractTestLogger::enterTestFunction | ( | const char * | function | ) | [pure virtual] |
Referenced by QTestLog::enterTestFunction().
| virtual void QAbstractTestLogger::leaveTestFunction | ( | ) | [pure virtual] |
Referenced by QTestLog::leaveTestFunction().
| virtual void QAbstractTestLogger::addIncident | ( | IncidentTypes | type, | |
| const char * | description, | |||
| const char * | file = 0, |
|||
| int | line = 0 | |||
| ) | [pure virtual] |
Referenced by QTestLog::addFail(), QTestLog::addPass(), QTestLog::addXFail(), and QTestLog::addXPass().
| virtual void QAbstractTestLogger::addMessage | ( | MessageTypes | type, | |
| const char * | message, | |||
| const char * | file = 0, |
|||
| int | line = 0 | |||
| ) | [pure virtual] |
| void QAbstractTestLogger::outputString | ( | const char * | msg | ) | [static] |
Definition at line 40 of file qabstracttestlogger.cpp.
References QTEST_ASSERT, and QTest::stream.
Referenced by QXmlTestLogger::addIncident(), QXmlTestLogger::addMessage(), QXmlTestLogger::enterTestFunction(), QXmlTestLogger::leaveTestFunction(), QTest::outputMessage(), QXmlTestLogger::startLogging(), and QXmlTestLogger::stopLogging().
00041 { 00042 QTEST_ASSERT(QTest::stream); 00043 00044 ::fputs(msg, QTest::stream); 00045 ::fflush(QTest::stream); 00046 }
| bool QAbstractTestLogger::isTtyOutput | ( | ) | [static] |
Definition at line 48 of file qabstracttestlogger.cpp.
References QTEST_ASSERT, and QTest::stream.
00049 { 00050 QTEST_ASSERT(QTest::stream); 00051 00052 #ifdef Q_OS_WIN 00053 return true; 00054 #else 00055 static bool ttyoutput = isatty(fileno(QTest::stream)); 00056 return ttyoutput; 00057 #endif 00058 }
1.5.1