diff options
author | Borgar Ovsthus <borgar.ovsthus@fmcti.com> | 2016-01-06 18:20:29 +0100 |
---|---|---|
committer | Borgar Øvsthus <borgar.ovsthus@fmcti.com> | 2016-01-23 18:30:58 +0000 |
commit | fbd6acedac8e1f4ee624cb713055fcad1ceabf96 (patch) | |
tree | 37ab3e2e7ec82f5cd641c8ddfc38566b17b7fa72 /src/testlib/qtestcase.cpp | |
parent | 9eda09f511246720a8c4eff2bbb52bbfacc36f48 (diff) |
Add TeamCity logging feature to testlib
This allows TeamCity to parse realtime test-results instead of using
post-build XML Report Processing. This does not support logging of
benchmarks.
[ChangeLog][QTest] Added a new logging mode that allow test-results to
be parsed on-the-fly when using Jetbrains TeamCity as CI-server. This
mode is enabled by using the -teamcity option on the command-line.
Change-Id: Ie730beb643043eb0f448f99abe6c0b5ac48aaf03
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/testlib/qtestcase.cpp')
-rw-r--r-- | src/testlib/qtestcase.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index 0aec8a44b8..d71b64428d 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -404,6 +404,7 @@ Q_TESTLIB_EXPORT void qtest_qParseArgs(int argc, char *argv[], bool qml) " xunitxml : XML XUnit document\n" " xml : XML document\n" " lightxml : A stream of XML tags\n" + " teamcity : TeamCity format\n" "\n" " *** Multiple loggers can be specified, but at most one can log to stdout.\n" "\n" @@ -414,6 +415,7 @@ Q_TESTLIB_EXPORT void qtest_qParseArgs(int argc, char *argv[], bool qml) " -xunitxml : Output results as XML XUnit document\n" " -xml : Output results as XML document\n" " -lightxml : Output results as stream of XML tags\n" + " -teamcity : Output results in TeamCity format\n" "\n" " *** If no output file is specified, stdout is assumed.\n" " *** If no output format is specified, -txt is assumed.\n" @@ -499,6 +501,8 @@ Q_TESTLIB_EXPORT void qtest_qParseArgs(int argc, char *argv[], bool qml) logFormat = QTestLog::XML; } else if (strcmp(argv[i], "-lightxml") == 0) { logFormat = QTestLog::LightXML; + } else if (strcmp(argv[i], "-teamcity") == 0) { + logFormat = QTestLog::TeamCity; } else if (strcmp(argv[i], "-silent") == 0) { QTestLog::setVerboseLevel(-1); } else if (strcmp(argv[i], "-v1") == 0) { @@ -531,8 +535,10 @@ Q_TESTLIB_EXPORT void qtest_qParseArgs(int argc, char *argv[], bool qml) logFormat = QTestLog::XML; else if (strcmp(format, "xunitxml") == 0) logFormat = QTestLog::XunitXML; + else if (strcmp(format, "teamcity") == 0) + logFormat = QTestLog::TeamCity; else { - fprintf(stderr, "output format must be one of txt, csv, lightxml, xml or xunitxml\n"); + fprintf(stderr, "output format must be one of txt, csv, lightxml, xml, teamcity or xunitxml\n"); exit(1); } if (strcmp(filename, "-") == 0 && QTestLog::loggerUsingStdout()) { |