about summary refs log tree commit diff
path: root/src/tools/compiletest
AgeCommit message (Collapse)AuthorLines
2023-04-03Rollup merge of #109526 - bzEq:aix-libpath, r=Mark-SimulacrumMatthias Krüger-0/+2
LIBPATH is used as dylib's path environment variable on AIX See https://4js.com/online_documentation/fjs-fgl-3.00.05-manual-html/c_fgl_installation_017.html.
2023-03-30Rollup merge of #109509 - ehuss:overlapping-tests, r=Mark-SimulacrumYuki Okushi-2/+35
compiletest: Don't allow tests with overlapping prefix names Some tests will delete their output directory before starting. The output directory is based on the test names. If one test is the prefix of another test, then when that test starts, it could try to delete the output directory of the other test with the longer path, or otherwise clash with it while the two tests are trying to create/delete/modify the same directory. In practice, this manifested as a random error on macOS where two tests were trying to create/delete/create `rustdoc/primitive` and `rustdoc/primitive/no_std`, which resulted in an EINVAL (InvalidInput) error. This renames some of the offending tests, adds `compiletest-ignore-dir` to prevent compiletest from processing some files, and adds a check to prevent this from happening in the future. Fixes #109397
2023-03-29Use LIBPATH in compiletestKai Luo-0/+2
2023-03-27Rollup merge of #109445 - Teapot4195:issue-109407-fix, r=ozkanonurGuillaume Gomez-4/+13
Allow passing the --nocapture flag to compiletest closes #109407
2023-03-26Allow passing the --nocapture flag to compiletestAlex Huang-4/+13
2023-03-23Add a check to ensure tests with overlapping prefixes aren't added.Eric Huss-2/+35
Some tests will delete their output directory before starting. The output directory is based on the test names. If one test is the prefix of another test, then when that test starts, it could try to delete the output directory of the other test with the longer path.
2023-03-22Use -m option instead of looking for a cross-compiling version of dlltoolDaniel Paoliello-0/+15
2023-03-21Auto merge of #108659 - ferrocene:pa-test-metrics, r=Mark-Simulacrumbors-6/+12
Include executed tests in the build metrics (and use a custom test display impl) The main goal of this PR is to include all tests executed in CI inside the build metrics JSON files. I need this for Ferrocene, and `@Mark-Simulacrum` expressed desire to have this as well to ensure all tests are executed at least once somewhere in CI. Unfortunately implementing this required rewriting inside of bootstrap all of the code to render the test output to console. libtest supports outputting JSON instead of raw text, which we can indeed use to populate the build metrics. Doing that suppresses the console output though, and compared to rustc and Cargo the console output is not included as a JSON field. Because of that, this PR had to reimplement both the "pretty" format (one test per line, with `rust.verbose-tests = true`), and the "terse" format (the wall of dots, with `rust.verbose-tests = false`). The current implementation should have the exact same output as libtest, except for the benchmark output. libtest's benchmark output is broken in the "terse" format, so since that's our default I slightly improved how it's rendered. Also, to bring parity with libtest I had to introduce support for coloring output from bootstrap, using the same dependencies `annotate-snippets` uses. It's now possible to use `builder.color_for_stdout(Color::Red, "text")` and `builder.color_for_stderr(Color::Green, "text")` across all of bootstrap, automatically respecting the `--color` flag and whether the stream is a terminal or not. I recommend reviewing the PR commit-by-commit. r? `@Mark-Simulacrum`
2023-03-20migrate compiler, bootstrap, and compiletest to windows-rsAndy Russell-5/+14
2023-03-20Auto merge of #108148 - parthopdas:master, r=oli-obkbors-0/+10
Implementing "<test_binary> --list --format json" for use by IDE test explorers / runners Fixes #107307 PR 1 of 2 - wiring up just the new information + implement the command line changes i.e. --format json + tests upcoming: PR 2 of 2 - clean up "#[cfg(not(bootstrap))]" from PR 1 As per the discussions on - MCP: https://rust-lang.zulipchat.com/#narrow/stream/233931-t-compiler.2Fmajor-changes/topic/Implementing.20.22.3Ctest_binary.3E.20--list.20--form.E2.80.A6.20compiler-team.23592/near/328747548 - preRFC: https://internals.rust-lang.org/t/pre-rfc-implementing-test-binary-list-format-json-for-use-by-ide-test-explorers-runners/18308 - FYI on Discord: https://discord.com/channels/442252698964721669/459149169546887178/1075581549409484820
2023-03-19Rollup merge of #105793 - lukas-code:circular-deps, r=Mark-SimulacrumDylan DPC-15/+35
Add note for mismatched types because of circular dependencies If you have crate A with a dependency on crate B, and crate B with a dev-dependency on A, then you might see "mismatched types" errors on types that seem to be equal. This PR adds a note that explains that the types are different, because crate B is compiled twice, one time with `cfg(test)` and one time without. I haven't found a good way to create circular dependencies in UI tests, so I abused the incremental tests instead. As a bonus, incremental tests support "cpass" now. related to https://github.com/rust-lang/rust/issues/22750
2023-03-15Implementing "<test_binary> --list --format json" #107307 #49359Partha P. Das-0/+10
2023-03-06Append to PYTHONPATH in compiletestclubby789-2/+12
2023-03-05Add cpass to incremental testsLukas Markeffsky-15/+35
2023-03-03change approach to prevent interleaving compiletest messagePietro Albini-1/+1
2023-03-02add the --json flag to compiletestPietro Albini-5/+11
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!