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