About rmake tests
This commit is contained in:
parent
a19a8f8e52
commit
d562a4a510
@ -12,5 +12,5 @@
|
|||||||
fn main() {
|
fn main() {
|
||||||
rustc().input("foo.rs").run();
|
rustc().input("foo.rs").run();
|
||||||
rustc().input("bar.rs").run();
|
rustc().input("bar.rs").run();
|
||||||
rustdoc().input("baz.rs").library_search_path(cwd()).output(cwd()).run();
|
rustdoc().input("baz.rs").library_search_path(cwd()).out_dir(cwd()).run();
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@ fn main() {
|
|||||||
rustdoc()
|
rustdoc()
|
||||||
.arg("-Zunstable-options")
|
.arg("-Zunstable-options")
|
||||||
.arg("--emit=invocation-specific")
|
.arg("--emit=invocation-specific")
|
||||||
.output("invocation-only")
|
.out_dir("invocation-only")
|
||||||
.arg("--resource-suffix=-xxx")
|
.arg("--resource-suffix=-xxx")
|
||||||
.args(&["--theme", "y.css"])
|
.args(&["--theme", "y.css"])
|
||||||
.args(&["--extend-css", "z.css"])
|
.args(&["--extend-css", "z.css"])
|
||||||
@ -34,7 +34,7 @@ fn main() {
|
|||||||
rustdoc()
|
rustdoc()
|
||||||
.arg("-Zunstable-options")
|
.arg("-Zunstable-options")
|
||||||
.arg("--emit=toolchain-shared-resources")
|
.arg("--emit=toolchain-shared-resources")
|
||||||
.output("toolchain-only")
|
.out_dir("toolchain-only")
|
||||||
.arg("--resource-suffix=-xxx")
|
.arg("--resource-suffix=-xxx")
|
||||||
.args(&["--extend-css", "z.css"])
|
.args(&["--extend-css", "z.css"])
|
||||||
.input("x.rs")
|
.input("x.rs")
|
||||||
@ -68,7 +68,7 @@ fn main() {
|
|||||||
rustdoc()
|
rustdoc()
|
||||||
.arg("-Zunstable-options")
|
.arg("-Zunstable-options")
|
||||||
.arg("--emit=toolchain-shared-resources,unversioned-shared-resources")
|
.arg("--emit=toolchain-shared-resources,unversioned-shared-resources")
|
||||||
.output("all-shared")
|
.out_dir("all-shared")
|
||||||
.arg("--resource-suffix=-xxx")
|
.arg("--resource-suffix=-xxx")
|
||||||
.args(&["--extend-css", "z.css"])
|
.args(&["--extend-css", "z.css"])
|
||||||
.input("x.rs")
|
.input("x.rs")
|
||||||
|
@ -16,7 +16,7 @@ fn main() {
|
|||||||
.run_fail()
|
.run_fail()
|
||||||
.assert_exit_code(101);
|
.assert_exit_code(101);
|
||||||
|
|
||||||
rustdoc().arg("success.rs").output("exit-code").run();
|
rustdoc().arg("success.rs").out_dir("exit-code").run();
|
||||||
|
|
||||||
rustdoc().arg("--invalid-arg-foo").run_fail().assert_exit_code(1);
|
rustdoc().arg("--invalid-arg-foo").run_fail().assert_exit_code(1);
|
||||||
|
|
||||||
|
@ -7,12 +7,12 @@
|
|||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let foo_first = Path::new("foo_first");
|
let foo_first = Path::new("foo_first");
|
||||||
rustdoc().input("foo.rs").output(&foo_first).run();
|
rustdoc().input("foo.rs").out_dir(&foo_first).run();
|
||||||
rustdoc().input("bar.rs").output(&foo_first).run();
|
rustdoc().input("bar.rs").out_dir(&foo_first).run();
|
||||||
|
|
||||||
let bar_first = Path::new("bar_first");
|
let bar_first = Path::new("bar_first");
|
||||||
rustdoc().input("bar.rs").output(&bar_first).run();
|
rustdoc().input("bar.rs").out_dir(&bar_first).run();
|
||||||
rustdoc().input("foo.rs").output(&bar_first).run();
|
rustdoc().input("foo.rs").out_dir(&bar_first).run();
|
||||||
|
|
||||||
diff()
|
diff()
|
||||||
.expected_file(foo_first.join("search-index.js"))
|
.expected_file(foo_first.join("search-index.js"))
|
||||||
|
@ -25,7 +25,7 @@ fn main() {
|
|||||||
permissions.set_readonly(true);
|
permissions.set_readonly(true);
|
||||||
rfs::set_permissions(&out_dir, permissions);
|
rfs::set_permissions(&out_dir, permissions);
|
||||||
|
|
||||||
let output = rustdoc().input("foo.rs").output(&out_dir).env("RUST_BACKTRACE", "1").run_fail();
|
let output = rustdoc().input("foo.rs").out_dir(&out_dir).env("RUST_BACKTRACE", "1").run_fail();
|
||||||
|
|
||||||
rfs::set_permissions(&out_dir, original_permissions);
|
rfs::set_permissions(&out_dir, original_permissions);
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ fn main() {
|
|||||||
.input("foo.rs")
|
.input("foo.rs")
|
||||||
.arg("-Zunstable-options")
|
.arg("-Zunstable-options")
|
||||||
.arg("--generate-redirect-map")
|
.arg("--generate-redirect-map")
|
||||||
.output(&out_dir)
|
.out_dir(&out_dir)
|
||||||
.run();
|
.run();
|
||||||
// FIXME (GuillaumeGomez): Port the python script to Rust as well.
|
// FIXME (GuillaumeGomez): Port the python script to Rust as well.
|
||||||
python_command().arg("validate_json.py").arg(&out_dir).run();
|
python_command().arg("validate_json.py").arg(&out_dir).run();
|
||||||
|
@ -6,6 +6,6 @@
|
|||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let out_dir = Path::new("foo/bar/doc");
|
let out_dir = Path::new("foo/bar/doc");
|
||||||
rustdoc().input("foo.rs").output(&out_dir).run();
|
rustdoc().input("foo.rs").out_dir(&out_dir).run();
|
||||||
assert!(out_dir.exists());
|
assert!(out_dir.exists());
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ fn main() {
|
|||||||
// First we check that we generate the JSON in the stdout.
|
// First we check that we generate the JSON in the stdout.
|
||||||
rustdoc()
|
rustdoc()
|
||||||
.input("foo.rs")
|
.input("foo.rs")
|
||||||
.output("-")
|
.out_dir("-")
|
||||||
.arg("-Zunstable-options")
|
.arg("-Zunstable-options")
|
||||||
.output_format("json")
|
.output_format("json")
|
||||||
.run()
|
.run()
|
||||||
|
@ -35,7 +35,7 @@ fn main() {
|
|||||||
.input("examples/ex.rs")
|
.input("examples/ex.rs")
|
||||||
.crate_name("ex")
|
.crate_name("ex")
|
||||||
.crate_type("bin")
|
.crate_type("bin")
|
||||||
.output(&out_dir)
|
.out_dir(&out_dir)
|
||||||
.extern_(crate_name, rust_lib_name(crate_name))
|
.extern_(crate_name, rust_lib_name(crate_name))
|
||||||
.extern_(proc_crate_name, dylib_name.trim())
|
.extern_(proc_crate_name, dylib_name.trim())
|
||||||
.arg("-Zunstable-options")
|
.arg("-Zunstable-options")
|
||||||
@ -49,7 +49,7 @@ fn main() {
|
|||||||
.input("src/lib.rs")
|
.input("src/lib.rs")
|
||||||
.crate_name(crate_name)
|
.crate_name(crate_name)
|
||||||
.crate_type("lib")
|
.crate_type("lib")
|
||||||
.output(&out_dir)
|
.out_dir(&out_dir)
|
||||||
.arg("-Zunstable-options")
|
.arg("-Zunstable-options")
|
||||||
.arg("--with-examples")
|
.arg("--with-examples")
|
||||||
.arg(&ex_dir)
|
.arg(&ex_dir)
|
||||||
|
@ -20,7 +20,7 @@ pub fn scrape(extra_args: &[&str]) {
|
|||||||
.input(&dep)
|
.input(&dep)
|
||||||
.crate_name(&dep_stem)
|
.crate_name(&dep_stem)
|
||||||
.crate_type("bin")
|
.crate_type("bin")
|
||||||
.output(&out_dir)
|
.out_dir(&out_dir)
|
||||||
.extern_(crate_name, format!("lib{crate_name}.rmeta"))
|
.extern_(crate_name, format!("lib{crate_name}.rmeta"))
|
||||||
.arg("-Zunstable-options")
|
.arg("-Zunstable-options")
|
||||||
.arg("--scrape-examples-output-path")
|
.arg("--scrape-examples-output-path")
|
||||||
@ -35,7 +35,7 @@ pub fn scrape(extra_args: &[&str]) {
|
|||||||
let mut rustdoc = rustdoc();
|
let mut rustdoc = rustdoc();
|
||||||
rustdoc
|
rustdoc
|
||||||
.input("src/lib.rs")
|
.input("src/lib.rs")
|
||||||
.output(&out_dir)
|
.out_dir(&out_dir)
|
||||||
.crate_name(crate_name)
|
.crate_name(crate_name)
|
||||||
.crate_type("lib")
|
.crate_type("lib")
|
||||||
.arg("-Zunstable-options");
|
.arg("-Zunstable-options");
|
||||||
|
@ -7,7 +7,7 @@ fn main() {
|
|||||||
rustc().crate_type("lib").input("dummy_core.rs").target("target.json").run();
|
rustc().crate_type("lib").input("dummy_core.rs").target("target.json").run();
|
||||||
rustdoc()
|
rustdoc()
|
||||||
.input("my_crate.rs")
|
.input("my_crate.rs")
|
||||||
.output(out_dir)
|
.out_dir(out_dir)
|
||||||
.library_search_path(cwd())
|
.library_search_path(cwd())
|
||||||
.target("target.json")
|
.target("target.json")
|
||||||
.run();
|
.run();
|
||||||
|
@ -27,6 +27,6 @@ fn main() {
|
|||||||
rfs::create_dir_all(&out_dir);
|
rfs::create_dir_all(&out_dir);
|
||||||
rfs::write(&test_css, test_content);
|
rfs::write(&test_css, test_content);
|
||||||
|
|
||||||
rustdoc().output(&out_dir).input("foo.rs").arg("--theme").arg(&test_css).run();
|
rustdoc().out_dir(&out_dir).input("foo.rs").arg("--theme").arg(&test_css).run();
|
||||||
htmldocck().arg(out_dir).arg("foo.rs").run();
|
htmldocck().arg(out_dir).arg("foo.rs").run();
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,6 @@
|
|||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let out_dir = "rustdoc";
|
let out_dir = "rustdoc";
|
||||||
rustdoc().input("src/lib.rs").crate_name("foobar").crate_type("lib").output(&out_dir).run();
|
rustdoc().input("src/lib.rs").crate_name("foobar").crate_type("lib").out_dir(&out_dir).run();
|
||||||
htmldocck().arg(out_dir).arg("src/lib.rs").run();
|
htmldocck().arg(out_dir).arg("src/lib.rs").run();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user