1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
use crateTestMeta;
/// A strategy for assigning tests to groups.
///
/// The grouper maps each test to a `GroupKey`. The key is used by the grouped
/// harness to collect tests into groups. A `GroupKey` is typically something
/// small and cheap to clone, like a string, integer, or small enum. It should
/// at least support equality so the harness can decide which tests belong to
/// the same group.
///
/// In addition to the key, a grouper can optionally provide group context via
/// [`Self::group_ctx`]. This is meant for heavier or richer group data (for
/// example a display label or configuration) that we do not want to compute or
/// store on every test. The context type does not need to implement many traits.
///
/// For simple setups where no context is needed, `TestGrouper` is implemented
/// for `Fn(&TestMeta<Extra>) -> GroupKey`, so a closure can act as a grouper.