summaryrefslogtreecommitdiffstats
path: root/src/test/ui/custom_test_frameworks/auxiliary/example_runner.rs
blob: dd68c0685ace082ba0767d3d3df256ac0bfc1cdd (plain)
1
2
3
4
5
6
7
8
9
10
pub trait Testable {
    fn name(&self) -> String;
    fn run(&self) -> Option<String>; // None will be success, Some is the error message
}

pub fn runner(tests: &[&dyn Testable]) {
    for t in tests {
        print!("{}........{}", t.name(), t.run().unwrap_or_else(|| "SUCCESS".to_string()));
    }
}