Add support for marking integration tests as expected to fail.
This commit is contained in:
parent
c6fd04e9ce
commit
35aab10155
26
build.rs
26
build.rs
@ -22,17 +22,28 @@ fn main() {
|
|||||||
.unwrap_or(false)
|
.unwrap_or(false)
|
||||||
}
|
}
|
||||||
Err(_) => true,
|
Err(_) => true,
|
||||||
}).collect::<Result<Vec<_>, _>>().unwrap();
|
})
|
||||||
|
.collect::<Result<Vec<_>, _>>()
|
||||||
|
.unwrap();
|
||||||
for test in test_files {
|
for test in test_files {
|
||||||
write_test(&mut test_file, &test);
|
write_test(&mut test_file, &test);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn write_test(test_file: &mut File, test: &walkdir::DirEntry) {
|
fn write_test(test_file: &mut File, test: &walkdir::DirEntry) {
|
||||||
let test_name = test.path().strip_prefix("org_mode_samples/").expect("Paths should be under org_mode_samples/").to_string_lossy().to_lowercase().strip_suffix(".org").expect("Should have .org extension").replace("/", "_");
|
let test_name = test
|
||||||
|
.path()
|
||||||
|
.strip_prefix("org_mode_samples/")
|
||||||
|
.expect("Paths should be under org_mode_samples/")
|
||||||
|
.to_string_lossy()
|
||||||
|
.to_lowercase()
|
||||||
|
.strip_suffix(".org")
|
||||||
|
.expect("Should have .org extension")
|
||||||
|
.replace("/", "_");
|
||||||
|
|
||||||
|
if let Some(reason) = is_expect_fail(test_name.as_str()) {
|
||||||
|
write!(test_file, "#[ignore]\n").unwrap();
|
||||||
|
}
|
||||||
write!(
|
write!(
|
||||||
test_file,
|
test_file,
|
||||||
include_str!("./tests/test_template"),
|
include_str!("./tests/test_template"),
|
||||||
@ -56,3 +67,10 @@ use organic::sexp;
|
|||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn is_expect_fail(name: &str) -> Option<&str> {
|
||||||
|
match name {
|
||||||
|
"drawer_drawer_with_headline_inside" => Some("Apparently lines with :end: become their own paragraph. This odd behavior needs to be investigated more."),
|
||||||
|
_ => None,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user