diff options
Diffstat (limited to 'third_party/rust/scroll/tests/readme.rs')
-rw-r--r-- | third_party/rust/scroll/tests/readme.rs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/third_party/rust/scroll/tests/readme.rs b/third_party/rust/scroll/tests/readme.rs new file mode 100644 index 0000000000..60cde57d9a --- /dev/null +++ b/third_party/rust/scroll/tests/readme.rs @@ -0,0 +1,29 @@ +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!("scroll={}", outdir.join("libscroll.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"); + // fixme: i dont know why this is failing, so disabling + // assert!(result.success(), "Failed to run rustdoc tests on README.md!"); +} |