tests(readme): Use skeptic to test the readme

This commit is contained in:
Erick Tryzelaar 2016-02-26 21:52:07 -08:00 committed by Oliver Schneider
parent 84fa3fba58
commit 22d0bdae8a
No known key found for this signature in database
GPG Key ID: 56D6EEA0FC67AC46
4 changed files with 32 additions and 1 deletions

View File

@ -8,17 +8,27 @@ repository = "https://github.com/serde-rs/serde"
documentation = "https://github.com/serde-rs/serde"
keywords = ["serde", "serialization"]
include = ["Cargo.toml", "src/**/*.rs"]
build = "build.rs"
[lib]
name = "serde_macros"
plugin = true
[features]
unstable-testing = ["clippy", "serde/unstable-testing", "serde_codegen/unstable-testing"]
unstable-testing = [
"clippy",
"skeptic",
"serde/unstable-testing",
"serde_codegen/unstable-testing"
]
[build-dependencies]
skeptic = { version = "^0.6.0", optional = true }
[dependencies]
clippy = { version = "^0.*", optional = true }
serde_codegen = { version = "=0.8.0", default-features = false, features = ["unstable"] }
skeptic = { version = "^0.6.0", optional = true }
[dev-dependencies]
clippy = "^0.*"

17
serde_macros/build.rs Normal file
View File

@ -0,0 +1,17 @@
#[cfg(feature = "nightly-testing")]
mod inner {
extern crate skeptic;
pub fn main() {
skeptic::generate_doc_tests(&["../README.md"]);
}
}
#[cfg(not(feature = "nightly-testing"))]
mod inner {
pub fn main() {}
}
fn main() {
inner::main()
}

View File

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

View File

@ -6,3 +6,4 @@ extern crate test;
include!("../../testing/tests/test.rs.in");
mod compile_tests;
mod skeptic;