summaryrefslogtreecommitdiffstats
path: root/src/testlib/qtestlog.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Simplify qtestlib logging code, part 2Jason McDonald2011-09-011-2/+2
| | | | | | | | | Rename the QTestLogger class to QXunitTestLogger. Change-Id: I7b93f9de4f4744e53997ccc001a745c36f375599 Reviewed-on: http://codereview.qt.nokia.com/3924 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Simplify qtestlib logging code, part 1Jason McDonald2011-09-011-16/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Both the old and new XML loggers produce the Complete and Light XML log formats, while only the new logger produces Xunit XML logs. The disadvantage of the new logger is that it is more complex and doesn't produce a partial log if the test fails to terminate gracefully. This behaviour arises because Xunit format output cannot be written correctly until all tests have been executed. This commit removes the Complete and Light XML formats from the new logger, using the old logger to produce those formats and the new logger to produce only Xunit XML. Prior to this commit, the qtestlib selftests demonstrate that the old and new loggers produce identical output for Complete and Light XML. This commit also removes the undocumented -flush command-line option, which was used rather obscurely to select between the old and new loggers. The newer logger will be renamed to QXunitTestLogger in a subsequent commit. Change-Id: Id304f5b411bdd520409ee233f6bc34e8917942ab Reviewed-on: http://codereview.qt.nokia.com/3923 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove ability to run tests in random order.Jason McDonald2011-08-311-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the undocumented feature that allows test functions to be executed in random order. The feature was designed to expose unintended dependencies between test functions -- test functions are only supposed to depend on the initTestCase() and init() functions. Aside from the lack of documentation, there are a number of problems with this feature. Most importantly, running the tests in random order has only a 50% chance of exposing dependencies between test functions. A better strategy would be to run the test functions in reverse order and complain if that produces different results to running the tests in the normal order. Additionally, the random order is not deterministic, so even if a dependency is exposed during a test run, there's no guarantee that it will be exposed again. The feature allows the user to optionally supply a random seed to make the "random" order deterministic, but as rand() implementations are not identical across platforms, even that does not guarantee that dependencies between test functions will be exposed deterministically. Change-Id: I39eac34c532ccb988116778bbc5ab05d835874c5 Reviewed-on: http://codereview.qt.nokia.com/3720 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove QTestLog constructor/destructor definitionsJason McDonald2011-08-291-8/+0
| | | | | | | | | | | | QTestLog is an entirely static class and its constructor and destructor are declared private to prevent accidental construction of an instance of the class. Therefore, the constructor and destructor do not need to be defined. Change-Id: I860f1344c5032091f5c641a20e1656bb52a6f07e Reviewed-on: http://codereview.qt.nokia.com/3466 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Add missing assertions.Jason McDonald2011-08-291-0/+3
| | | | | | | | | | | For both QTestLog::addFail() and QTestLog::addIgnoreMessage(), passing a null message does not make sense and is therefore an error that should be brought to the developer's attention. Change-Id: Ib09ad90b70d74f7432c08708db8a70dee008cce4 Reviewed-on: http://codereview.qt.nokia.com/3470 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Be more consistent when including private headers.Jason McDonald2011-08-291-3/+1
| | | | | | | Change-Id: I0fdc014391ff34ba3be9501c2e73bd5357df1f5e Reviewed-on: http://codereview.qt.nokia.com/3467 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove mode parameter from QTestLog::addSkip().Jason McDonald2011-08-291-2/+1
| | | | | | | | | | The mode parameter is never used by the logging code, so there's little value in passing it there. Change-Id: Ibe2cbe5eaf457a7e3ffd3aea3a4be7c8278c91b6 Reviewed-on: http://codereview.qt.nokia.com/3547 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Fix typo in enum name.Jason McDonald2011-08-291-2/+2
| | | | | | | Change-Id: I2eccbd3b9dd31aa5e869d622055f9235f90c0c03 Reviewed-on: http://codereview.qt.nokia.com/3445 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Fix minor formatting issues.Jason McDonald2011-08-291-7/+7
| | | | | | | Change-Id: I66767e906c54988ca0d0e2823b1a396993ba06f2 Reviewed-on: http://codereview.qt.nokia.com/3624 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove circular dependency in testlib logging codeJason McDonald2011-08-291-2/+2
| | | | | | | | | | | Pass the output file name from the QTestLog to the test logger when commencing logging rather than having the logger call back into the QTestLog. Change-Id: Id484635f9fcfca08a66c92f3442887e9473b6f9b Reviewed-on: http://codereview.qt.nokia.com/3454 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update licenseheader text in source files for qtbase Qt moduleJyri Tahtela2011-05-241-17/+17
| | | | | | | Updated version of LGPL and FDL licenseheaders. Apply release phase licenseheaders for all source files. Reviewed-by: Trust Me
* Initial import from the monolithic Qt.Qt by Nokia2011-04-271-0/+393
This is the beginning of revision history for this module. If you want to look at revision history older than this, please refer to the Qt Git wiki for how to use Git history grafting. At the time of writing, this wiki is located here: http://qt.gitorious.org/qt/pages/GitIntroductionWithQt If you have already performed the grafting and you don't see any history beyond this commit, try running "git log" with the "--follow" argument. Branched from the monolithic repo, Qt master branch, at commit 896db169ea224deb96c59ce8af800d019de63f12