about summary refs log tree commit diff
path: root/docs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-04-19 07:02:15 +0000
committerbors <bors@rust-lang.org>2024-04-19 07:02:15 +0000
commit9b4fb7ce91cdd4dfaf783b085d4ef4ff8121da85 (patch)
treed62dceed9dc6d9f61d12ee9697b4c5c108ff850b /docs
parentaf1fd88c4d3708c248323caec7c5ac52255f450f (diff)
parentdb292bd89e8c479dbef1eadfe5d84a9b425795c6 (diff)
downloadrust-9b4fb7ce91cdd4dfaf783b085d4ef4ff8121da85.tar.gz
rust-9b4fb7ce91cdd4dfaf783b085d4ef4ff8121da85.zip
Auto merge of #17105 - kpreid:nocapture, r=Veykril
Make test harness arguments configurable and not `--nocapture`.

* Added config `runnables.extraTestBinaryArgs` to control the args.
* The default is `--show-output` rather than `--nocapture` to prevent unreadable output when 2 or more tests fail or print output at once.
* Renamed variables in `CargoTargetSpec::runnable_args()` for clarity.

Fixes #12737.

Suggested changelog info:

> New Features
>
> * add `rust-analyzer.runnables.extraTestBinaryArgs` to configure test harness options when running tests; replaces a previously hard-coded `--nocapture` option.

I'm not sure I made the right choices in vocabulary, between “binary”, “executable”, and “runnable”, and “launch” vs. “execute”, so let me know if I missed something to be consistent with in the naming and documentation.
Diffstat (limited to 'docs')
-rw-r--r--docs/user/generated_config.adoc18
1 files changed, 18 insertions, 0 deletions
diff --git a/docs/user/generated_config.adoc b/docs/user/generated_config.adoc
index af4483a2cc3..d509e58612f 100644
--- a/docs/user/generated_config.adoc
+++ b/docs/user/generated_config.adoc
@@ -852,6 +852,24 @@ Command to be executed instead of 'cargo' for runnables.
 Additional arguments to be passed to cargo for runnables such as
 tests or binaries. For example, it may be `--release`.
 --
+[[rust-analyzer.runnables.extraTestBinaryArgs]]rust-analyzer.runnables.extraTestBinaryArgs::
++
+--
+Default:
+----
+[
+  "--show-output"
+]
+----
+Additional arguments to be passed through Cargo to launched tests, benchmarks, or
+doc-tests.
+
+Unless the launched target uses a
+[custom test harness](https://doc.rust-lang.org/cargo/reference/cargo-targets.html#the-harness-field),
+they will end up being interpreted as options to
+[`rustc`’s built-in test harness (“libtest”)](https://doc.rust-lang.org/rustc/tests/index.html#cli-arguments).
+
+--
 [[rust-analyzer.rustc.source]]rust-analyzer.rustc.source (default: `null`)::
 +
 --