diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com> | 2013-09-24 07:58:59 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-24 10:54:23 +0200 |
commit | 75abfa89821e0c64022d90bba227b947947169d4 (patch) | |
tree | f666495b3262d803eabdea0a4a464b159fa844e0 /src/testlib | |
parent | e4ce1790b1a07d263dbbd22329c2b98a0322358c (diff) |
Support logcat output from tests on Android
We usually do not have a console, so print out the messages
to the log as well, so that it's easier to run single tests
for debugging.
Change-Id: I31908977aac25a6f6716f8245206b01026234aa9
Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
Diffstat (limited to 'src/testlib')
-rw-r--r-- | src/testlib/qplaintestlogger.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/testlib/qplaintestlogger.cpp b/src/testlib/qplaintestlogger.cpp index a923a0d0fa..57ce5b031d 100644 --- a/src/testlib/qplaintestlogger.cpp +++ b/src/testlib/qplaintestlogger.cpp @@ -62,6 +62,10 @@ #include <QtCore/QByteArray> #include <QtCore/qmath.h> +#ifdef Q_OS_ANDROID +# include <android/log.h> +#endif + QT_BEGIN_NAMESPACE namespace QTest { @@ -206,6 +210,8 @@ void QPlainTestLogger::outputMessage(const char *str) if (stream != stdout) #elif defined(Q_OS_WIN) OutputDebugStringA(str); +#elif defined(Q_OS_ANDROID) + __android_log_print(ANDROID_LOG_INFO, "QTestLib", str); #endif outputString(str); } |