about summary refs log tree commit diff
path: root/src/tools/compiletest
AgeCommit message (Collapse)AuthorLines
2021-08-22Fix typos “a”→“an”Frank Steffahn-1/+1
2021-08-03Add x.py option to --force-rerun compiletest testsSmitty-7/+15
2021-07-29rfc3052: Remove authors field from Cargo manifestsJade-1/+0
Since RFC 3052 soft deprecated the authors field anyway, hiding it from crates.io, docs.rs, and making Cargo not add it by default, and it is not generally up to date/useful information, we should remove it from crates in this repo.
2021-07-27Auto merge of #83491 - jyn514:remove-pretty, r=pnkfelixbors-2/+2
Remove unstable `--pretty` flag It doesn't do anything `--unpretty` doesn't, and due to a bug, also didn't show up in `--help`. I don't think there's any reason to keep it around, I haven't seen anyone using it. Closes https://github.com/rust-lang/rust/issues/36473.
2021-07-14Add -Zfuture-incompat-test to assist with testing future-incompat reports.Eric Huss-4/+1
2021-07-03Support pretty printing slices using GDBEFanZh-2/+2
2021-06-30Improve debug symbol names to avoid ambiguity and work better with MSVC's ↵Daniel Paoliello-7/+19
debugger There are several cases where names of types and functions in the debug info are either ambiguous, or not helpful, such as including ambiguous placeholders (e.g., `{{impl}}`, `{{closure}}` or `dyn _'`) or dropping qualifications (e.g., for dynamic types). Instead, each debug symbol name should be unique and useful: * Include disambiguators for anonymous `DefPathDataName` (closures and generators), and unify their formatting when used as a path-qualifier vs item being qualified. * Qualify the principal trait for dynamic types. * If there is no principal trait for a dynamic type, emit all other traits instead. * Respect the `qualified` argument when emitting ref and pointer types. * For implementations, emit the disambiguator. * Print const generics when emitting generic parameters or arguments. Additionally, when targeting MSVC, its debugger treats many command arguments as C++ expressions, even when the argument is defined to be a symbol name. As such names in the debug info need to be more C++-like to be parsed correctly: * Avoid characters with special meaning (`#`, `[`, `"`, `+`). * Never start a name with `<` or `{` as this is treated as an operator. * `>>` is always treated as a right-shift, even when parsing generic arguments (so add a space to avoid this). * Emit function declarations using C/C++ style syntax (e.g., leading return type). * Emit arrays as a synthetic `array$<type, size>` type. * Include a `$` in all synthetic types as this is a legal character for C++, but not Rust (thus we avoid collisions with user types).
2021-06-28Update to new bootstrap compilerMark Rousskov-2/+0
2021-06-24compiletest: ignore tests on a per-revision basisSimonas Kazlauskas-343/+296
Otherwise something that ought to seemingly work like `//[x86] needs-llvm-components: x86` or `//[nll_beyond]should-fail` do not get evaluated properly.
2021-06-20compiletest: display the error if rustfix failsEric Huss-2/+5
2021-06-20Update rustfix for compiletest.Eric Huss-1/+1
2021-06-11Auto merge of #85961 - 1000teslas:issue-71519-fix, r=petrochenkovbors-0/+13
MVP for using rust-lld as part of cc Will fix #71519. I need to figure out how to write a test showing that lld is used instead of whatever linker cc normally uses. When I manually run rustc using `echo 'fn main() {}' | RUSTC_LOG=rustc_codegen_ssa::back::link=debug ./rustc -Clinker-flavor=gcc-lld --crate-type bin -Clink-arg=-Wl,-v` (thanks to bjorn3 on Zulip), I can see that lld is used, but I'm not sure how to inspect that output in a test.
2021-06-10Auto merge of #86098 - pietroalbini:test-stable, r=Mark-Simulacrumbors-1/+22
Add the x86_64-gnu-stable builder During the 1.52 release process we had to deal with some commits that passed the test suite on the nightly branch but failed on the beta or stable branch. In that case it was due to some UI tests including the channel name in the output, but other changes might also be dependent on the channel. This commit adds a new CI job that runs the Linux x86_64 test suite with the stable branch, ensuring nightly changes also work as stable. To ensure the new job works the following other changes are present: * The `ui-fulldeps/session-derive-errors.rs` test has been disabled on beta and stable, which required adding support for `// ignore-{channel}` and `// only-{channel}`. * The `rustdoc/intra-doc/field.rs` has been fixed. r? `@Mark-Simulacrum` fixes https://github.com/rust-lang/release-team/issues/11
2021-06-10Auto merge of #82639 - jyn514:stable-options, r=Mark-Simulacrumbors-0/+6
Don't pass -Z unstable-options by default for UI tests Unconditionally passing -Z unstable-options makes it impossible to test whether an option requires unstable-options or not. This uncovered quite a lot of bugs, I'll open issues for each. These don't strictly need to be fixed before this is merged, it just makes the diff much larger because of the changes to diagnostics. - https://github.com/rust-lang/rust/issues/82636 - https://github.com/rust-lang/rust/issues/82637 - https://github.com/rust-lang/rust/issues/82638
2021-06-10gcc-lld mvp1000teslas-0/+13
ignore test if rust-lld not found create ld -> rust-lld symlink at build time instead of run time for testing in ci copy instead of symlinking remove linux check test for linker, suggestions from bjorn3 fix overly restrictive lld matcher use -Zgcc-ld flag instead of -Clinker-flavor refactor code adding lld to gcc path revert ci changes suggestions from petrochenkov rename gcc_ld to gcc-ld in dirs
2021-06-10Rollup merge of #85997 - jyn514:rustdoc-diff, r=Mark-SimulacrumYuki Okushi-9/+21
rustdoc: Print a warning if the diff when comparing to old nightlies is empty This avoids confusing situations where it's unclear whether there's a bug in the diff tool or not: ``` 26: `@has` check failed `XPATH PATTERN` did not match // `@has` - '//code/a[`@href="{{channel}}/std/primitive.i32.html"]'` 'i32' Encountered 6 errors ------------------------------------------ info: generating a diff against nightly rustdoc failures: [rustdoc] rustdoc/primitive-reexport.rs ```
2021-06-07ignore ui-fulldeps/session-derive-errors.rs on beta and stablePietro Albini-1/+22
The session-derive-errors test ensures the internal SessionDiagnostic derive macro outputs the right error messages when misused. The macro relies on the proc_macro2 crate though, which changes its span behavior depending on whether the channel is nightly or not. This caused test failures when bumping the channel from nightly to beta/stable. Since SessionDiagnostic is internal-only we don't care about its diagnostics quality outside of nightly, as the compiler itself is developed on nightly. Thus the easiest solution is to ignore that test on the beta and stable channels. This also implements `// only-{channel}` and `// ignore-{channel}` in compiletest to properly support the change.
2021-06-06Auto merge of #84863 - ABouttefeux:libtest, r=m-ou-sebors-4/+7
Show test type during prints Test output can sometimes be confusing. For example doctest with the no_run argument are displayed the same way than test that are run. During #83857 I got the feedback that test output can be confusing. For the moment test output is ``` test $DIR/test-type.rs - f (line 12) ... ignored test $DIR/test-type.rs - f (line 15) ... ok test $DIR/test-type.rs - f (line 21) ... ok test $DIR/test-type.rs - f (line 6) ... ok ``` I propose to change output by indicating the test type as ``` test $DIR/test-type.rs - f (line 12) ... ignored test $DIR/test-type.rs - f (line 15) - compile ... ok test $DIR/test-type.rs - f (line 21) - compile fail ... ok test $DIR/test-type.rs - f (line 6) ... ok ``` by indicating the test type after the test name (and in the case of doctest after the function name and line) and before the "...". ------------ Note: this is a proof of concept, the implementation is probably not optimal as the properties added in `TestDesc` are only use in the display and does not represent actual change of behavior, maybe `TestType::DocTest` could have fields
2021-06-06Don't pass -Z unstable-options by default for UI testsJoshua Nelson-0/+6
- Pass it explicitly where appropriate - Update stderr files and warnings; it turns that unstable-options has far-reaching effects on diagnostics.
2021-06-04rustdoc: Print a warning if the diff when comparing to old nightlies is emptyJoshua Nelson-9/+21
This avoids confusing situations where it's unclear whether there's a bug in the diff tool or not: ``` 26: @has check failed `XPATH PATTERN` did not match // @has - '//code/a[@href="{{channel}}/std/primitive.i32.html"]' 'i32' Encountered 6 errors ------------------------------------------ info: generating a diff against nightly rustdoc failures: [rustdoc] rustdoc/primitive-reexport.rs ```
2021-05-29BPF: misc minor review fixesAlessandro Decina-6/+2
2021-05-23Add BPF targetAlessandro Decina-0/+7
This change adds the bpfel-unknown-none and bpfeb-unknown-none targets which can be used to generate little endian and big endian BPF
2021-05-18Rollup merge of #84883 - durin42:allow-unused-prefixes, r=nikicJack Huey-1/+5
compiletest: "fix" FileCheck with --allow-unused-prefixes The default of --allow-unused-prefixes used to be false, but in LLVM change 87dbdd2e3b (https://reviews.llvm.org/D95849) the default became true. I'm not quite sure how we could do better here (specifically not providing the CHECK prefix when it's not needed), but this seems to work for now. This reduces codegen test failures against LLVM HEAD from 31 cases to 5.
2021-05-17runtest: correctly guard against LLVM version 13Augie Fackler-1/+5
2021-05-16remove mode for run and ignore testsAliénore Bouttefeux-4/+3
2021-05-12Auto merge of #83813 - cbeuw:remap-std, r=michaelwoeristerbors-0/+6
Fix `--remap-path-prefix` not correctly remapping `rust-src` component paths and unify handling of path mapping with virtualized paths This PR fixes #73167 ("Binaries end up containing path to the rust-src component despite `--remap-path-prefix`") by preventing real local filesystem paths from reaching compilation output if the path is supposed to be remapped. `RealFileName::Named` introduced in #72767 is now renamed as `LocalPath`, because this variant wraps a (most likely) valid local filesystem path. `RealFileName::Devirtualized` is renamed as `Remapped` to be used for remapped path from a real path via `--remap-path-prefix` argument, as well as real path inferred from a virtualized (during compiler bootstrapping) `/rustc/...` path. The `local_path` field is now an `Option<PathBuf>`, as it will be set to `None` before serialisation, so it never reaches any build output. Attempting to serialise a non-`None` `local_path` will cause an assertion faliure. When a path is remapped, a `RealFileName::Remapped` variant is created. The original path is preserved in `local_path` field and the remapped path is saved in `virtual_name` field. Previously, the `local_path` is directly modified which goes against its purpose of "suitable for reading from the file system on the local host". `rustc_span::SourceFile`'s fields `unmapped_path` (introduced by #44940) and `name_was_remapped` (introduced by #41508 when `--remap-path-prefix` feature originally added) are removed, as these two pieces of information can be inferred from the `name` field: if it's anything other than a `FileName::Real(_)`, or if it is a `FileName::Real(RealFileName::LocalPath(_))`, then clearly `name_was_remapped` would've been false and `unmapped_path` would've been `None`. If it is a `FileName::Real(RealFileName::Remapped{local_path, virtual_name})`, then `name_was_remapped` would've been true and `unmapped_path` would've been `Some(local_path)`. cc `@eddyb` who implemented `/rustc/...` path devirtualisation
2021-05-09fix compiletest to search for two dash and run make fulldeps testAliénore Bouttefeux-1/+1
2021-05-09add bootstrap cfgAliénore Bouttefeux-0/+2
2021-05-07Rollup merge of #84734 - tmandry:compiletest-needs-unwind, r=Mark-SimulacrumDylan DPC-6/+30
Add `needs-unwind` and beginning of support for testing `panic=abort` std to compiletest For the Fuchsia platform we build libstd with `panic=abort` and would like a way to run tests with that enabled. This adds low-level support for this directly to compiletest. In the future I'd like to add high-level support in rustbuild, e.g. having target-specific flags that allow configuring a panic strategy. (Side note: It would be nice if we could also build multiple configurations for the same target, but I'm getting ahead of myself.) This plus #84500 have everything that's needed to get ui tests passing on fuchsia targets. Part of #84766. Note that this change only includes the header on tests which need an unwinder to _build_, not those which need it to _run_. r? ````@Mark-Simulacrum````
2021-05-07Rollup merge of #84500 - tmandry:compiletest-run-flag, r=Mark-SimulacrumDylan DPC-14/+71
Add --run flag to compiletest This controls whether run-* tests actually get run. r? ```@Mark-Simulacrum```
2021-05-06Support multi target-rustcflags for -Zpanic-abort-testsTyler Mandry-4/+4
I just need this until rustbuild supports -Cpanic=abort std directly.
2021-05-06compiletest: Add --target-panic, needs-unwindTyler Mandry-2/+26
2021-05-04Normalise remapped sysroot path as $SRC_DIRAndy Wang-0/+6
2021-05-03compiletest: "fix" FileCheck with --allow-unused-prefixesAugie Fackler-1/+1
The default of --allow-unused-prefixes used to be false, but in LLVM change 87dbdd2e3b (https://reviews.llvm.org/D95849) the default became true. I'm not quite sure how we could do better here (specifically not providing the CHECK prefix when it's not needed), but this seems to work for now.
2021-05-03proof of concept add test type on printsAliénore Bouttefeux-0/+2
2021-04-30Add needs-run-enabled directive for should-fail testsTyler Mandry-5/+14
I was wary of doing any automatic disabling here, since should-fail is how we test compiletest itself.
2021-04-30Include --run in stamp hashTyler Mandry-0/+1
2021-04-30Add support for --run for non-ui testsTyler Mandry-16/+42
2021-04-30Add --run flag to compiletestTyler Mandry-5/+26
This controls whether run-* tests actually get run.
2021-04-27Rollup merge of #84132 - Manishearth:lldb-nonstandard, r=Mark-SimulacrumDylan DPC-1/+1
Ignore nonstandard lldb version strings in compiletest Fixes https://github.com/rust-lang/rust/issues/84131 Unsure if I should do the same for the Apple LLDB branch above.
2021-04-23Remove unstable `--pretty` flagJoshua Nelson-2/+2
It doesn't do anything `--unpretty` doesn't, and due to a bug, also didn't show up in `--help`. I don't think there's any reason to keep it around, I haven't seen anyone using it.
2021-04-16Error when compiletest is passed duplicate revisionsAaron Hill-9/+19
Currently, we allow the user to write things like '// revisions: rpass1 rpass1', which will not test what they were intending to test.
2021-04-13Check for asm support in UI tests that require itTomasz Miąsko-0/+25
Add `needs-asm-support` compiletest directive, and use it in asm tests that require asm support without relying on any architecture specific features.
2021-04-12Ignore nonstandard lldb version strings in compiletestManish Goregaokar-1/+1
2021-04-09Auto merge of #81942 - the8472:reduce-ui-test-threads, r=Mark-Simulacrumbors-0/+1
reduce threads spawned by ui-tests The test harness already spawns enough tests to keep all cores busy. Individual tests should keep their own threading to a minimum to avoid context switch overhead. When running ui tests with lld enabled this shaves about 10% off that testsuite on my machine. Resolves #81946
2021-04-09reduce threads spawned by ui-testsThe8472-0/+1
the test harness already spawns enough tests for all cores, individual tests should keep their own threading to a minimum to avoid context switch overhead some tests fail with 1 CGU, so explicit compile flags have been added to keep their old behavior
2021-04-06Fix handling of `--output-format json` flagJoshua Nelson-1/+1
- Don't treat it as deprecated on stable and beta channels. Before, it would give confusing and incorrect output: ``` warning: the 'output-format' flag is considered deprecated | = warning: see issue #44136 <https://github.com/rust-lang/rust/issues/44136> for more information error: json output format isn't supported for doc generation ``` Both of those are wrong: output-format isn't deprecated, and json output is supported. - Require -Z unstable-options for `--output-format json` Previously, it was allowed by default on nightly, which made it hard to realize the flag wouldn't be accepted on beta or stable. Note that this still allows `--output-format html`, which has been stable since 1.0. - Remove unnecessary double-checking of the feature gate when parsing the output format - Add custom run-make test since compiletest passes -Zunstable-options by default
2021-04-05Rollup merge of #83705 - jyn514:theme-error, r=GuillaumeGomezDylan DPC-2/+1
Give a better error when --theme is not a CSS file Before: ``` error: invalid argument: "bacon.toml" ``` After: ``` error: invalid argument: "bacon.toml" | = help: arguments to --theme must be CSS files ``` cc https://github.com/rust-lang/rust/pull/83478
2021-04-04Rollup merge of #83532 - asomers:gdb-fbsd, r=Mark-SimulacrumDylan DPC-1/+5
Fix compiletest on FreeBSD Recent FreeBSD gdb packages have a different format for the version string.
2021-04-03Auto merge of #83738 - jyn514:only-load-some-crates, r=petrochenkovbors-2/+2
rustdoc: Don't load all extern crates unconditionally Instead, only load the crates that are linked to with intra-doc links. This doesn't help very much with any of rustdoc's fundamental issues with freezing the resolver, but it at least fixes a stable-to-stable regression, and makes the crate loading model somewhat more consistent with rustc's. I tested and it unfortunately does not help at all with https://github.com/rust-lang/rust/pull/82496. Closes https://github.com/rust-lang/rust/issues/68427. Let me know if you want me to open a separate issue for not freezing the resolver. r? `@petrochenkov` cc `@eddyb` `@ollie27`