2 // aux-build:dynamic_runner.rs
3 // compile-flags:--test
4 #![feature(custom_test_frameworks)]
5 #![test_runner(dynamic_runner::runner)]
7 extern crate dynamic_runner;
9 pub struct AllFoo(&'static str);
12 impl dynamic_runner::Testable for AllFoo {
13 fn name(&self) -> String {
17 fn subtests(&self) -> Vec<Box<dyn dynamic_runner::Testable>> {
18 self.0.split(" ").map(|word|
19 Box::new(IsFoo(word.into())) as Box<dyn dynamic_runner::Testable>
24 impl dynamic_runner::Testable for IsFoo {
25 fn name(&self) -> String {
29 fn run(&self) -> bool {
35 const TEST_2: AllFoo = AllFoo("foo foo");