2017-02-20 19:22:19 +00:00
|
|
|
extern crate skeptic;
|
2018-07-10 21:07:24 +00:00
|
|
|
extern crate walkdir;
|
2017-02-20 19:22:19 +00:00
|
|
|
|
2018-07-10 21:07:24 +00:00
|
|
|
use walkdir::WalkDir;
|
2017-02-25 07:52:30 +00:00
|
|
|
|
2018-07-11 20:13:51 +00:00
|
|
|
const REMOVED_TESTS: &[&str] = &[
|
|
|
|
"./src/web/clients/requests/header.md",
|
|
|
|
"./src/web/clients/api/rate-limited.md",
|
|
|
|
];
|
|
|
|
|
2017-02-20 19:22:19 +00:00
|
|
|
fn main() {
|
2018-07-10 21:07:24 +00:00
|
|
|
let paths = WalkDir::new("./src/").into_iter()
|
2017-02-25 18:12:41 +00:00
|
|
|
// convert paths to Strings
|
|
|
|
.map(|p| p.unwrap().path().to_str().unwrap().to_string())
|
|
|
|
// only compile markdown files
|
|
|
|
.filter(|p| p.ends_with(".md"))
|
2018-07-11 20:13:51 +00:00
|
|
|
.filter(|p| !REMOVED_TESTS.contains(&p.as_ref()))
|
2017-02-25 18:12:41 +00:00
|
|
|
.collect::<Vec<_>>();
|
2017-02-25 07:52:30 +00:00
|
|
|
|
2017-02-25 18:12:41 +00:00
|
|
|
skeptic::generate_doc_tests(&paths[..]);
|
2017-02-20 19:22:19 +00:00
|
|
|
}
|