tests(readme): Use skeptic to test the readme
This commit is contained in:
parent
84fa3fba58
commit
22d0bdae8a
@ -8,17 +8,27 @@ repository = "https://github.com/serde-rs/serde"
|
|||||||
documentation = "https://github.com/serde-rs/serde"
|
documentation = "https://github.com/serde-rs/serde"
|
||||||
keywords = ["serde", "serialization"]
|
keywords = ["serde", "serialization"]
|
||||||
include = ["Cargo.toml", "src/**/*.rs"]
|
include = ["Cargo.toml", "src/**/*.rs"]
|
||||||
|
build = "build.rs"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
name = "serde_macros"
|
name = "serde_macros"
|
||||||
plugin = true
|
plugin = true
|
||||||
|
|
||||||
[features]
|
[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]
|
[dependencies]
|
||||||
clippy = { version = "^0.*", optional = true }
|
clippy = { version = "^0.*", optional = true }
|
||||||
serde_codegen = { version = "=0.8.0", default-features = false, features = ["unstable"] }
|
serde_codegen = { version = "=0.8.0", default-features = false, features = ["unstable"] }
|
||||||
|
skeptic = { version = "^0.6.0", optional = true }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
clippy = "^0.*"
|
clippy = "^0.*"
|
||||||
|
17
serde_macros/build.rs
Normal file
17
serde_macros/build.rs
Normal 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()
|
||||||
|
}
|
3
serde_macros/tests/skeptic.rs
Normal file
3
serde_macros/tests/skeptic.rs
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
#![cfg(feature = "nightly-testing")]
|
||||||
|
|
||||||
|
include!(concat!(env!("OUT_DIR"), "/skeptic-tests.rs"));
|
@ -6,3 +6,4 @@ extern crate test;
|
|||||||
include!("../../testing/tests/test.rs.in");
|
include!("../../testing/tests/test.rs.in");
|
||||||
|
|
||||||
mod compile_tests;
|
mod compile_tests;
|
||||||
|
mod skeptic;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user