1 //! Enums denoting options for test execution.
3 /// Number of times to run a benchmarked function
4 #[derive(Clone, PartialEq, Eq)]
10 /// Whether test is expected to panic or not
11 #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
12 pub enum ShouldPanic {
15 YesWithMessage(&'static str),
18 /// Whether should console output be colored or not
19 #[derive(Copy, Clone, Debug)]
20 pub enum ColorConfig {
26 /// Format of the test results output
27 #[derive(Copy, Clone, Debug, PartialEq, Eq)]
28 pub enum OutputFormat {
39 /// Whether ignored test should be run or not
40 #[derive(Copy, Clone, Debug, PartialEq, Eq)]
44 /// Run only ignored tests
48 #[derive(Clone, Copy)]
49 pub enum RunStrategy {
50 /// Runs the test in the current process, and sends the result back over the
54 /// Spawns a subprocess to run the test, and sends the result back over the
55 /// supplied channel. Requires `argv[0]` to exist and point to the binary
56 /// that's currently running.
60 /// Options for the test run defined by the caller (instead of CLI arguments).
61 /// In case we want to add other options as well, just add them in this struct.
62 #[derive(Copy, Clone, Debug)]
64 pub display_output: bool,
65 pub panic_abort: bool,
69 pub fn new() -> Options {
70 Options { display_output: false, panic_abort: false }
73 pub fn display_output(mut self, display_output: bool) -> Options {
74 self.display_output = display_output;
78 pub fn panic_abort(mut self, panic_abort: bool) -> Options {
79 self.panic_abort = panic_abort;