diff options
Diffstat (limited to 'tests/run-make/doctests-runtool')
-rw-r--r-- | tests/run-make/doctests-runtool/Makefile | 20 | ||||
-rw-r--r-- | tests/run-make/doctests-runtool/runtool.rs | 3 | ||||
-rw-r--r-- | tests/run-make/doctests-runtool/t.rs | 11 |
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() {} |