rust/tests/rustdoc-ui/doctest
Matthias Krüger 7a5bbe0527
Rollup merge of #139863 - fmease:simp-doctest-build-arg-passing, r=GuillaumeGomez
rustdoc: Replace unstable flag `--doctest-compilation-args` with a simpler one: `--doctest-build-arg`

Tracking issue: https://github.com/rust-lang/rust/issues/134172.
Context: https://github.com/rust-lang/rust/pull/137096#issuecomment-2776318800

Yeets the ad hoc shell-like lexer for 'nested' program arguments.
No FCP necessary since the flag is unstable.

I've chosen to replace `compilation` with `build` because it's shorter (you now need to pass it multiple times in order to pass many arguments to the doctest compiler, so it matters a bit) and since I prefer it esthetically.

**Issue**: Even though we don't process the argument passed to `--doctest-build-arg`, we end up passing it via an argument file (`rustc `@argfile`)` which delimits arguments by line break (LF or CRLF, [via](https://doc.rust-lang.org/rustc/command-line-arguments.html#path-load-command-line-flags-from-a-path)) meaning ultimately the arguments still get split which is unfortunate. Still, I think this change is an improvement over the status quo.

I'll update the tracking issue if/once this PR merges. I'll also add the (CR)LF issue to 'unresolved question'.

