diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2013-12-20 11:14:04 -0800 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-14 00:34:25 +0100 |
commit | 8dcb72fd1e2c17ad000474496b6d000580e0a943 (patch) | |
tree | 7e210404d51d2aff3fc6cdd92938071701acc0b1 /src/testlib/qtestcase.cpp | |
parent | 539196689e806f8c175bb50343a4dc2cab52e838 (diff) |
Add a CSV logging feature to the benchlib
This is only useful for logging benchmarks, since it won't print test
passes, failures, etc. It's useful for importing to spreadsheets to do
number-crunching.
[ChangeLog][QtTest]Added a CSV logging mode that is suitable for
importing benchmark results into spreadsheets. This can be enabled by
the -csv option on the command-line. The CSV logging mode will not print
test failures, debug messages, warnings, etc.
Change-Id: I245d6f86bb380645c9bc0d748cf474b3ed42cab8
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
Reviewed-by: Jason McDonald <macadder1@gmail.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 224357dd85..0d7a017f89 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -1320,6 +1320,7 @@ Q_TESTLIB_EXPORT void qtest_qParseArgs(int argc, char *argv[], bool qml) " Use - to output to stdout\n" " Valid formats are:\n" " txt : Plain text\n" + " csv : CSV format (suitable for benchmarks)\n" " xunitxml : XML XUnit document\n" " xml : XML document\n" " lightxml : A stream of XML tags\n" @@ -1329,6 +1330,7 @@ Q_TESTLIB_EXPORT void qtest_qParseArgs(int argc, char *argv[], bool qml) " Old-style logging options:\n" " -o filename : Write the output into file\n" " -txt : Output results in Plain Text\n" + " -csv : Output results in a CSV format (suitable for benchmarks)\n" " -xunitxml : Output results as XML XUnit document\n" " -xml : Output results as XML document\n" " -lightxml : Output results as stream of XML tags\n" @@ -1408,6 +1410,8 @@ Q_TESTLIB_EXPORT void qtest_qParseArgs(int argc, char *argv[], bool qml) } } else if (strcmp(argv[i], "-txt") == 0) { logFormat = QTestLog::Plain; + } else if (strcmp(argv[i], "-csv") == 0) { + logFormat = QTestLog::CSV; } else if (strcmp(argv[i], "-xunitxml") == 0) { logFormat = QTestLog::XunitXML; } else if (strcmp(argv[i], "-xml") == 0) { @@ -1438,6 +1442,8 @@ Q_TESTLIB_EXPORT void qtest_qParseArgs(int argc, char *argv[], bool qml) // New-style if (strcmp(format, "txt") == 0) logFormat = QTestLog::Plain; + else if (strcmp(format, "csv") == 0) + logFormat = QTestLog::CSV; else if (strcmp(format, "lightxml") == 0) logFormat = QTestLog::LightXML; else if (strcmp(format, "xml") == 0) @@ -1445,7 +1451,7 @@ Q_TESTLIB_EXPORT void qtest_qParseArgs(int argc, char *argv[], bool qml) else if (strcmp(format, "xunitxml") == 0) logFormat = QTestLog::XunitXML; else { - fprintf(stderr, "output format must be one of txt, lightxml, xml or xunitxml\n"); + fprintf(stderr, "output format must be one of txt, csv, lightxml, xml or xunitxml\n"); exit(1); } if (strcmp(filename, "-") == 0 && QTestLog::loggerUsingStdout()) { |