Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit a7c7979

Browse files
committed
Make rustdoc using run-make tests work
1 parent b56d4ab commit a7c7979

File tree

1 file changed

+23
-8
lines changed

1 file changed

+23
-8
lines changed

scripts/test_rustc_tests.sh

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -126,17 +126,12 @@ rm tests/ui/proc-macro/no-missing-docs.rs # same
126126
rm tests/ui/rust-2018/proc-macro-crate-in-paths.rs # same
127127
rm tests/ui/proc-macro/allowed-signatures.rs # same
128128

129+
# rustdoc-clif passes extra args, suppressing the help message when no args are passed
130+
rm -r tests/run-make/issue-88756-default-output
131+
129132
# doesn't work due to the way the rustc test suite is invoked.
130133
# should work when using ./x.py test the way it is intended
131134
# ============================================================
132-
rm -r tests/run-make/emit-shared-files # requires the rustdoc executable in dist/bin/
133-
rm -r tests/run-make/unstable-flag-required # same
134-
rm -r tests/run-make/rustdoc-* # same
135-
rm -r tests/run-make/issue-88756-default-output # same
136-
rm -r tests/run-make/doctests-keep-binaries # same
137-
rm -r tests/run-make/exit-code # same
138-
rm -r tests/run-make/issue-22131 # same
139-
rm -r tests/run-make/issue-38237 # same
140135
rm -r tests/run-make/remap-path-prefix-dwarf # requires llvm-dwarfdump
141136
rm -r tests/ui/consts/missing_span_in_backtrace.rs # expects sysroot source to be elsewhere
142137

@@ -162,6 +157,26 @@ rm tests/ui/process/nofile-limit.rs # TODO some AArch64 linking issue
162157

163158
rm tests/ui/stdio-is-blocking.rs # really slow with unoptimized libstd
164159

160+
cp ../dist/bin/rustdoc-clif ../dist/bin/rustdoc # some tests expect bin/rustdoc to exist
161+
162+
# prevent $(RUSTDOC) from picking up the sysroot built by x.py. It conflicts with the one used by
163+
# rustdoc-clif
164+
cat <<EOF | git apply -
165+
diff --git a/tests/run-make/tools.mk b/tests/run-make/tools.mk
166+
index ea06b620c4c..b969d0009c6 100644
167+
--- a/tests/run-make/tools.mk
168+
+++ b/tests/run-make/tools.mk
169+
@@ -9,7 +9,7 @@ RUSTC_ORIGINAL := \$(RUSTC)
170+
BARE_RUSTC := \$(HOST_RPATH_ENV) '\$(RUSTC)'
171+
BARE_RUSTDOC := \$(HOST_RPATH_ENV) '\$(RUSTDOC)'
172+
RUSTC := \$(BARE_RUSTC) --out-dir \$(TMPDIR) -L \$(TMPDIR) \$(RUSTFLAGS)
173+
-RUSTDOC := \$(BARE_RUSTDOC) -L \$(TARGET_RPATH_DIR)
174+
+RUSTDOC := \$(BARE_RUSTDOC)
175+
ifdef RUSTC_LINKER
176+
RUSTC := \$(RUSTC) -Clinker='\$(RUSTC_LINKER)'
177+
RUSTDOC := \$(RUSTDOC) -Clinker='\$(RUSTC_LINKER)'
178+
EOF
179+
165180
echo "[TEST] rustc test suite"
166181
COMPILETEST_FORCE_STAGE0=1 ./x.py test --stage 0 --test-args=--nocapture tests/{codegen-units,run-make,run-pass-valgrind,ui,incremental}
167182
popd

0 commit comments

Comments
 (0)