forked from cobalt-org/liquid-rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Markdown parsers and more are foited onto clients because of Skeptic. This is inspired by the conversation at budziq/rust-skeptic#60 regarding a "skeptic-lite" using rustdoc.
- Loading branch information
Showing
5 changed files
with
44 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,39 @@ | ||
include!(concat!(env!("OUT_DIR"), "/skeptic-tests.rs")); | ||
use std::env; | ||
use std::env::consts::EXE_EXTENSION; | ||
use std::path::Path; | ||
use std::process::Command; | ||
|
||
#[test] | ||
fn readme_test() { | ||
let rustdoc = Path::new("rustdoc").with_extension(EXE_EXTENSION); | ||
let readme = Path::new(file!()) | ||
.parent() | ||
.unwrap() | ||
.parent() | ||
.unwrap() | ||
.join("README.md"); | ||
let exe = env::current_exe().unwrap(); | ||
let depdir = exe.parent().unwrap(); | ||
let outdir = depdir.parent().unwrap(); | ||
let extern_arg = format!( | ||
"read_process_memory={}", | ||
outdir.join("libread_process_memory.rlib").to_string_lossy() | ||
); | ||
let mut cmd = Command::new(rustdoc); | ||
cmd.args(&["--verbose", "--test", "-L"]) | ||
.arg(&outdir) | ||
.arg("-L") | ||
.arg(&depdir) | ||
.arg("--extern") | ||
.arg(&extern_arg) | ||
.arg(&readme); | ||
println!("Running `{:?}`", cmd); | ||
let result = cmd.spawn() | ||
.expect("Failed to spawn process") | ||
.wait() | ||
.expect("Failed to run process"); | ||
assert!( | ||
result.success(), | ||
"Failed to run rustdoc tests on README.md!" | ||
); | ||
} |