summaryrefslogtreecommitdiffstats
path: root/tests/run-make/doctests-runtool
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:59:35 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:59:35 +0000
commitd1b2d29528b7794b41e66fc2136e395a02f8529b (patch)
treea4a17504b260206dec3cf55b2dca82929a348ac2 /tests/run-make/doctests-runtool
parentReleasing progress-linux version 1.72.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-d1b2d29528b7794b41e66fc2136e395a02f8529b.tar.xz
rustc-d1b2d29528b7794b41e66fc2136e395a02f8529b.zip
Merging upstream version 1.73.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/run-make/doctests-runtool')
-rw-r--r--tests/run-make/doctests-runtool/Makefile20
-rw-r--r--tests/run-make/doctests-runtool/runtool.rs3
-rw-r--r--tests/run-make/doctests-runtool/t.rs11
3 files changed, 34 insertions, 0 deletions
diff --git a/tests/run-make/doctests-runtool/Makefile b/tests/run-make/doctests-runtool/Makefile
new file mode 100644
index 000000000..7d5df1e30
--- /dev/null
+++ b/tests/run-make/doctests-runtool/Makefile
@@ -0,0 +1,20 @@
+# ignore-cross-compile
+include ../tools.mk
+
+# Tests behavior of rustdoc --runtool
+
+MY_SRC_DIR := ${CURDIR}
+
+all: with_test_run_directory
+
+# Behavior with --runtool with relative paths and --test-run-directory.
+with_test_run_directory:
+ mkdir -p $(TMPDIR)/rundir
+ mkdir -p $(TMPDIR)/runtool
+ $(RUSTC) --crate-type rlib t.rs
+ $(RUSTC) runtool.rs -o $(TMPDIR)/runtool/runtool
+ ( cd $(TMPDIR); \
+ $(RUSTDOC) -Zunstable-options --test --test-run-directory rundir \
+ --runtool runtool/runtool --extern t=libt.rlib $(MY_SRC_DIR)/t.rs \
+ )
+ rm -rf $(TMPDIR)/rundir $(TMPDIR)/runtool
diff --git a/tests/run-make/doctests-runtool/runtool.rs b/tests/run-make/doctests-runtool/runtool.rs
new file mode 100644
index 000000000..f5e3afdf2
--- /dev/null
+++ b/tests/run-make/doctests-runtool/runtool.rs
@@ -0,0 +1,3 @@
+fn main() {
+ eprintln!("{:?}", std::env::args().collect::<Vec<_>>());
+}
diff --git a/tests/run-make/doctests-runtool/t.rs b/tests/run-make/doctests-runtool/t.rs
new file mode 100644
index 000000000..c38cf0a0b
--- /dev/null
+++ b/tests/run-make/doctests-runtool/t.rs
@@ -0,0 +1,11 @@
+/// Fungle the foople.
+/// ```
+/// t::foople();
+/// ```
+pub fn foople() {}
+
+/// Flomble the florp
+/// ```
+/// t::florp();
+/// ```
+pub fn florp() {}