You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: test_manager.rs
    path of file: ./repos/youki/tests/contest/test_framework/src
    
    the code of the file until where you have to start completion: //! This exposes the main control wrapper to control the tests
use crate::testable::{TestResult, TestableGroup};
use anyhow::Result;
use crossbeam::thread;
use std::collections::BTreeMap;

type TestableGroupType = dyn TestableGroup + Sync + Send;

/// This manages all test groups, and thus the tests
pub struct TestManager {
    test_groups
    
    pub fn run_all(&self) {
        thread::scope(|s| {
            let mut collector = Vec::with_capacity(self.test_groups.len());
            for (name, tg) in &self.test_groups {
                let r = s.spawn(move |_| tg.run_all());
                collector.push((name, r));
            }
            for (name, handle) in collector {
                self.print_test_result(name, &handle.join().unwrap());
            }
        })
        .unwrap();
        for cleaner in &self.cleanup {
            if let Err(e) = cleaner() {
                print!("Failed to cleanup: {e}");
            }
        }
    }