about summary refs log tree commit diff
path: root/src/tools/compiletest
AgeCommit message (Collapse)AuthorLines
2021-10-09Simplified 3 ifs found by clippy.Nicholas-Baron-12/+10
2021-10-09Simplified two printlns picked out by clippyNicholas-Baron-2/+2
2021-10-09Move check_debugger_output to the debugger moduleNicholas-Baron-64/+69
2021-10-09Move DebuggerCommands to its own fileNicholas-Baron-48/+71
2021-10-08Move read2_abbreviated function into read2.rsNicholas-Baron-70/+73
2021-10-07Rollup merge of #89082 - smoelius:master, r=kennytmJubilee-0/+2
Implement #85440 (Random test ordering) This PR adds `--shuffle` and `--shuffle-seed` options to `libtest`. The options are similar to the [`-shuffle` option](https://github.com/golang/go/blob/c894b442d1e5e150ad33fa3ce13dbfab1c037b3a/src/testing/testing.go#L1482-L1499) that was recently added to Go. Here are the relevant parts of the help message: ``` --shuffle Run tests in random order --shuffle-seed SEED Run tests in random order; seed the random number generator with SEED ... By default, the tests are run in alphabetical order. Use --shuffle or set RUST_TEST_SHUFFLE to run the tests in random order. Pass the generated "shuffle seed" to --shuffle-seed (or set RUST_TEST_SHUFFLE_SEED) to run the tests in the same order again. Note that --shuffle and --shuffle-seed do not affect whether the tests are run in parallel. ``` Is an RFC needed for this?
2021-10-03Make write_rustdoc_diff a more generic functionNicholas-Baron-8/+21
2021-10-03Extract a portion of diff writing code to separate functionNicholas-Baron-38/+50
2021-10-02Move items related to computing diffs to a separate fileNicholas-Baron-106/+109
2021-09-29Implement #85440Samuel E. Moelius III-0/+2
2021-09-23Support incremental in compiletest for non-incremental modes.Eric Huss-32/+56
2021-09-22Rollup merge of #89170 - rusticstuff:aarch64_macos_disable_leak_sanitizer, ↵the8472-1/+2
r=petrochenkov Disable the leak sanitizer on Macos aarch64 for now It is currently broken, see #88132.
2021-09-22Disable the leak sanitizer on Macos aarch64 for now.Hans Kratz-1/+2
It is currently broken, see #88132.
2021-09-20Migrate to 2021Mark Rousskov-1/+1
2021-09-17compiletest: Add m68k to ARCH_TABLEJohn Paul Adrian Glaubitz-0/+1
2021-08-26compiletest: allow `.` in remote test paths (can arise from revisions).Eduard-Mihai Burtescu-1/+1
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.