-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #112751 - ehuss:persist-test-run-directory, r=jsha
rustdoc: Fixes with --test-run-directory and relative paths. Fixes #112191 Fixes #112210 This fixes some issues with `--test-run-directory` and its interaction with `--runtool` and `--persist-doctests`. Relative directories don't work with `Command::current_dir` very well because it has platform-specific behavior with relative paths. This fixes it by avoiding the use of relative paths. This is needed because cargo is switching to use `--test-run-directory`, and it uses relative paths when interacting with rustdoc/rustc.
- Loading branch information
Showing
5 changed files
with
62 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
fn main() { | ||
eprintln!("{:?}", std::env::args().collect::<Vec<_>>()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/// Fungle the foople. | ||
/// ``` | ||
/// t::foople(); | ||
/// ``` | ||
pub fn foople() {} | ||
|
||
/// Flomble the florp | ||
/// ``` | ||
/// t::florp(); | ||
/// ``` | ||
pub fn florp() {} |