diff options
author | Jason McDonald <jason.mcdonald@nokia.com> | 2011-09-02 19:08:21 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-09-23 00:34:23 +0200 |
commit | 51589e834e086de93a121a1c628c3492d88a15a7 (patch) | |
tree | 6d1506f12c3dc9eb37d8471e8e0b1d1a821c2cac /src/testlib/qtestlog_p.h | |
parent | 157fc88f90c42c6ff1b47b1bad018565fe63f626 (diff) |
Allow tests to log to multiple destinations
Each destination and the format of output to write there is specified by
adding "-o filename,format" to the command-line. The special filename
"-" indicates that the log output is written to the standard output
stream, though standard output can be used as a destination at most
once.
The old-style testlib output options are still supported, but can only
be used to specify one logging destination, as before.
If no logging options are given on the command-line, a plain text log
will go to the console, as before.
To log to the console in plain text and to the file "test_output" in
xunit format, one would invoke a test in the following way:
tst_foo -o test_output,xunitxml -o -,txt
This commit also enhances the selftests to test with multiple loggers,
but negative tests (e.g. bad combinations of command-line options) are
left for future task QTBUG-21567.
Task-number: QTBUG-20615
Change-Id: If91e752bc7001657e15e427aba9d25ab0a29a0b0
Reviewed-on: http://codereview.qt-project.org/4125
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Diffstat (limited to 'src/testlib/qtestlog_p.h')
-rw-r--r-- | src/testlib/qtestlog_p.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/testlib/qtestlog_p.h b/src/testlib/qtestlog_p.h index f06382978f..fe37469dc6 100644 --- a/src/testlib/qtestlog_p.h +++ b/src/testlib/qtestlog_p.h @@ -83,9 +83,10 @@ public: static void startLogging(); static void stopLogging(); - static void initLogger(LogMode mode, const char *filename); + static void addLogger(LogMode mode, const char *filename); - static LogMode logMode(); + static int loggerCount(); + static bool loggerUsingStdout(); static void setVerboseLevel(int level); static int verboseLevel(); |