summaryrefslogtreecommitdiffstats
path: root/src/testlib/qplaintestlogger.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/testlib/qplaintestlogger.cpp')
-rw-r--r--src/testlib/qplaintestlogger.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/testlib/qplaintestlogger.cpp b/src/testlib/qplaintestlogger.cpp
index 2515c51..a2be00f 100644
--- a/src/testlib/qplaintestlogger.cpp
+++ b/src/testlib/qplaintestlogger.cpp
@@ -54,6 +54,10 @@
#include "windows.h"
#endif
+#if defined(Q_OS_SYMBIAN)
+#include <e32debug.h>
+#endif
+
#ifdef Q_OS_WINCE
#include <QtCore/QString>
#endif
@@ -125,7 +129,11 @@ namespace QTest {
static const char *messageType2String(QAbstractTestLogger::MessageTypes type)
{
+#ifdef Q_OS_WIN
static bool colored = (!qgetenv("QTEST_COLORED").isEmpty());
+#else
+ static bool colored = ::getenv("QTEST_COLORED");
+#endif
switch (type) {
case QAbstractTestLogger::Skip:
return COLORED_MSG(0, 37, "SKIP "); //white
@@ -161,6 +169,18 @@ namespace QTest {
// OutputDebugString is not threadsafe
OutputDebugStringA(str);
LeaveCriticalSection(&outputCriticalSection);
+#elif defined(Q_OS_SYMBIAN)
+ TPtrC8 ptr(reinterpret_cast<const TUint8*>(str));
+ HBufC* hbuffer = HBufC::New(ptr.Length());
+ if (hbuffer) {
+ hbuffer->Des().Copy(ptr);
+ RDebug::Print(_L("[QTestLib Message] %S"), hbuffer);
+ delete hbuffer;
+ } else {
+ TBuf<256> tmp;
+ tmp.Copy(ptr.Left(Min(256, ptr.Length())));
+ RDebug::Print(_L("[QTestLib Message] %S"), &tmp);
+ }
#endif
QAbstractTestLogger::outputString(str);
}