fix(tests): Fix the skeptic tests on stable rust

This commit is contained in:
Erick Tryzelaar 2016-02-26 22:41:58 -08:00
parent c53ce95dbb
commit 7bc9b0a98e
5 changed files with 16 additions and 24 deletions

View File

@ -7,12 +7,12 @@ build = "build.rs"
[features]
default = ["serde_macros"]
with-syntex = ["syntex", "serde_codegen"]
nightly-testing = ["clippy", "skeptic", "serde_json/clippy"]
nightly-testing = ["clippy", "serde_json/clippy"]
[build-dependencies]
syntex = { version = "*", optional = true }
serde_codegen = { version = "*", optional = true }
skeptic = { version = "^0.4.0", optional = true }
skeptic = "^0.4.0"
[dependencies]
clippy = { version = "^0.*", optional = true }
@ -21,7 +21,7 @@ rustc-serialize = "*"
serde = "*"
serde_json = { version = "*", path = "../json" }
serde_macros = { version = "*", optional = true }
skeptic = { version = "^0.4.0", optional = true }
skeptic = "^0.4.0"
[[test]]
name = "test"

View File

@ -1,3 +1,5 @@
extern crate skeptic;
#[cfg(feature = "with-syntex")]
mod with_syntex {
extern crate syntex;
@ -29,21 +31,8 @@ mod with_syntex {
pub fn main() {}
}
#[cfg(feature = "nightly-testing")]
mod nightly {
extern crate skeptic;
pub fn main() {
skeptic::generate_doc_tests(&["../README.md"]);
}
}
#[cfg(not(feature = "nightly-testing"))]
mod nightly {
pub fn main() {}
}
pub fn main() {
with_syntex::main();
nightly::main();
skeptic::generate_doc_tests(&["../README.md"]);
}

View File

@ -1,5 +0,0 @@
#![cfg(feature = "nightly-testing")]
#![allow(toplevel_ref_arg)]
#![allow(useless_format)]
include!(concat!(env!("OUT_DIR"), "/skeptic-tests.rs"));

View File

@ -6,9 +6,18 @@
extern crate serde;
extern crate serde_json;
extern crate skeptic;
#[cfg(feature = "with-syntex")]
include!(concat!(env!("OUT_DIR"), "/test.rs"));
#[cfg(not(feature = "with-syntex"))]
include!("test.rs.in");
#[cfg(feature = "nightly-testing")]
mod skeptic_tests {
#![cfg_attr(feature = "nightly-testing", allow(toplevel_ref_arg))]
#![cfg_attr(feature = "nightly-testing", allow(useless_format))]
include!(concat!(env!("OUT_DIR"), "/skeptic-tests.rs"));
}

View File

@ -1,3 +1,2 @@
mod skeptic;
mod test_json;
mod test_json_builder;