diff options
author | Jason McDonald <jason.mcdonald@nokia.com> | 2011-08-29 16:50:52 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-08-31 03:44:17 +0200 |
commit | 527317748d00739994e3865b8f4e2525fc3ca2c7 (patch) | |
tree | 1cf509b1f0ea6bac9b878e6d079d49143813aa2c /src/testlib/qplaintestlogger_p.h | |
parent | 9be3851eb948a2e7a52273b222334e29d82fa437 (diff) |
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>
Diffstat (limited to 'src/testlib/qplaintestlogger_p.h')
-rw-r--r-- | src/testlib/qplaintestlogger_p.h | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/testlib/qplaintestlogger_p.h b/src/testlib/qplaintestlogger_p.h index 5fa33e6b51..baa1e24828 100644 --- a/src/testlib/qplaintestlogger_p.h +++ b/src/testlib/qplaintestlogger_p.h @@ -75,11 +75,8 @@ public: void addMessage(MessageTypes type, const char *message, const char *file = 0, int line = 0); - void registerRandomSeed(unsigned int seed); -private: - unsigned int randomSeed; - bool hasRandomSeed; +private: void printMessage(const char *type, const char *msg, const char *file = 0, int line = 0); void outputMessage(const char *str); void printBenchmarkResult(const QBenchmarkResult &result); |