Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
|
#include <qtestlog_p.h>
Public Types | |
enum | LogMode { Plain = 0 , XML , LightXML , JUnitXML , CSV , TeamCity , TAP } |
Public Member Functions | |
QTestLog ()=delete | |
~QTestLog ()=delete | |
Q_ENUM (LogMode) | |
Static Public Member Functions | |
static void | enterTestFunction (const char *function) |
static void | leaveTestFunction () |
static void | enterTestData (QTestData *data) |
static void | addPass (const char *msg) |
static void | addFail (const char *msg, const char *file, int line) |
static void | addXFail (const char *msg, const char *file, int line) |
static void | addXPass (const char *msg, const char *file, int line) |
static void | addBPass (const char *msg) |
static void | addBFail (const char *msg, const char *file, int line) |
static void | addBXPass (const char *msg, const char *file, int line) |
static void | addBXFail (const char *msg, const char *file, int line) |
static void | addSkip (const char *msg, const char *file, int line) |
static void | addBenchmarkResult (const QList< QBenchmarkResult > &result) |
static void | addBenchmarkResults (const QList< QBenchmarkResult > &result) |
static void | ignoreMessage (QtMsgType type, const char *msg) |
static void | ignoreMessage (QtMsgType type, const QRegularExpression &expression) |
static void | failOnWarning () |
static void | failOnWarning (const char *msg) |
static void | failOnWarning (const QRegularExpression &expression) |
static int | unhandledIgnoreMessages () |
static void | printUnhandledIgnoreMessages () |
static void | clearIgnoreMessages () |
static void | clearFailOnWarnings () |
static void | clearCurrentTestState () |
static void | warn (const char *msg, const char *file, int line) |
static void | info (const char *msg, const char *file, int line) |
static void | startLogging () |
static void | stopLogging () |
static void | addLogger (LogMode mode, const char *filename) |
static void | addLogger (QAbstractTestLogger *logger) |
static bool | hasLoggers () |
static bool | isRepeatSupported () |
static bool | loggerUsingStdout () |
static void | setVerboseLevel (int level) |
static int | verboseLevel () |
static void | setMaxWarnings (int max) |
static void | setPrintAvailableTagsMode () |
static int | passCount () |
static int | failCount () |
static int | skipCount () |
static int | blacklistCount () |
static int | totalCount () |
static void | resetCounters () |
static void | setInstalledTestCoverage (bool installed) |
static bool | installedTestCoverage () |
static qint64 | nsecsTotalTime () |
static qreal | msecsTotalTime () |
static qint64 | nsecsFunctionTime () |
static qreal | msecsFunctionTime () |
Related Symbols | |
(Note that these are not member symbols.) | |
failOnWarning | |
failOnWarning | |
Definition at line 33 of file qtestlog_p.h.
enum QTestLog::LogMode |
Enumerator | |
---|---|
Plain | |
XML | |
LightXML | |
JUnitXML | |
CSV | |
TeamCity | |
TAP |
Definition at line 41 of file qtestlog_p.h.
|
delete |
|
delete |
|
inlinestatic |
Definition at line 66 of file qtestlog_p.h.
|
static |
Definition at line 475 of file qtestlog.cpp.
References FOREACH_TEST_LOGGER, and results.
Referenced by QuickTestResult::needsMoreMeasurements().
|
static |
Definition at line 408 of file qtestlog.cpp.
References QAbstractTestLogger::BlacklistedFail, QTest::blacklists, QTest::currentTestState, file, FOREACH_TEST_LOGGER, line, Q_ASSERT, QTEST_ASSERT, QTest::Skipped, QTest::Suppressed, and QTest::Unresolved.
Referenced by QTestResult::addFailure().
|
static |
Definition at line 396 of file qtestlog.cpp.
References QAbstractTestLogger::BlacklistedPass, QTest::blacklists, QTest::currentTestState, FOREACH_TEST_LOGGER, Q_ASSERT, QTEST_ASSERT, QTest::Suppressed, and QTest::Unresolved.
Referenced by QTestResult::finishedCurrentTestDataCleanup().
|
static |
Definition at line 444 of file qtestlog.cpp.
References QAbstractTestLogger::BlacklistedXFail, file, FOREACH_TEST_LOGGER, line, and QTEST_ASSERT.
Referenced by checkStatement().
|
static |
Definition at line 426 of file qtestlog.cpp.
References QAbstractTestLogger::BlacklistedXPass, QTest::blacklists, QTest::currentTestState, file, FOREACH_TEST_LOGGER, line, Q_ASSERT, QTEST_ASSERT, QTest::Skipped, QTest::Suppressed, and QTest::Unresolved.
Referenced by checkStatement().
|
static |
Definition at line 348 of file qtestlog.cpp.
References QTest::currentTestState, QAbstractTestLogger::Fail, QTest::Failed, QTest::fails, file, FOREACH_TEST_LOGGER, line, Q_ASSERT, QTEST_ASSERT, QTest::Skipped, and QTest::Unresolved.
Referenced by QTestResult::addFailure().
Definition at line 500 of file qtestlog.cpp.
References addLogger(), QXmlTestLogger::Complete, CSV, JUnitXML, QXmlTestLogger::Light, LightXML, Plain, QTEST_ASSERT, TAP, TeamCity, and XML.
Referenced by addLogger(), and QTest::qtest_qParseArgs().
|
static |
Adds a new logger to the set of loggers that will be used to report incidents and messages during testing.
The function takes ownership of the logger.
Definition at line 552 of file qtestlog.cpp.
References QTEST_ASSERT.
|
static |
Definition at line 333 of file qtestlog.cpp.
References QTest::currentTestState, FOREACH_TEST_LOGGER, QAbstractTestLogger::Pass, QTest::Passed, QTest::passes, Q_ASSERT, QTEST_ASSERT, and QTest::Unresolved.
Referenced by QTestResult::finishedCurrentTestDataCleanup().
|
static |
Definition at line 454 of file qtestlog.cpp.
References QTest::currentTestState, QTest::Failed, file, FOREACH_TEST_LOGGER, line, Q_ASSERT, QTEST_ASSERT, QAbstractTestLogger::Skip, QTest::Skipped, QTest::skips, QTest::Suppressed, and QTest::Unresolved.
Referenced by QTestResult::addSkip().
|
static |
Definition at line 368 of file qtestlog.cpp.
References file, FOREACH_TEST_LOGGER, line, QTEST_ASSERT, and QAbstractTestLogger::XFail.
Referenced by checkStatement().
|
static |
Definition at line 378 of file qtestlog.cpp.
References QTest::currentTestState, QTest::Failed, QTest::fails, file, FOREACH_TEST_LOGGER, line, Q_ASSERT, QTEST_ASSERT, QTest::Skipped, QTest::Unresolved, and QAbstractTestLogger::XPass.
Referenced by checkStatement().
|
static |
Definition at line 678 of file qtestlog.cpp.
References QTest::blacklists.
Referenced by QPlainTestLogger::stopLogging(), and totalCount().
|
static |
Definition at line 326 of file qtestlog.cpp.
References clearFailOnWarnings(), clearIgnoreMessages(), QTest::currentTestState, and QTest::Unresolved.
Referenced by QTestResult::finishedCurrentTestDataCleanup(), and QTestResult::finishedCurrentTestFunction().
|
static |
Definition at line 321 of file qtestlog.cpp.
References QTest::failOnWarningList.
Referenced by clearCurrentTestState().
|
static |
Definition at line 315 of file qtestlog.cpp.
References QTest::IgnoreResultList::clearList(), QTest::ignoreResultList, and QTest::mutex.
Referenced by clearCurrentTestState().
Definition at line 265 of file qtestlog.cpp.
References FOREACH_TEST_LOGGER, and QTEST_ASSERT.
Referenced by QTestResult::setCurrentTestData().
|
static |
Definition at line 253 of file qtestlog.cpp.
References elapsedFunctionTime, FOREACH_TEST_LOGGER, and QTEST_ASSERT.
Referenced by QTestResult::setCurrentTestFunction().
|
static |
Definition at line 668 of file qtestlog.cpp.
References QTest::fails.
Referenced by QuickTestResult::exitCode(), QuickTestResult::failCount(), QTest::qRun(), saveCoverageTool(), stopLogging(), QPlainTestLogger::stopLogging(), QTapTestLogger::stopLogging(), and totalCount().
|
static |
Definition at line 632 of file qtestlog.cpp.
References QTest::failOnWarningList.
Referenced by QTest::failOnWarning(), and QTest::failOnWarning().
|
static |
Definition at line 637 of file qtestlog.cpp.
References QTest::failOnWarningList, and QString::fromUtf8().
|
static |
|
static |
Definition at line 558 of file qtestlog.cpp.
Referenced by QTest::messageHandler(), and QTest::qtest_qParseArgs().
Definition at line 614 of file qtestlog.cpp.
References QTest::IgnoreResultList::append(), QString::fromUtf8(), QTest::ignoreResultList, QTest::mutex, and QTEST_ASSERT.
Referenced by QTest::ignoreMessage(), and QuickTestResult::ignoreWarning().
|
static |
|
static |
Definition at line 596 of file qtestlog.cpp.
References file, FOREACH_TEST_LOGGER, QString::fromUtf8(), QAbstractTestLogger::Info, line, and QTEST_ASSERT.
Referenced by compareHelper(), compareHelper(), QTest::qFindTestData(), QTest::qPrintMessage(), QTestResult::reportResult(), and QTestResult::verify().
|
static |
Definition at line 700 of file qtestlog.cpp.
References QTest::installedTestCoverage.
Referenced by stopLogging().
|
static |
Returns true if all loggers support repeated test runs
Definition at line 568 of file qtestlog.cpp.
References FOREACH_TEST_LOGGER.
Referenced by QTest::qtest_qParseArgs().
|
static |
Definition at line 285 of file qtestlog.cpp.
References FOREACH_TEST_LOGGER.
Referenced by QTestResult::finishedCurrentTestFunction(), and QTest::messageHandler().
|
static |
Definition at line 578 of file qtestlog.cpp.
References FOREACH_TEST_LOGGER.
Referenced by QTest::qtest_qParseArgs().
|
inlinestatic |
Definition at line 119 of file qtestlog_p.h.
References nsecsFunctionTime().
Referenced by QXmlTestLogger::leaveTestFunction(), and QTest::CrashHandler::printTestRunTime().
|
inlinestatic |
Definition at line 117 of file qtestlog_p.h.
References nsecsTotalTime().
Referenced by QTest::CrashHandler::printTestRunTime(), QJUnitTestLogger::stopLogging(), QPlainTestLogger::stopLogging(), and QXmlTestLogger::stopLogging().
|
static |
Definition at line 710 of file qtestlog.cpp.
References elapsedFunctionTime.
Referenced by msecsFunctionTime().
|
static |
Definition at line 705 of file qtestlog.cpp.
References elapsedTotalTime.
Referenced by msecsTotalTime().
|
static |
Definition at line 663 of file qtestlog.cpp.
References QTest::passes.
Referenced by QuickTestResult::passCount(), saveCoverageTool(), QPlainTestLogger::stopLogging(), QTapTestLogger::stopLogging(), and totalCount().
|
static |
Definition at line 294 of file qtestlog.cpp.
References FOREACH_TEST_LOGGER, QTest::ignoreResultList, QAbstractTestLogger::Info, list, and QTest::mutex.
Referenced by QTestResult::finishedCurrentTestDataCleanup().
QTestLog::Q_ENUM | ( | LogMode | ) |
|
static |
Definition at line 688 of file qtestlog.cpp.
References QTest::fails, QTest::passes, and QTest::skips.
Referenced by QTestResult::reset().
|
static |
Definition at line 695 of file qtestlog.cpp.
References QTest::installedTestCoverage.
Referenced by QTest::qtest_qParseArgs().
|
static |
Definition at line 651 of file qtestlog.cpp.
References QTest::maxWarnings.
Referenced by QTest::qtest_qParseArgs().
|
static |
Definition at line 658 of file qtestlog.cpp.
Referenced by QTest::qPrintDataTags().
|
static |
Definition at line 604 of file qtestlog.cpp.
References QTest::verbosity.
Referenced by QTest::qtest_qParseArgs().
|
static |
Definition at line 673 of file qtestlog.cpp.
References QTest::skips.
Referenced by QuickTestResult::skipCount(), QJUnitTestLogger::stopLogging(), QPlainTestLogger::stopLogging(), and totalCount().
|
static |
Definition at line 481 of file qtestlog.cpp.
References elapsedFunctionTime, elapsedTotalTime, FOREACH_TEST_LOGGER, QTest::messageHandler(), QTest::oldMessageHandler, and qInstallMessageHandler().
Referenced by QTest::qInit(), and QuickTestResult::startLogging().
|
static |
Definition at line 490 of file qtestlog.cpp.
References QTestResult::currentAppName(), failCount(), FOREACH_TEST_LOGGER, installedTestCoverage(), QTest::oldMessageHandler, qInstallMessageHandler(), and saveCoverageTool().
Referenced by QTest::messageHandler(), QTest::qCleanup(), QuickTestResult::setProgramName(), and QuickTestResult::stopLogging().
|
static |
Definition at line 683 of file qtestlog.cpp.
References blacklistCount(), failCount(), passCount(), and skipCount().
Referenced by QTapTestLogger::addIncident(), and QTapTestLogger::stopLogging().
|
static |
Definition at line 273 of file qtestlog.cpp.
References i, QTest::ignoreResultList, list, and QTest::mutex.
Referenced by QTestResult::finishedCurrentTestDataCleanup().
|
static |
Definition at line 609 of file qtestlog.cpp.
References QTest::verbosity.
Referenced by QPlainTestLogger::addBenchmarkResults(), QPlainTestLogger::addIncident(), QTeamCityLogger::addIncident(), QPlainTestLogger::addMessage(), QTeamCityLogger::addMessage(), compareHelper(), compareHelper(), QPlainTestLogger::enterTestFunction(), QTest::qFindTestData(), QTestResult::reportResult(), QPlainTestLogger::startLogging(), QPlainTestLogger::stopLogging(), and QTestResult::verify().
|
static |
Definition at line 588 of file qtestlog.cpp.
References file, FOREACH_TEST_LOGGER, QString::fromUtf8(), line, QTEST_ASSERT, and QAbstractTestLogger::Warn.
Referenced by QTest::qFindTestData(), and QuickTestResult::warn().
|
related |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Appends a test failure to the test log if any warning is output.
|
related |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Appends a test failure to the test log if the message is output.