2017-10-26 06:12:23 -07:00
|
|
|
extern crate skeptic;
|
2017-11-24 10:28:43 -08:00
|
|
|
extern crate version_check;
|
|
|
|
|
2017-10-26 06:12:23 -07:00
|
|
|
use std::{env, fs};
|
|
|
|
|
|
|
|
|
|
|
|
#[cfg(unix)]
|
|
|
|
fn main() {
|
2017-11-28 12:44:59 -08:00
|
|
|
let f = env::var("OUT_DIR").unwrap() + "/skeptic-tests.rs";
|
2017-10-26 06:12:23 -07:00
|
|
|
if env::var("USE_SKEPTIC").is_ok() {
|
2017-11-28 12:44:59 -08:00
|
|
|
let _ = fs::remove_file(f);
|
2017-10-26 06:12:23 -07:00
|
|
|
// generates doc tests for `README.md`.
|
2017-11-28 12:44:59 -08:00
|
|
|
skeptic::generate_doc_tests(
|
|
|
|
&["README.md",
|
2017-12-03 14:22:04 -08:00
|
|
|
"guide/src/qs_1.md",
|
2017-11-28 12:44:59 -08:00
|
|
|
"guide/src/qs_2.md",
|
|
|
|
"guide/src/qs_3.md",
|
2017-12-13 21:38:47 -08:00
|
|
|
"guide/src/qs_3_5.md",
|
2017-12-03 14:22:04 -08:00
|
|
|
"guide/src/qs_4.md",
|
2017-12-08 15:25:37 -08:00
|
|
|
"guide/src/qs_4_5.md",
|
2017-12-03 14:22:04 -08:00
|
|
|
"guide/src/qs_5.md",
|
|
|
|
"guide/src/qs_7.md",
|
2017-12-26 17:14:37 -08:00
|
|
|
"guide/src/qs_8.md",
|
2017-12-03 14:22:04 -08:00
|
|
|
"guide/src/qs_9.md",
|
|
|
|
"guide/src/qs_10.md",
|
|
|
|
"guide/src/qs_12.md",
|
|
|
|
"guide/src/qs_13.md",
|
2017-11-28 12:44:59 -08:00
|
|
|
]);
|
2017-10-26 06:12:23 -07:00
|
|
|
} else {
|
|
|
|
let _ = fs::File::create(f);
|
|
|
|
}
|
2017-11-24 10:28:43 -08:00
|
|
|
|
|
|
|
match version_check::is_nightly() {
|
|
|
|
Some(true) => println!("cargo:rustc-cfg=actix_nightly"),
|
|
|
|
Some(false) => (),
|
|
|
|
None => (),
|
|
|
|
};
|
2017-10-26 06:12:23 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(not(unix))]
|
|
|
|
fn main() {
|
2017-11-24 10:28:43 -08:00
|
|
|
match version_check::is_nightly() {
|
|
|
|
Some(true) => println!("cargo:rustc-cfg=actix_nightly"),
|
|
|
|
Some(false) => (),
|
|
|
|
None => (),
|
|
|
|
};
|
2017-10-26 06:12:23 -07:00
|
|
|
}
|