Disable the compare tests when the compare feature is disabled.
This commit is contained in:
parent
28aca041f7
commit
e9480fd156
12
build.rs
12
build.rs
@ -1,10 +1,16 @@
|
||||
#[cfg(feature = "compare")]
|
||||
use std::env;
|
||||
#[cfg(feature = "compare")]
|
||||
use std::fs::File;
|
||||
#[cfg(feature = "compare")]
|
||||
use std::io::Write;
|
||||
#[cfg(feature = "compare")]
|
||||
use std::path::Path;
|
||||
|
||||
#[cfg(feature = "compare")]
|
||||
use walkdir::WalkDir;
|
||||
|
||||
#[cfg(feature = "compare")]
|
||||
fn main() {
|
||||
let out_dir = env::var("OUT_DIR").unwrap();
|
||||
let destination = Path::new(&out_dir).join("tests.rs");
|
||||
@ -31,6 +37,10 @@ fn main() {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "compare"))]
|
||||
fn main() {}
|
||||
|
||||
#[cfg(feature = "compare")]
|
||||
fn write_test(test_file: &mut File, test: &walkdir::DirEntry) {
|
||||
let test_name = test
|
||||
.path()
|
||||
@ -55,6 +65,7 @@ fn write_test(test_file: &mut File, test: &walkdir::DirEntry) {
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
#[cfg(feature = "compare")]
|
||||
fn write_header(test_file: &mut File) {
|
||||
write!(
|
||||
test_file,
|
||||
@ -70,6 +81,7 @@ use organic::parser::sexp::sexp_with_padding;
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
#[cfg(feature = "compare")]
|
||||
fn is_expect_fail(name: &str) -> Option<&str> {
|
||||
match name {
|
||||
"autogen_greater_element_drawer_drawer_with_headline_inside" => Some("Apparently lines with :end: become their own paragraph. This odd behavior needs to be investigated more."),
|
||||
|
@ -1 +1,2 @@
|
||||
#[cfg(feature = "compare")]
|
||||
include!(concat!(env!("OUT_DIR"), "/tests.rs"));
|
||||
|
Loading…
Reference in New Issue
Block a user