summary refs log tree commit diff
path: root/src/tools/compiletest
AgeCommit message (Collapse)AuthorLines
2023-03-01Highlight whole expression for E0599clubby789-6/+7
2023-02-21Rollup merge of #108313 - chenyukang:yukang/fix-only-modified, r=oli-obkMatthias Krüger-1/+2
Fix compiletest possible crash in option only-modified `fixed` files maybe removed, `unwrap` will crash in this scenario.
2023-02-21replace lazy_static with once_cellklensy-44/+37
2023-02-21Fix compiletest crash when test file path does not existyukang-1/+2
2023-02-21compiletest: bump miow crateklensy-1/+1
2023-02-18Auto merge of #106476 - ↵bors-0/+6
keith:ks/add-sanitizer-support-for-modern-ios-platforms, r=badboy Add sanitizer support for modern iOS platforms asan and tsan generally support iOS, but that previously wasn't configured in rust. This only adds support for the simulator architectures, and arm64 device architecture, not the older 32 bit architectures.
2023-02-14Add `kernel-address` sanitizer support for freestanding targetsWesley Norris-0/+9
2023-02-12Add sanitizer support for modern iOS platformsKeith Smiley-0/+6
asan and tsan generally support iOS, but that previously wasn't configured in rust. This only adds support for the simulator architectures, and arm64 device architecture, not the older 32 bit architectures.
2023-02-11Rollup merge of #107657 - chenyukang:yukang/add-only-modified, r=albertlarsan68Matthias Krüger-6/+54
Add only modified subcommand for compiletest r? `@jyn514` From [discussion](https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/Add.20subcommand.20to.20retest.20all.20tests.20with.20different.20results)
2023-02-10cleanup and fix namingyukang-9/+12
2023-02-10add only modified for compiletestyukang-6/+51
2023-02-09Test XRay only for supported targetsOleksii Lozovskyi-0/+15
Now that the compiler accepts "-Z instrument-xray" option only when targeting one of the supported targets, make sure to not run the codegen tests where the compiler will fail. Like with other compiletests, we don't have access to internals, so simply hardcode a list of supported architectures here.
2023-01-22Print why a test was ignored if it's the only test specified.Lenko Donchev-28/+54
2023-01-22Rollup merge of #107127 - uweigand:s390x-sanitizer, r=Mark-SimulacrumMatthias Krüger-2/+9
Enable sanitizers for s390x-linux Include sanitizers supported by LLVM on s390x (asan, lsan, msan, tsan) in the target definition, as well as in the compiletest supported list. Build sanitizer runtime for the target. Enable sanitizers in the CI.
2023-01-22Rollup merge of #107102 - compiler-errors:new-solver-new-candidats-4, r=lcnrMatthias Krüger-0/+7
Implement some more predicates in the new solver Implement a few more goals. The subtype goal specifically is important, since it's required for this code to compile: ``` fn main() { let mut x = vec![]; x.push(1i32); } ``` (I think we emit a subtype goal here because of coercion). Drive-by: Also implements `--compare-mode=next-solver` -- I've been using this locally a lot to find out what works and what doesn't. I'm also happy to split this out into another PR. r? `@lcnr`
2023-01-21Auto merge of #105924 - TimNN:ui-remap, r=Mark-Simulacrumbors-7/+54
Remap paths in UI tests by default If you think this needs further discussions / something RFC-like, please let me know the best forum for that. This PR runs UI tests with a remapped "src base" directory by default. Why? Because some UI tests currently depend on the length of the absolute path to the `src/test/ui` directory. Remapping makes the tests independent of the absolute path. The path to the source file (which is absolute on CI) is part of the type name of closures. `rustc` diagnostic output depends on the length of type names (long type names are truncated). So a long absolute path leads to long closure type names, which leads to truncation and changed diagnostics. (I initially tried just disabling type name truncation, but that made some error messages stupid long (thousands of characters, IIRC)). Additional changes: * All boolean `compiletest` directives now support explicit `no-` versions to disable them. * Adapt existing tests when necessary: * Disable remapping for individual tests that fail with it enabled (when there's no obvious alternative fix). * For tests that already check something remapping related switch to the new option unless we gain something significant by keeping the manual remap. Passed Windows CI in https://github.com/rust-lang/rust/actions/runs/3933100590
2023-01-21Add compare-mode-next-solverMichael Goulet-0/+7
2023-01-20Enable sanitizers for s390x-linuxUlrich Weigand-2/+9
Include sanitizers supported by LLVM on s390x (asan, lsan, msan, tsan) in the target definition, as well as in the compiletest supported list. Build sanitizer runtime for the target. Enable sanitizers in the CI.
2023-01-20Auto merge of #107106 - matthiaskrgr:rollup-g7r1ep0, r=matthiaskrgrbors-1/+6
Rollup of 6 pull requests Successful merges: - #106699 ([drop tracking] Visit break expressions ) - #106738 (Fix known-bug annotations) - #106891 (Tweak "borrow closure argument" suggestion) - #106928 (add raw identifier for keyword in suggestion) - #107065 (Clippy: Make sure to include in beta: Move `unchecked_duration_subtraction` to pedantic) - #107068 (autoderive Subdiagnostic for AddtoExternBlockSuggestion) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-01-20Auto merge of #106090 - WaffleLapkin:dereffffffffff, r=Nilstriebbors-2/+11
Remove some `ref` patterns from the compiler Previous PR: https://github.com/rust-lang/rust/pull/105368 r? `@Nilstrieb`
2023-01-19Make bare known-bug an errorMichael Goulet-1/+6
2023-01-18Remove extra removal from test pathGuillaume Gomez-1/+1
2023-01-17Hack compiletest to fix a random CI failureMaybe Waffle-2/+11
2023-01-16ui tests: Remap test base directory by default.Tim Neumann-0/+3
2023-01-16compiletest: Support running with a remapped base directory.Tim Neumann-5/+36
2023-01-16compiletest: Generic support for "no-" versions of boolean directives.Tim Neumann-2/+15
2023-01-11Change `src/test` to `tests` in source files, fix tidy and testsAlbert Larsan-8/+6
2023-01-05Add vendor to Fuchsia's target tripleDavid Koloski-4/+4
Historically, Rust's Fuchsia targets have been labeled x86_64-fuchsia and aarch64-fuchsia. However, they should technically contain vendor information. This CL changes Fuchsia's target triples to include the "unknown" vendor since Clang now does normalization and handles all triple spellings. This was previously attempted in #90510, which was closed due to inactivity.
2023-01-04Update tests, etcMichael Goulet-1/+1
2022-12-24Rollup merge of #106078 - nikic:filecheck-context, r=Mark-SimulacrumMatthias Krüger-0/+2
Provide more context on FileCheck failures FileCheck provides 5 lines of context by default. This is often insufficient to analyze failures that happen in CI. Increase the amount of context to 100 lines.
2022-12-23Provide more context on FileCheck failuresNikita Popov-0/+2
FileCheck provides 5 lines of context by default. This is often insufficient to analyze failures that happen in CI. Increase the amount of context to 100 lines.
2022-12-22Take revision into account in src/test/ui incremental testsMichael Goulet-3/+7
2022-12-13Make some diagnostics not depend on the source of what they reference being ↵Oli Scherer-0/+8
available
2022-12-10Rollup merge of #105109 - rcvalle:rust-kcfi, r=bjorn3Matthias Krüger-0/+4
Add LLVM KCFI support to the Rust compiler This PR adds LLVM Kernel Control Flow Integrity (KCFI) support to the Rust compiler. It initially provides forward-edge control flow protection for operating systems kernels for Rust-compiled code only by aggregating function pointers in groups identified by their return and parameter types. (See llvm/llvm-project@cff5bef.) Forward-edge control flow protection for C or C++ and Rust -compiled code "mixed binaries" (i.e., for when C or C++ and Rust -compiled code share the same virtual address space) will be provided in later work as part of this project by identifying C char and integer type uses at the time types are encoded (see Type metadata in the design document in the tracking issue #89653). LLVM KCFI can be enabled with -Zsanitizer=kcfi. Thank you again, `@bjorn3,` `@eddyb,` `@nagisa,` and `@ojeda,` for all the help!
2022-12-08Add LLVM KCFI support to the Rust compilerRamon de C Valle-0/+4
This commit adds LLVM Kernel Control Flow Integrity (KCFI) support to the Rust compiler. It initially provides forward-edge control flow protection for operating systems kernels for Rust-compiled code only by aggregating function pointers in groups identified by their return and parameter types. (See llvm/llvm-project@cff5bef.) Forward-edge control flow protection for C or C++ and Rust -compiled code "mixed binaries" (i.e., for when C or C++ and Rust -compiled code share the same virtual address space) will be provided in later work as part of this project by identifying C char and integer type uses at the time types are encoded (see Type metadata in the design document in the tracking issue #89653). LLVM KCFI can be enabled with -Zsanitizer=kcfi. Co-authored-by: bjorn3 <17426603+bjorn3@users.noreply.github.com>
2022-12-07Make -Zsimulate-remapped-rust-src-base reproducible on CIOli Scherer-0/+2
2022-12-06Rollup merge of #105246 - JakobDegen:run-mir-tests, r=jyn514Yuki Okushi-4/+4
Fix --pass in compiletest This makes `x test src/test/mir-opt --pass run` actually do the thing it says it does. The resulting tests do not pass, I'll fix that in a follow up.
2022-12-04Fix --pass in compiletestJakob Degen-4/+4
2022-12-01Create a hacky fail-fast mode that stops tests at the first failureOli Scherer-0/+1
2022-11-19Auto merge of #104470 - ehuss:cdb-dupe-last-command, r=jyn514bors-1/+1
Don't duplicate last cdb debuginfo test command cdb scripts interpret a blank line to mean "repeat the last command", similar to what happens when running the debugger from a console. The code for compiletest that constructs the debugger script was inserting a blank line between the last command and the "quit" command. This caused the last command to be executed twice. This can cause some confusion since the `-check` lines are expecting the output in a certain order. But printing the last command twice causes that order-assumption to fail, and that can cause confusion. This fixes it by removing the blank line. AFAICT, gdb and lldb scripts don't have the same behavior with blank lines (and the gdb code doesn't add any blank lines anyways).
2022-11-19Rollup merge of #103969 - ferrocene:pa-download-rustc-ui-tests, r=jyn514Matthias Krüger-16/+25
Partial support for running UI tests with `download-rustc` Right now trying to run UI tests with `download-rustc` results in a bunch of test failures, requiring someone who wants to only work on tests to also build the full compiler. This PR **partially** addresses the problem by solving a lot of the errors (but not all). * This installs the `rust-src` component on CI toolchains, since the test output depends on whether the standard library source code is installed; We can't just symlink the current source because the `rustc-dev` component already includes the compiler sources, but not the library sources, and mixing things is worse IMO. * This ensures the `$SRC_DIR` normalization done by compiletest correctly handles the source code added above. * This unconditionally sets `remap-prefix` to the prefix used in the downloaded toolchain, to ensure compiletest normalizes it.
2022-11-17add support for running binaries with remote-test-client on run-makePietro Albini-0/+4
2022-11-16normalize download-rustc's prefix when running compiletestsPietro Albini-0/+2
2022-11-16normalize source paths from sysroot in compiletestPietro Albini-16/+23
2022-11-15Don't duplicate last cdb debuginfo test commandEric Huss-1/+1
2022-11-04Auto merge of #103298 - ferrocene:pa-compile-flags-last, r=jyn514bors-39/+71
Ensure that compile-flags arguments are the last in UI tests Before this PR, compiletest would add `-L path/to/aux` at the end of the rustc flags, even after the custom ones set with the compile-flags header comment. This made it impossible to check how rustc would behave when a flag requiring an argument was passed without the argument, because the argument would become `-L`. This PR fixes that by adding the `-L path/to/aux` before the arguments defined in compile-flags, at least for UI tests. Other test suites might either be fixed as well by this change, or still present the old behavior (`-L` is now always passed before, but other tests suites might add additional flags after the custom ones).
2022-11-03put custom flags as last in codegen and asm testsPietro Albini-33/+41
2022-11-01Rollup merge of #103781 - JakobDegen:mir-opt-tidy, r=jyn514Manish Goregaokar-92/+39
Detect unused files in `src/test/mir-opt` and error on them in tidy. Closes #97564 . Determining which files are generated by a given mir opt test is somewhat difficult. Because of this, we extract the logic for doing it out into a common crate that both compiletest and tidy can depend on. This avoids making compiletest a dependency of tidy which would negatively impact compile times for tidy. Testing for this is that it catches 5 files that violated this lint (and removes them).
2022-10-31Detect unused files in `src/test/mir-opt` and error on them in tidy.Jakob Degen-92/+39
2022-10-29compiletest: set the dylib path when gathering target cfgJosh Stone-33/+37
If the compiler is built with `rpath = false`, then it won't find its own libraries unless the library search path is set. We already do that while running the actual compiletests, but #100260 added another rustc command for getting the target cfg. Check compiletest suite=codegen mode=codegen (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu) thread 'main' panicked at 'error: failed to get cfg info from "[...]/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" --- stdout --- stderr [...]/build/x86_64-unknown-linux-gnu/stage1/bin/rustc: error while loading shared libraries: librustc_driver-a2a76dc626cd02d2.so: cannot open shared object file: No such file or directory ', src/tools/compiletest/src/common.rs:476:13 Now the library path is set here as well, so it works without rpath.