pub(crate) fn run<F>(mut self, config: &Config, f: F)
    where
        F: FnOnce() + Send + 'static,
    {
        let state = RefCell::new(ExecutionState::new(
            config.clone(),
            Rc::clone(&self.scheduler),
            self.initial_schedule.clone(),
        ));

        EXECUTION_STATE.set(&state, move || {
            // Spawn `f` as the first task
            ExecutionState::spawn_thread(f, config.stack_size, None);

            // Run the test to completion
            while self.step(config) {}

            // Cleanup the state before it goes out of `EXECUTION_STATE` scope
            ExecutionState::cleanup();
        });
    }
/// Run a function to be tested, taking control of scheduling it and any tasks it might spawn.
/// This function runs until `f` and all tasks spawned by `f` have terminated, or until the
/// scheduler returns `None`, indicating the execution should not be explored any further.
Run a function to be tested, taking control of scheduling it and any tasks it might spawn.
Run a function to be tested taking control of scheduling it and any tasks it might spawn .
pub(crate) fn run<F>(mut self, config: &Config, f: F)
    where
        F: FnOnce() + Send + 'static,
    {
        let state = RefCell::new(ExecutionState::new(
            config.clone(),
            Rc::clone(&self.scheduler),
            self.initial_schedule.clone(),
        ));
        EXECUTION_STATE.set(&state, move || {
            // Spawn `f` as the first task
            ExecutionState::spawn_thread(f, config.stack_size, None);
            // Run the test to completion
            while self.step(config) {}
            // Cleanup the state before it goes out of `EXECUTION_STATE` scope
            ExecutionState::cleanup();
        });
    }
pub ( crate ) fn run < F > ( mut self , config : & Config , f : F ) where F : FnOnce ( ) + Send + ' static , { let state = RefCell :: new ( ExecutionState :: new ( config . clone ( ) , Rc :: clone ( & self . scheduler ) , self . initial_schedule . clone ( ) , ) ) ; EXECUTION_STATE . set ( & state , move | | { // Spawn `f` as the first task ExecutionState :: spawn_thread ( f , config . stack_size , None ) ; // Run the test to completion while self . step ( config ) { } // Cleanup the state before it goes out of `EXECUTION_STATE` scope ExecutionState :: cleanup ( ) ; } ) ; }
Run a function to be tested, taking control of scheduling it and any tasks it might spawn.
Run a function to be tested taking control of scheduling it and any tasks it might spawn .
mut self
config
&Config
f
F
mut self
config
&Config
f
F