about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2024-05-23 23:39:28 +0200
committerGitHub <noreply@github.com>2024-05-23 23:39:28 +0200
commit0de052acd8b7c475a17cfb0dc91b8bd95b5cdc2a (patch)
treefb78ed6b5a19bb478a96ef04e730193041b81d1f
parent56427d337265967e99172f5b24867a7fa78ac383 (diff)
parentde644626c3789e62d24bb90873bdc1b41b5f6db2 (diff)
downloadrust-0de052acd8b7c475a17cfb0dc91b8bd95b5cdc2a.tar.gz
rust-0de052acd8b7c475a17cfb0dc91b8bd95b5cdc2a.zip
Rollup merge of #125445 - GuillaumeGomez:rustdoc-migrate-short-out-dir, r=jieyouxu
Migrate `run-make/rustdoc-with-short-out-dir-option` to `rmake.rs`

Part of https://github.com/rust-lang/rust/issues/121876.

r? `@jieyouxu`
-rw-r--r--src/tools/tidy/src/allowed_run_make_makefiles.txt1
-rw-r--r--tests/run-make/rustdoc-with-short-out-dir-option/Makefile8
-rw-r--r--tests/run-make/rustdoc-with-short-out-dir-option/rmake.rs16
3 files changed, 16 insertions, 9 deletions
diff --git a/src/tools/tidy/src/allowed_run_make_makefiles.txt b/src/tools/tidy/src/allowed_run_make_makefiles.txt
index 17546e242bd..ad900ce0386 100644
--- a/src/tools/tidy/src/allowed_run_make_makefiles.txt
+++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt
@@ -229,7 +229,6 @@ run-make/rustc-macro-dep-files/Makefile
 run-make/rustdoc-io-error/Makefile
 run-make/rustdoc-verify-output-files/Makefile
 run-make/rustdoc-with-output-option/Makefile
-run-make/rustdoc-with-short-out-dir-option/Makefile
 run-make/sanitizer-cdylib-link/Makefile
 run-make/sanitizer-dylib-link/Makefile
 run-make/sanitizer-staticlib-link/Makefile
diff --git a/tests/run-make/rustdoc-with-short-out-dir-option/Makefile b/tests/run-make/rustdoc-with-short-out-dir-option/Makefile
deleted file mode 100644
index 1b9327bce22..00000000000
--- a/tests/run-make/rustdoc-with-short-out-dir-option/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
-include ../tools.mk
-
-OUTPUT_DIR := "$(TMPDIR)/rustdoc"
-
-all:
-	$(RUSTDOC) src/lib.rs --crate-name foobar --crate-type lib -o $(OUTPUT_DIR)
-
-	$(HTMLDOCCK) $(OUTPUT_DIR) src/lib.rs
diff --git a/tests/run-make/rustdoc-with-short-out-dir-option/rmake.rs b/tests/run-make/rustdoc-with-short-out-dir-option/rmake.rs
new file mode 100644
index 00000000000..6206173ecf1
--- /dev/null
+++ b/tests/run-make/rustdoc-with-short-out-dir-option/rmake.rs
@@ -0,0 +1,16 @@
+use run_make_support::{htmldocck, rustdoc, tmp_dir};
+
+fn main() {
+    let out_dir = tmp_dir().join("rustdoc");
+
+    rustdoc()
+        .input("src/lib.rs")
+        .crate_name("foobar")
+        .crate_type("lib")
+        // This is intentionally using `-o` option flag and not the `output()` method.
+        .arg("-o")
+        .arg(&out_dir)
+        .run();
+
+    assert!(htmldocck().arg(out_dir).arg("src/lib.rs").status().unwrap().success());
+}