263390 Commits

Author SHA1 Message Date
Guillaume Gomez
488614d2dd Update tests/run-make/doctests-keep-binaries-2024/rmake.rs test to new run-make API 2024-08-13 20:14:57 +02:00
Guillaume Gomez
f1c1c49216 Run fmt 2024-08-13 20:14:57 +02:00
Guillaume Gomez
a708d0bc77 Fix commands syntax in rustdoc-ui tests 2024-08-13 20:14:57 +02:00
Guillaume Gomez
903d2db4d2 Only keep "useful" code in tests/rustdoc-ui/2024-doctests-checks.rs 2024-08-13 20:14:57 +02:00
Guillaume Gomez
7dcb841de0 Add doctest to ensure that doctests with crate-level attributes are not part of merged doctest 2024-08-13 20:14:57 +02:00
Guillaume Gomez
cbf6fe05e7 Add more merged doctests tests 2024-08-13 20:14:57 +02:00
Guillaume Gomez
c9f730e223 Improve documentation for internal doctest API 2024-08-13 20:14:57 +02:00
Guillaume Gomez
baf8ce83b8 Move is_multiple_tests argument into RunnableDocTest 2024-08-13 20:14:57 +02:00
Guillaume Gomez
ab3d90e037 Unify naming of DocTest 2024-08-13 20:14:57 +02:00
Guillaume Gomez
4b1db071d1 Don't special-case if there is only one merged doctest 2024-08-13 20:14:56 +02:00
Guillaume Gomez
72aeffa78c Remove need for unsafe code in merged doctests 2024-08-13 20:14:56 +02:00
Guillaume Gomez
a3bc2c7478 Improve code readability 2024-08-13 20:14:56 +02:00
Guillaume Gomez
0fbc32ce42 If there are crate attributes, we prevent doctest to be merged with others 2024-08-13 20:14:56 +02:00
Guillaume Gomez
ffc18c5cfb Rename DocTest into DocTestBuilder 2024-08-13 20:14:56 +02:00
Guillaume Gomez
1e1743a379 Reduce merged doctest source code size 2024-08-13 20:14:56 +02:00
Guillaume Gomez
d512438435 Run mergeable doctest as part of standalone doctests if there is only one 2024-08-13 20:14:56 +02:00
Guillaume Gomez
bfabf1db44 Add documentation on DocTest and RunnableDoctest structs 2024-08-13 20:14:56 +02:00
Guillaume Gomez
6d552ba446 Improve code by removing unneeded function arguments 2024-08-13 20:14:56 +02:00
Guillaume Gomez
84d9b67dab Add 2024 edition doctests to cover corner cases 2024-08-13 20:14:55 +02:00
Guillaume Gomez
14f80f9e69 Correctly handle macros using $crate in merged doctests 2024-08-13 20:14:55 +02:00
Guillaume Gomez
112e44740e Disable merged doctests by default 2024-08-13 20:14:55 +02:00
Guillaume Gomez
0bd2c99ce8 Only show rustdoc doctest compilation output if nocapture is used 2024-08-13 20:14:55 +02:00
Guillaume Gomez
c5ae545fbd If no argument is provided to merged doctests binary, they will be run in the same process (needed for miri) 2024-08-13 20:14:55 +02:00
Guillaume Gomez
ec4d910190 Correctly handle internal_features attribute 2024-08-13 20:14:55 +02:00
Guillaume Gomez
475824d811 Mark location doctest as standalone since file information will not work in merged doctest file 2024-08-13 20:14:55 +02:00
Guillaume Gomez
995858eed3 Don't change indent in merged doctests 2024-08-13 20:14:55 +02:00
Guillaume Gomez
0f0681e941 Make merged doctests run in their own process 2024-08-13 20:14:54 +02:00
Guillaume Gomez
dcc77b4cbc Fix weird memory allocation failure in merged doctests by storing doctest list into a const 2024-08-13 20:14:54 +02:00
Guillaume Gomez
b6831bbdda Don't merge doctests with #[global_allocator] 2024-08-13 20:14:54 +02:00
Guillaume Gomez
6eabffbaec Greatly improve handling of doctests attributes, making it possible to merge doctests more efficiently 2024-08-13 20:14:54 +02:00
Guillaume Gomez
03118fa80a Simplify has_main_fn to be a boolean instead of a Option<Span> 2024-08-13 20:14:54 +02:00
Guillaume Gomez
010731d5b6 Add new run-make tests for doctests 2024-08-13 20:14:54 +02:00
Guillaume Gomez
2fd8d1c1ce Add/update rustdoc-ui tests to check new merged doctests 2024-08-13 20:14:54 +02:00
Guillaume Gomez
7ec3cabe17 Correctly handle doctests with invalid AST 2024-08-13 20:14:54 +02:00
Guillaume Gomez
59a9e0986d Correctly handle the case where there is no doctests to run 2024-08-13 20:14:54 +02:00
Guillaume Gomez
a0ae8ac861 If there is any AST error with a doctest, we make it a standalone test
To do so, AST error detection was improved in order to not filter out
too many doctests.
2024-08-13 20:14:54 +02:00
Guillaume Gomez
b7079c5c83 Prevent merged doctests to break stdin if the generated file is too big 2024-08-13 20:14:53 +02:00
Guillaume Gomez
23badff4fe Add documentation for the doctest standalone attribute 2024-08-13 20:14:53 +02:00
Guillaume Gomez
3147520d34 Add new doc codeblock standalone attribute 2024-08-13 20:14:53 +02:00
Guillaume Gomez
58cd70e062 Only merge doctests starting 2024 edition 2024-08-13 20:14:53 +02:00
Guillaume Gomez
6ae3524835 Split doctests into two categories: mergeable ones and standalone ones 2024-08-13 20:14:53 +02:00
Guillaume Gomez
96051f20e2 Split standalone and mergeable doctests 2024-08-13 20:14:53 +02:00
Guillaume Gomez
39f029a852 Split doctests between standalone and mergeable ones 2024-08-13 20:14:53 +02:00
Guillaume Gomez
7d72482431 Simplify doctest tests 2024-08-13 20:14:53 +02:00
Guillaume Gomez
5e244370fe Add DocTest type 2024-08-13 20:14:53 +02:00
Guillaume Gomez
05fbfde17d Clean up rustdoc make_test function code 2024-08-13 20:14:52 +02:00
bors
80eb5a8e91 Auto merge of #129046 - matthiaskrgr:rollup-9x4xgak, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #128643 (Refactor `powerpc64` call ABI handling)
 - #128655 (std: refactor UNIX random data generation)
 - #128745 (Remove unused lifetime parameter from spawn_unchecked)
 - #128841 (bootstrap: don't use rustflags for `--rustc-args`)
 - #128983 (Slightly refactor `TargetSelection` in bootstrap)
 - #129026 (CFI: Move CFI ui tests to cfi directory)
 - #129040 (Fix blessing of rmake tests)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-08-13 11:43:20 +00:00