r? GuillaumeGomez
r? notriddle
2025-05-09 21:50:06 +02:00
..
auxiliary rustdoc: Fix doctest heuristic for main fn wrapping 2025-05-01 11:56:11 +02:00
block-doc-comment.rs Remove the -test suffix from normalize directives 2024-12-27 19:58:16 +11:00
block-doc-comment.stdout Move some rustdoc-ui tests to subdirectories 2023-04-29 11:36:19 -05:00
cfg-test.rs Remove the -test suffix from normalize directives 2024-12-27 19:58:16 +11:00
cfg-test.stdout Move some rustdoc-ui tests to subdirectories 2023-04-29 11:36:19 -05:00
check-attr-test.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
check-attr-test.stderr Improve mistyped docblock attribute warning messages 2024-09-28 18:38:11 +02:00
check-cfg-test.rs Remove the -test suffix from normalize directives 2024-12-27 19:58:16 +11:00
check-cfg-test.stderr Move --check-cfg documentation to stable books 2024-04-15 21:49:56 +02:00
check-cfg-test.stdout Move some rustdoc-ui tests to subdirectories 2023-04-29 11:36:19 -05:00
comment-in-attr-134221-2.rs Remove the -test suffix from normalize directives 2024-12-27 19:58:16 +11:00
comment-in-attr-134221-2.stdout Remove unneeded handling of backlines in doctest attributes 2024-12-16 17:59:07 +01:00
comment-in-attr-134221.rs Remove the -test suffix from normalize directives 2024-12-27 19:58:16 +11:00
comment-in-attr-134221.stdout Also handle cases where attributes are unclosed 2024-12-16 13:59:41 +01:00
dead-code-2024.rs Remove the -test suffix from normalize directives 2024-12-27 19:58:16 +11:00
dead-code-2024.stdout Stabilize the 2024 edition 2024-11-22 11:12:15 -08:00
dead-code.rs Remove the -test suffix from normalize directives 2024-12-27 19:58:16 +11:00
dead-code.stdout Add regression tests for #130681 2024-10-01 17:08:01 +02:00
display-output.rs Remove the -test suffix from normalize directives 2024-12-27 19:58:16 +11:00
display-output.stdout Correctly handle line comments in attributes and generate extern crates 2025-03-27 11:18:43 +01:00
doc-comment-multi-line-attr.rs Remove the -test suffix from normalize directives 2024-12-27 19:58:16 +11:00
doc-comment-multi-line-attr.stdout Move some rustdoc-ui tests to subdirectories 2023-04-29 11:36:19 -05:00
doc-comment-multi-line-cfg-attr.rs Remove the -test suffix from normalize directives 2024-12-27 19:58:16 +11:00
doc-comment-multi-line-cfg-attr.stdout Move some rustdoc-ui tests to subdirectories 2023-04-29 11:36:19 -05:00
doc-test-attr-pass.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
doc-test-attr.rs Update ui tests 2024-02-29 14:43:43 +01:00
doc-test-attr.stderr Update ui tests 2024-02-29 14:43:43 +01:00
doc-test-doctest-feature.rs Remove the -test suffix from normalize directives 2024-12-27 19:58:16 +11:00
doc-test-doctest-feature.stdout Move some rustdoc-ui tests to subdirectories 2023-04-29 11:36:19 -05:00
doc-test-rustdoc-feature.rs Remove the -test suffix from normalize directives 2024-12-27 19:58:16 +11:00
doc-test-rustdoc-feature.stdout Move some rustdoc-ui tests to subdirectories 2023-04-29 11:36:19 -05:00
doctest-edition.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
doctest-edition.stderr Bless rustdoc-ui tests 2023-11-24 19:15:52 +01:00
doctest-multiline-crate-attribute.rs Remove the -test suffix from normalize directives 2024-12-27 19:58:16 +11:00
doctest-multiline-crate-attribute.stdout Move some rustdoc-ui tests to subdirectories 2023-04-29 11:36:19 -05:00
doctest-no-run-invalid-langstring-124577.rs rustdoc: Fix flaky doctest test 2025-01-19 18:41:11 +01:00
doctest-no-run-invalid-langstring-124577.stdout rustdoc: Fix flaky doctest test 2025-01-19 18:41:11 +01:00
doctest-output-include-fail.md rustdoc: use the correct span for doctests 2024-09-19 13:57:44 -07:00
doctest-output-include-fail.rs Remove the -test suffix from normalize directives 2024-12-27 19:58:16 +11:00
doctest-output-include-fail.stdout rustdoc: use the correct span for doctests 2024-09-19 13:57:44 -07:00
doctest-output.edition2015.stdout rustdoc: make doctest span tweak a 2024 edition change 2024-10-26 17:56:38 -07:00
doctest-output.edition2024.stdout rustdoc: make doctest span tweak a 2024 edition change 2024-10-26 17:56:38 -07:00
doctest-output.rs doctests: build test bundle and harness separately 2025-03-10 01:47:36 +01:00
edition-2024-error-output.rs Use eprint! instead of eprintln! 2025-04-03 19:37:18 +02:00
edition-2024-error-output.stdout Correctly display stdout and stderr in case a doctest is failing 2025-04-25 14:13:24 +02:00
extern-crate.rs Correctly handle line comments in attributes and generate extern crates 2025-03-27 11:18:43 +01:00
extern-crate.stdout Correctly handle line comments in attributes and generate extern crates 2025-03-27 11:18:43 +01:00
failed-doctest-compile-fail.rs Remove the -test suffix from normalize directives 2024-12-27 19:58:16 +11:00
failed-doctest-compile-fail.stdout Move some rustdoc-ui tests to subdirectories 2023-04-29 11:36:19 -05:00
failed-doctest-extra-semicolon-on-item.rs If there is a ; alone, we consider that the doctest needs to be put inside a function 2025-04-25 22:04:50 +02:00
failed-doctest-extra-semicolon-on-item.stdout If there is a ; alone, we consider that the doctest needs to be put inside a function 2025-04-25 22:04:50 +02:00
failed-doctest-missing-codes.rs Remove the -test suffix from normalize directives 2024-12-27 19:58:16 +11:00
failed-doctest-missing-codes.stdout Bless rustdoc-ui tests 2023-11-24 19:15:52 +01:00
failed-doctest-output-windows.rs Remove the -test suffix from normalize directives 2024-12-27 19:58:16 +11:00
failed-doctest-output-windows.stdout Try to write the panic message with a single write_all call 2025-01-01 15:58:29 +01:00
failed-doctest-output.rs Remove the -test suffix from normalize directives 2024-12-27 19:58:16 +11:00
failed-doctest-output.stdout Try to write the panic message with a single write_all call 2025-01-01 15:58:29 +01:00
failed-doctest-should-panic-2021.rs replace //@ compile-flags: --edition with //@ edition 2025-04-10 09:56:37 +02:00
failed-doctest-should-panic-2021.stdout replace //@ compile-flags: --edition with //@ edition 2025-04-10 09:56:37 +02:00
failed-doctest-should-panic.rs Remove the -test suffix from normalize directives 2024-12-27 19:58:16 +11:00
failed-doctest-should-panic.stdout Report span of test when should_panic test failed 2025-04-14 10:36:11 +08:00
failed-doctest-test-crate.edition2015.stdout doctests: build test bundle and harness separately 2025-03-10 01:47:36 +01:00
failed-doctest-test-crate.edition2024.stdout doctests: build test bundle and harness separately 2025-03-10 01:47:36 +01:00
failed-doctest-test-crate.rs doctests: build test bundle and harness separately 2025-03-10 01:47:36 +01:00
main-alongside-macro-calls.fail.stdout rustdoc: Fix doctest heuristic for main fn wrapping 2025-05-01 11:56:11 +02:00
main-alongside-macro-calls.pass.stdout rustdoc: Fix doctest heuristic for main fn wrapping 2025-05-01 11:56:11 +02:00
main-alongside-macro-calls.rs rustdoc: Fix doctest heuristic for main fn wrapping 2025-05-01 11:56:11 +02:00
main-alongside-stmts.rs rustdoc: Fix doctest heuristic for main fn wrapping 2025-05-01 11:56:11 +02:00
main-alongside-stmts.stdout rustdoc: Fix doctest heuristic for main fn wrapping 2025-05-01 11:56:11 +02:00
merged-ignore-no_run.rs Remove the -test suffix from normalize directives 2024-12-27 19:58:16 +11:00
merged-ignore-no_run.stdout Stabilize the 2024 edition 2024-11-22 11:12:15 -08:00
nested-main.rs Remove the -test suffix from normalize directives 2024-12-27 19:58:16 +11:00
nested-main.stdout Add regression test for #131893 2024-10-24 21:35:15 +02:00
no-run-flag-error.rs compiletest: Require //~ annotations even if error-pattern is specified 2025-04-03 11:08:55 +03:00
no-run-flag-error.stderr Move some rustdoc-ui tests to subdirectories 2023-04-29 11:36:19 -05:00
no-run-flag.rs Remove the -test suffix from normalize directives 2024-12-27 19:58:16 +11:00
no-run-flag.stdout Move some rustdoc-ui tests to subdirectories 2023-04-29 11:36:19 -05:00
nocapture-fail.rs Remove the -test suffix from normalize directives 2024-12-27 19:58:16 +11:00
nocapture-fail.stderr Bless rustdoc-ui tests 2023-11-24 19:15:52 +01:00
nocapture-fail.stdout Move some rustdoc-ui tests to subdirectories 2023-04-29 11:36:19 -05:00
nocapture.rs Remove the -test suffix from normalize directives 2024-12-27 19:58:16 +11:00
nocapture.stderr Move some rustdoc-ui tests to subdirectories 2023-04-29 11:36:19 -05:00
nocapture.stdout Move some rustdoc-ui tests to subdirectories 2023-04-29 11:36:19 -05:00
non_local_defs.rs Remove the -test suffix from normalize directives 2024-12-27 19:58:16 +11:00
non_local_defs.stderr Remove deprecation note in the non_local_definitions warning 2024-10-11 21:21:32 +02:00
non_local_defs.stdout Revert "Switch back non_local_definitions lint to allow-by-default" 2024-09-23 09:23:04 +02:00
non-local-defs-impl.rs chore: fix some typos 2024-12-31 15:11:18 +08:00
non-local-defs-impl.stdout Remove deprecation note in the non_local_definitions warning 2024-10-11 21:21:32 +02:00
per-target-ignores.rs ignore doctests only in specified targets 2025-03-25 15:39:41 +09:00
per-target-ignores.stdout ignore doctests only in specified targets 2025-03-25 15:39:41 +09:00
private-doc-test.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
private-item-doc-test.rs Move some rustdoc-ui tests to subdirectories 2023-04-29 11:36:19 -05:00
private-item-doc-test.stderr Bless rustdoc-ui tests 2023-11-24 19:15:52 +01:00
private-public-item-doc-test.rs Move some rustdoc-ui tests to subdirectories 2023-04-29 11:36:19 -05:00
private-public-item-doc-test.stderr Bless rustdoc-ui tests 2023-11-24 19:15:52 +01:00
public-reexported-item-doc-test.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
relative-path-include-bytes-132203.edition2015.stdout Do not suggest using -Zmacro-backtrace for builtin macros 2025-03-14 19:50:03 +00:00
relative-path-include-bytes-132203.edition2024.stdout rustdoc: make doctest span tweak a 2024 edition change 2024-10-26 17:56:38 -07:00
relative-path-include-bytes-132203.rs Enable relative-path-include-bytes on Windows 2025-02-16 10:40:04 +00:00
run-directory.correct.stdout Move some rustdoc-ui tests to subdirectories 2023-04-29 11:36:19 -05:00
run-directory.incorrect.stdout Move some rustdoc-ui tests to subdirectories 2023-04-29 11:36:19 -05:00
run-directory.rs Remove the -test suffix from normalize directives 2024-12-27 19:58:16 +11:00
rustflags-multiple-args.rs Replace flag --doctest-compilation-args with a simpler one: --doctest-build-arg 2025-04-15 15:44:45 +02:00
rustflags-multiple-args.stdout Replace flag --doctest-compilation-args with a simpler one: --doctest-build-arg 2025-04-15 15:44:45 +02:00
rustflags.rs Replace flag --doctest-compilation-args with a simpler one: --doctest-build-arg 2025-04-15 15:44:45 +02:00
rustflags.stdout Add regression test for --doctest-compilation-args 2024-12-20 15:17:47 +01:00
standalone-warning-2024.rs Remove the -test suffix from normalize directives 2024-12-27 19:58:16 +11:00
standalone-warning-2024.stderr Stabilize the 2024 edition 2024-11-22 11:12:15 -08:00
standalone-warning.rs Rename doctest attribute standalone-crate into standalone_crate for coherency 2024-09-29 13:01:41 +02:00
stdout-and-stderr.rs Add rustdoc-ui regression test for #140289 2025-04-25 15:55:54 +02:00
stdout-and-stderr.stdout Add rustdoc-ui regression test for #140289 2025-04-25 15:55:54 +02:00
test-compile-fail1.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
test-compile-fail1.stderr Bless rustdoc-ui tests 2023-11-24 19:15:52 +01:00
test-compile-fail2.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
test-compile-fail2.stderr Bless rustdoc-ui tests 2023-11-24 19:15:52 +01:00
test-compile-fail3.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
test-compile-fail3.stderr Be more accurate about calculating display_col from a BytePos 2024-07-18 20:08:38 +00:00
test-no_std.rs Remove the -test suffix from normalize directives 2024-12-27 19:58:16 +11:00
test-no_std.stdout Move some rustdoc-ui tests to subdirectories 2023-04-29 11:36:19 -05:00
test-type.rs Remove the -test suffix from normalize directives 2024-12-27 19:58:16 +11:00
test-type.stdout Move some rustdoc-ui tests to subdirectories 2023-04-29 11:36:19 -05:00
unparseable-doc-test.rs Remove the -test suffix from normalize directives 2024-12-27 19:58:16 +11:00
unparseable-doc-test.stdout Bless rustdoc-ui tests 2023-11-24 19:15:52 +01:00
wrong-ast-2024.rs Remove the -test suffix from normalize directives 2024-12-27 19:58:16 +11:00
wrong-ast-2024.stdout Stabilize the 2024 edition 2024-11-22 11:12:15 -08:00
wrong-ast.rs Remove the -test suffix from normalize directives 2024-12-27 19:58:16 +11:00
wrong-ast.stdout Don't special-case if there is only one merged doctest 2024-08-13 20:14:56 +02:00