Skip to content

Commit

Permalink
fix(tests): Fix the skeptic tests on stable rust
Browse files Browse the repository at this point in the history
  • Loading branch information
erickt committed Feb 27, 2016
1 parent c53ce95 commit 7bc9b0a
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 24 deletions.
6 changes: 3 additions & 3 deletions json_tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand All @@ -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"
Expand Down
19 changes: 4 additions & 15 deletions json_tests/build.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
extern crate skeptic;

#[cfg(feature = "with-syntex")]
mod with_syntex {
extern crate syntex;
Expand Down Expand Up @@ -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"]);
}
5 changes: 0 additions & 5 deletions json_tests/tests/skeptic.rs

This file was deleted.

9 changes: 9 additions & 0 deletions json_tests/tests/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}
1 change: 0 additions & 1 deletion json_tests/tests/test.rs.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
mod skeptic;
mod test_json;
mod test_json_builder;

0 comments on commit 7bc9b0a

Please sign in to comment.