Stabilize --test-runtool and --test-runtool-arg

This commit is contained in:
Eric Huss 2025-02-15 10:56:49 -08:00
parent ec25e3300b
commit 6441701e5c
4 changed files with 19 additions and 22 deletions

View File

@ -222,6 +222,23 @@ For more, see [the chapter on documentation tests](write-documentation/documenta
See also `--test`.
## `--test-runtool`, `--test-runtool-arg`: program to run tests with; args to pass to it
Using these options looks like this:
```bash
$ rustdoc src/lib.rs --test-runtool runner --test-runtool-arg --do-thing --test-runtool-arg --do-other-thing
```
These options can be used to run the doctest under a program, and also pass arguments to
that program. For example, if you want to run your doctests under valgrind you might run
```bash
$ rustdoc src/lib.rs --test-runtool valgrind
```
Another use case would be to run a test inside an emulator, or through a Virtual Machine.
## `--target`: generate documentation for the specified target triple
Using this flag looks like this:

View File

@ -666,25 +666,6 @@ struct Foo;
In older versions, this will be ignored on all targets, but on newer versions `ignore-gnu` will
override `ignore`.
## `--test-runtool`, `--test-runtool-arg`: program to run tests with; args to pass to it
* Tracking issue: [#64245](https://github.com/rust-lang/rust/issues/64245)
Using these options looks like this:
```bash
$ rustdoc src/lib.rs -Z unstable-options --test-runtool runner --test-runtool-arg --do-thing --test-runtool-arg --do-other-thing
```
These options can be used to run the doctest under a program, and also pass arguments to
that program. For example, if you want to run your doctests under valgrind you might run
```bash
$ rustdoc src/lib.rs -Z unstable-options --test-runtool valgrind
```
Another use case would be to run a test inside an emulator, or through a Virtual Machine.
## `--with-examples`: include examples of uses of items as documentation
* Tracking issue: [#88791](https://github.com/rust-lang/rust/issues/88791)

View File

@ -515,7 +515,7 @@ fn opts() -> Vec<RustcOptGroup> {
"",
),
opt(
Unstable,
Stable,
Opt,
"",
"test-runtool",
@ -523,7 +523,7 @@ fn opts() -> Vec<RustcOptGroup> {
"The tool to run tests with when building for a different target than host",
),
opt(
Unstable,
Stable,
Multi,
"",
"test-runtool-arg",

View File

@ -6,7 +6,6 @@
//@ compile-flags: --test-runtool=auxiliary/bin/doctest-runtool
//@ compile-flags: --test-runtool-arg=arg1 --test-runtool-arg
//@ compile-flags: 'arg2 with space'
//@ compile-flags: -Zunstable-options
/// ```
/// assert_eq!(std::env::var("DOCTEST_RUNTOOL_CHECK"), Ok("xyz".to_string()));