Matthias Krüger
42f70c240a
Rollup merge of #129040 - Zalathar:bless-rmake, r=jieyouxu
Fix blessing of rmake tests

Fixes #129038.

When running in `--bless` mode, we now set the value of `RUSTC_BLESS_TEST` to the current test's source directory. This allows the diff helper in `run_make_support` to find the original snapshot file in the source directory and bless that, instead of unhelpfully blessing the temporary copy in `build`.

r? `@jieyouxu`
2024-08-13 12:12:25 +02:00
Matthias Krüger
41aa9631ef
Rollup merge of #129026 - rcvalle:rust-cfi-move-cfi-ui-tests-to-cfi-directory, r=compiler-errors
CFI: Move CFI ui tests to cfi directory

Move the CFI ui tests to the cfi directory and removes the cfi prefix from tests file names similarly to how the cfi codegen tests are organized.
2024-08-13 12:12:25 +02:00
Matthias Krüger
9d9c9acc6e
Rollup merge of #128983 - Kobzol:bootstrap-target, r=onur-ozkan
Slightly refactor `TargetSelection` in bootstrap

Mostly a drive-by refactoring of `TargetSelection` to reduce some manual "windows-gnu" detection and also accesses to the `triple` field.

r? `@onur-ozkan`
2024-08-13 12:12:24 +02:00