From fa4a93e051b4fdec5ca6e82db19ec6ecbd305d0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Wed, 15 Apr 2020 16:19:54 +0200 Subject: [PATCH] Update documentation for --order --- docs/command-line.md | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/docs/command-line.md b/docs/command-line.md index 51eeb2f6..2b506f16 100644 --- a/docs/command-line.md +++ b/docs/command-line.md @@ -243,15 +243,23 @@ This option lists all available tests in a non-indented form, one on each line. Test cases are ordered one of three ways: - ### decl -Declaration order (this is the default order if no --order argument is provided). The order the tests were originally declared in. Note that ordering between files is not guaranteed and is implementation dependent. +Declaration order (this is the default order if no --order argument is provided). +Tests in the same TU are sorted using their declaration orders, different +TUs are in an implementation (linking) dependent order. + ### lex -Lexicographically sorted. Tests are sorted, alpha-numerically, by name. +Lexicographic order. Tests are sorted by their name, their tags are ignored. + ### rand -Randomly sorted. Test names are sorted using ```std::random_shuffle()```. By default the random number generator is seeded with 0 - and so the order is repeatable. To control the random seed see rng-seed. + +Randomly sorted. The order is dependent on Catch2's random seed (see +[`--rng-seed`](#rng-seed)), and is subset invariant. What this means +is that as long as the random seed is fixed, running only some tests +(e.g. via tag) does not change their relative order. + ## Specify a seed for the Random Number Generator