Skip to content

Commit 8be4c6e

Browse files
committed
Rename --runtool and --runtool-arg
This renames `--runtool` and `--runtool-arg` to `--test-runtool` and `--test-runtool-arg` to maintain consistency with other `--test-*` arguments.
1 parent 58aa7b5 commit 8be4c6e

File tree

5 files changed

+18
-18
lines changed

5 files changed

+18
-18
lines changed

src/doc/rustdoc/src/unstable-features.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -647,21 +647,21 @@ struct Foo;
647647
In older versions, this will be ignored on all targets, but on newer versions `ignore-gnu` will
648648
override `ignore`.
649649

650-
## `--runtool`, `--runtool-arg`: program to run tests with; args to pass to it
650+
## `--test-runtool`, `--test-runtool-arg`: program to run tests with; args to pass to it
651651

652652
* Tracking issue: [#64245](https://github.com/rust-lang/rust/issues/64245)
653653

654654
Using these options looks like this:
655655

656656
```bash
657-
$ rustdoc src/lib.rs -Z unstable-options --runtool runner --runtool-arg --do-thing --runtool-arg --do-other-thing
657+
$ rustdoc src/lib.rs -Z unstable-options --test-runtool runner --test-runtool-arg --do-thing --test-runtool-arg --do-other-thing
658658
```
659659

660660
These options can be used to run the doctest under a program, and also pass arguments to
661661
that program. For example, if you want to run your doctests under valgrind you might run
662662

663663
```bash
664-
$ rustdoc src/lib.rs -Z unstable-options --runtool valgrind
664+
$ rustdoc src/lib.rs -Z unstable-options --test-runtool valgrind
665665
```
666666

667667
Another use case would be to run a test inside an emulator, or through a Virtual Machine.

src/librustdoc/config.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,9 @@ pub(crate) struct Options {
122122
/// temporary directory if not set.
123123
pub(crate) persist_doctests: Option<PathBuf>,
124124
/// Runtool to run doctests with
125-
pub(crate) runtool: Option<String>,
125+
pub(crate) test_runtool: Option<String>,
126126
/// Arguments to pass to the runtool
127-
pub(crate) runtool_args: Vec<String>,
127+
pub(crate) test_runtool_args: Vec<String>,
128128
/// Whether to allow ignoring doctests on a per-target basis
129129
/// For example, using ignore-foo to ignore running the doctest on any target that
130130
/// contains "foo" as a substring
@@ -212,8 +212,8 @@ impl fmt::Debug for Options {
212212
.field("persist_doctests", &self.persist_doctests)
213213
.field("show_coverage", &self.show_coverage)
214214
.field("crate_version", &self.crate_version)
215-
.field("runtool", &self.runtool)
216-
.field("runtool_args", &self.runtool_args)
215+
.field("test_runtool", &self.test_runtool)
216+
.field("test_runtool_args", &self.test_runtool_args)
217217
.field("enable-per-target-ignores", &self.enable_per_target_ignores)
218218
.field("run_check", &self.run_check)
219219
.field("no_run", &self.no_run)
@@ -765,8 +765,8 @@ impl Options {
765765
let unstable_opts_strs = matches.opt_strs("Z");
766766
let lib_strs = matches.opt_strs("L");
767767
let extern_strs = matches.opt_strs("extern");
768-
let runtool = matches.opt_str("runtool");
769-
let runtool_args = matches.opt_strs("runtool-arg");
768+
let test_runtool = matches.opt_str("test-runtool");
769+
let test_runtool_args = matches.opt_strs("test-runtool-arg");
770770
let enable_per_target_ignores = matches.opt_present("enable-per-target-ignores");
771771
let document_private = matches.opt_present("document-private-items");
772772
let document_hidden = matches.opt_present("document-hidden-items");
@@ -828,8 +828,8 @@ impl Options {
828828
crate_version,
829829
test_run_directory,
830830
persist_doctests,
831-
runtool,
832-
runtool_args,
831+
test_runtool,
832+
test_runtool_args,
833833
enable_per_target_ignores,
834834
test_builder,
835835
run_check,

src/librustdoc/doctest.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -701,10 +701,10 @@ fn run_test(
701701
let mut cmd;
702702

703703
let output_file = make_maybe_absolute_path(output_file);
704-
if let Some(tool) = &rustdoc_options.runtool {
704+
if let Some(tool) = &rustdoc_options.test_runtool {
705705
let tool = make_maybe_absolute_path(tool.into());
706706
cmd = Command::new(tool);
707-
cmd.args(&rustdoc_options.runtool_args);
707+
cmd.args(&rustdoc_options.test_runtool_args);
708708
cmd.arg(&output_file);
709709
} else {
710710
cmd = Command::new(&output_file);

src/librustdoc/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -519,15 +519,15 @@ fn opts() -> Vec<RustcOptGroup> {
519519
Unstable,
520520
Opt,
521521
"",
522-
"runtool",
522+
"test-runtool",
523523
"",
524524
"The tool to run tests with when building for a different target than host",
525525
),
526526
opt(
527527
Unstable,
528528
Multi,
529529
"",
530-
"runtool-arg",
530+
"test-runtool-arg",
531531
"",
532532
"One (of possibly many) arguments to pass to the runtool",
533533
),

tests/rustdoc/doctest/doctest-runtool.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
// Tests that the --runtool argument works.
1+
// Tests that the --test-runtool argument works.
22

33
//@ ignore-cross-compile
44
//@ aux-bin: doctest-runtool.rs
55
//@ compile-flags: --test
6-
//@ compile-flags: --runtool=auxiliary/bin/doctest-runtool
7-
//@ compile-flags: --runtool-arg=arg1 --runtool-arg
6+
//@ compile-flags: --test-runtool=auxiliary/bin/doctest-runtool
7+
//@ compile-flags: --test-runtool-arg=arg1 --test-runtool-arg
88
//@ compile-flags: 'arg2 with space'
99
//@ compile-flags: -Zunstable-options
1010

0 commit comments

Comments
 (0)