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 {
46 /// Whether ignored test should be run or not
47 #[derive(Copy, Clone, Debug, PartialEq, Eq)]
51 /// Run only ignored tests
55 #[derive(Clone, Copy)]
56 pub enum RunStrategy {
57 /// Runs the test in the current process, and sends the result back over the
61 /// Spawns a subprocess to run the test, and sends the result back over the
62 /// supplied channel. Requires `argv[0]` to exist and point to the binary
63 /// that's currently running.
67 /// Options for the test run defined by the caller (instead of CLI arguments).
68 /// In case we want to add other options as well, just add them in this struct.
69 #[derive(Copy, Clone, Debug)]
71 pub display_output: bool,
72 pub panic_abort: bool,
76 pub fn new() -> Options {
77 Options { display_output: false, panic_abort: false }
80 pub fn display_output(mut self, display_output: bool) -> Options {
81 self.display_output = display_output;
85 pub fn panic_abort(mut self, panic_abort: bool) -> Options {
86 self.panic_abort = panic_abort;