Remove ability to run tests in random order.
authorJason McDonald <jason.mcdonald@nokia.com>
Mon, 29 Aug 2011 06:50:52 +0000 (16:50 +1000)
committerQt by Nokia <qt-info@nokia.com>
Wed, 31 Aug 2011 01:44:17 +0000 (03:44 +0200)
commit527317748d00739994e3865b8f4e2525fc3ca2c7
tree1cf509b1f0ea6bac9b878e6d079d49143813aa2c
parent9be3851eb948a2e7a52273b222334e29d82fa437
Remove ability to run tests in random order.

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>
12 files changed:
src/testlib/qabstracttestlogger_p.h
src/testlib/qplaintestlogger.cpp
src/testlib/qplaintestlogger_p.h
src/testlib/qtestcase.cpp
src/testlib/qtestlightxmlstreamer.cpp
src/testlib/qtestlog.cpp
src/testlib/qtestlog_p.h
src/testlib/qtestlogger.cpp
src/testlib/qtestlogger_p.h
src/testlib/qtestxmlstreamer.cpp
src/testlib/qxmltestlogger.cpp
src/testlib/qxmltestlogger_p.h