about summary refs log tree commit diff
path: root/src/tools/compiletest
AgeCommit message (Collapse)AuthorLines
2024-04-01Modify compiletest and run-make-support to support CC invocations in rmake.rs许杰友 Jieyou Xu (Joe)-4/+10
2024-03-29compiletest: print reason for failing to read testsMichael Baikov-1/+3
2024-03-27Convert wasmtime check into a compiletest needs directive许杰友 Jieyou Xu (Joe)-0/+6
2024-03-27Accept only-wasm32-wasip1 directives许杰友 Jieyou Xu (Joe)-3/+4
2024-03-27Rollup merge of #123024 - maurer:kcfi-testing, r=workingjubileeGuillaume Gomez-0/+1
CFI: Enable KCFI testing of run-pass tests This enables KCFI-based testing for all the CFI run-pass tests in the suite today. We can add the test header on top of in-flight CFI tests once they land. This is becoming more important as we get closer to leveraging CFI's multiple type attachment feature, as that is where the implementations will have a divergence. It also enables KCFI as a sanitizer for x86_64 and aarch64 Linux to make this possible. The sanitizer should likely be available for all aarch64, x86_64, and riscv targets, but that isn't critical for initial testing.
2024-03-26Auto merge of #118644 - madsmtm:macos-weak-linking-test, r=compiler-errorsbors-0/+1
Add test for Apple's `-weak_framework` linker argument The [`-weak_framework`](https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPFrameworks/Concepts/WeakLinking.html) linker argument can sometimes be useful to reduce startup times, and to link newer frameworks while still having older deployment targets. So I made a test to ensure that it continues to work. Discussed in https://github.com/rust-lang/rust/issues/99427.
2024-03-26CFI: Enable KCFI testing of run-pass testsMatthew Maurer-0/+1
This enables KCFI-based testing for all the CFI run-pass tests in the suite today. We can add the test header on top of in-flight CFI tests once they land. It also enables KCFI as a sanitizer for x86_64 and aarch64 Linux to make this possible. The sanitizer should likely be available for all aarch64, x86_64, and riscv targets, but that isn't critical for initial testing.
2024-03-23Track run-make-support lib in common inputs stamp许杰友 Jieyou Xu (Joe)-0/+2
2024-03-20Rollup merge of #122786 - Enselic:remove_and_create_dir_all, r=onur-ozkanJacob Pratt-15/+12
compiletest: Introduce `remove_and_create_dir_all()` helper The code let _ = fs::remove_dir_all(&dir); create_dir_all(&dir).unwrap(); is duplicated in 7 places. Let's introduce a helper.
2024-03-20compiletest: Introduce remove_and_create_dir_all() helperMartin Nordholts-15/+12
The code let _ = fs::remove_dir_all(&dir); create_dir_all(&dir).unwrap(); is duplicated in 7 places. Let's introduce a helper.
2024-03-20compiletest: mir_dump_dir.as_path() -> &mir_dump_dirMartin Nordholts-1/+1
2024-03-20When comparing SVG tests against their blessed version, ignore the first lineEsteban Küber-5/+14
`anstyle_svg` has some weird non-determinism in the width parameter, which makes tests blessed in one environment to fail in another. This is the *only* non-determinism detected so far, so we modify the diff check to ignore the first line of the SVG. In order for a test to fail/be updated by `--bless`, a different part of the file needs to also have changed.
2024-03-20Auto merge of #122754 - Mark-Simulacrum:bootstrap-bump, r=albertlarsan68bors-9/+0
Bump to 1.78 bootstrap compiler https://forge.rust-lang.org/release/process.html#master-bootstrap-update-t-2-day-tuesday
2024-03-20step cfgsMark Rousskov-9/+0
2024-03-19Auto merge of #122029 - estebank:drive-by-ui-test, r=oli-obkbors-1/+1
When displaying multispans, ignore empty lines adjacent to `...` ``` error[E0308]: `match` arms have incompatible types --> tests/ui/codemap_tests/huge_multispan_highlight.rs:98:18 | 6 | let _ = match true { | ---------- `match` arms have incompatible types 7 | true => ( | _________________- 8 | | // last line shown in multispan header ... | 96 | | 97 | | ), | |_________- this is found to be of type `()` 98 | false => " | __________________^ ... | 119 | | 120 | | ", | |_________^ expected `()`, found `&str` error[E0308]: `match` arms have incompatible types --> tests/ui/codemap_tests/huge_multispan_highlight.rs:215:18 | 122 | let _ = match true { | ---------- `match` arms have incompatible types 123 | true => ( | _________________- 124 | | 125 | | 1 // last line shown in multispan header ... | 213 | | 214 | | ), | |_________- this is found to be of type `{integer}` 215 | false => " | __________________^ 216 | | 217 | | 218 | | 1 last line shown in multispan ... | 237 | | 238 | | ", | |_________^ expected integer, found `&str` ```
2024-03-19compiletest: Add support for `//@ aux-bin: foo.rs`Martin Nordholts-20/+71
Which enables ui tests to use auxiliary binaries. See the added self-test for an example.
2024-03-19compiletest: Replace bool with enum AuxType for clarityMartin Nordholts-23/+29
2024-03-19compiletest: Fix typos in get_lib_name() commentMartin Nordholts-2/+2
2024-03-18Support for visionOSAdam Gastineau-1/+1
2024-03-18Side-step small SVG width divergence by setting min-widthEsteban Küber-1/+1
2024-03-17compiletest: Remove unneeded pub on get_lib_name()Martin Nordholts-1/+1
2024-03-17Rollup merge of #122248 - jieyouxu:rmake-sysroot, r=Mark-SimulacrumMatthias Krüger-30/+36
Respect stage0 sysroot when compiling rmake.rs with COMPILETEST_FORCE_STAGE0 Context: <https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/stage0.20compiletest.20broken>. > cg_clif uses `COMPILETEST_FORCE_STAGE0=1 ./x.py test --stage 0` for running the rustc test suite. With the introduction of rmake.rs this broke. `librun_make_support.rlib` is compiled using the bootstrap rustc wrapper which sets `--sysroot build/aarch64-unknown-linux-gnu/stage0-sysroot`, but then compiletest will compile `rmake.rs` using the sysroot of the bootstrap compiler causing it to not find the `libstd.rlib` against which `librun_make_support.rlib` is compiled. cc ``@bjorn3`` Fixes #122196.
2024-03-17Auto merge of #121885 - reitermarkus:generic-nonzero-inner, ↵bors-42/+9
r=oli-obk,wesleywiser Move generic `NonZero` `rustc_layout_scalar_valid_range_start` attribute to inner type. Tracking issue: https://github.com/rust-lang/rust/issues/120257 r? `@dtolnay`
2024-03-14Remove LLDB persistent results in `compiletest`.Markus Reiter-9/+0
2024-03-14Deduplicate `lldb_commands`.Markus Reiter-33/+9
2024-03-14Fix `StdNonZeroNumberSummaryProvider`.Markus Reiter-1/+1
2024-03-14Try fixing `debuginfo` test.Markus Reiter-1/+1
2024-03-13Add compare-output-lines-by-subset to compiletest KNOWN_DIRECTIVE_NAMESMads Marquart-0/+1
2024-03-13compiletest: Allow `only-unix` in test headersMartin Nordholts-0/+3
The header `ignore-unix` is already allowed. Also extend tests.
2024-03-12Rollup merge of #122355 - fmease:rustdoc-fix-up-old-test, r=notriddleJubilee-1/+0
rustdoc: fix up old test `tests/rustdoc/line-breaks.rs` had several issues: 1. It used `//`@count`` instead of `// `@count`` (notice the space!) which gets treated as a `ui_test` directive instead of a `htmldocck` one. `compiletest` didn't flag it as an error because it's allowlisted ([#121561](https://github.com/rust-lang/rust/pull/121561)) presumably precisely because of this test. And before the compiletest→ui_test migration, these directives must've been ignored, too, because … 2. … the checks themselves no longer work either: The count of `<br>`s is actually 0 in all 3 cases because – well – we no longer generate any `<br>`s inside `<pre>`s. Since I don't know how to ``@count`` `\n`s instead of `<br>`s, I've turned them into ``@matches`.` Btw, I don't know if this test is still desirable or if we have other tests that cover this (I haven't checked). r? rustdoc
2024-03-12rustdoc: fix up old testLeón Orell Valerian Liehr-1/+0
2024-03-11compiletest: Automatically compare output by subset with runnersAlex Crichton-49/+20
This commit updates compiletest to automatically compare test output with subsets if a `--runner` argument is configured. Runners might inject extra information on failures, for example a WebAssembly runtime printing a wasm stack trace, which won't be in the output of a native runtime. The output with a `--runner` argument, however, should still have all the native output present.
2024-03-11Remove old support for emscripten/wasm32-u-uAlex Crichton-29/+1
This commit removes the `wasm32-shim.js` file, for example, and deletes old support for Emscripten which hasn't been exercised in some time.
2024-03-11Rollup merge of #122108 - alexcrichton:target-config-runtool, r=WaffleLapkinJacob Pratt-7/+9
Add `target.*.runner` configuration for targets This commit adds a `runner` field configuration to `config.toml` for specifying a wrapper executable when executing binaries for a target. This is pulled out of #122036 where a WebAssembly runtime is used, for example, to execute tests for `wasm32-wasip1`. The name "runner" here is chosen to match Cargo's `CARGO_*_RUNNER` configuration, and to make things a bit more consistent this additionally renames compiletest's `--runtool` argument to `--runner`.
2024-03-10Error on invalid compiletest directives in Rust test files许杰友 Jieyou Xu (Joe)-31/+172
2024-03-09Respect COMPILETEST_FORCE_STAGE0 sysroot when compiling rmake.rs许杰友 Jieyou Xu (Joe)-30/+36
2024-03-08Add `target.*.runner` configuration for targetsAlex Crichton-7/+9
This commit adds a `runner` field configuration to `config.toml` for specifying a wrapper executable when executing binaries for a target. This is pulled out of #122036 where a WebAssembly runtime is used, for example, to execute tests for `wasm32-wasip1`. The name "runner" here is chosen to match Cargo's `CARGO_*_RUNNER` configuration, and to make things a bit more consistent this additionally renames compiletest's `--runtool` argument to `--runner`.
2024-03-06compiletest: Add a `//@ needs-threads` directiveAlex Crichton-0/+35
This commit is extracted from #122036 and adds a new directive to the `compiletest` test runner, `//@ needs-threads`. This is intended to capture the need that a target must implement threading to execute a specific test, typically one that uses `std::thread`. This is primarily done for WebAssembly targets which currently do not have threads by default. This enables transitioning a lot of `//@ ignore-wasm*`-style ignores into a more self-documenting `//@ needs-threads` directive. Additionally the `wasm32-wasi-preview1-threads` target, for example, does actually have threads, but isn't tested in CI at this time. This change enables running these tests for that target, but not other wasm targets.
2024-03-04Auto merge of #120468 - alexcrichton:start-wasm32-wasi-rename, r=wesleywiserbors-0/+10
Add a new `wasm32-wasip1` target to rustc This commit adds a new target called `wasm32-wasip1` to rustc. This new target is explained in these two MCPs: * https://github.com/rust-lang/compiler-team/issues/607 * https://github.com/rust-lang/compiler-team/issues/695 In short, the previous `wasm32-wasi` target is going to be renamed to `wasm32-wasip1` to better live alongside the [new `wasm32-wasip2` target](https://github.com/rust-lang/rust/pull/119616). This new target is added alongside the `wasm32-wasi` target and has the exact same definition as the previous target. This PR is effectively a rename of `wasm32-wasi` to `wasm32-wasip1`. Note, however, that as explained in rust-lang/compiler-team#695 the previous `wasm32-wasi` target is not being removed at this time. This change will reach stable Rust before even a warning about the rename will be printed. At this time this change is just the start where a new target is introduced and users can start migrating if they support only Nightly for example.
2024-03-03Auto merge of #121877 - estebank:fancy-svg, r=compiler-errorsbors-3/+25
On tests that specify `--color=always` emit SVG file with stderr output Leverage `anstyle-svg`, as `cargo` does now, to emit `.svg` files instead of `.stderr` files for tests that explicitly enable color output. This will make reviewing changes to the graphical output of tests much more human friendly. <img src="https://raw.githubusercontent.com/rust-lang/rust/b4bdb56f86e136ca63bf71dca3034200c6c25900/tests/ui/error-emitter/highlighting.svg">
2024-03-02On tests that specify --color=always emit SVG file with stderr outputEsteban Kuber-3/+25
Leverage `anstyle-svg`, as `cargo` does now, to emit `.svg` files instead of `.stderr` files for tests that explicitly enable color output. This will make reviewing changes to the graphical output of tests much more human friendly.
2024-03-02Add a new `wasm32-wasip1` target to rustcAlex Crichton-0/+10
This commit adds a new target called `wasm32-wasip1` to rustc. This new target is explained in these two MCPs: * https://github.com/rust-lang/compiler-team/issues/607 * https://github.com/rust-lang/compiler-team/issues/695 In short, the previous `wasm32-wasi` target is going to be renamed to `wasm32-wasip1` to better live alongside the [new `wasm32-wasip2` target](https://github.com/rust-lang/rust/pull/119616). This new target is added alongside the `wasm32-wasi` target and has the exact same definition as the previous target. This PR is effectively a rename of `wasm32-wasi` to `wasm32-wasip1`. Note, however, that as explained in rust-lang/compiler-team#695 the previous `wasm32-wasi` target is not being removed at this time. This change will reach stable Rust before even a warning about the rename will be printed. At this time this change is just the start where a new target is introduced and users can start migrating if they support only Nightly for example.
2024-03-01Add initial support for DataFlowSanitizerRamon de C Valle-0/+8
Adds initial support for DataFlowSanitizer to the Rust compiler. It currently supports `-Zsanitizer-dataflow-abilist`. Additional options for it can be passed to LLVM command line argument processor via LLVM arguments using `llvm-args` codegen option (e.g., `-Cllvm-args=-dfsan-combine-pointer-labels-on-load=false`).
2024-02-29Add supporting infrastructure for `run-make` V2 tests许杰友 Jieyou Xu (Joe)-9/+269
2024-02-26Rollup merge of #120656 - Zalathar:filecheck-flags, r=wesleywiserGuillaume Gomez-16/+31
Allow tests to specify a `//@ filecheck-flags:` header This allows individual codegen/assembly/mir-opt tests to pass extra flags to the LLVM `filecheck` tool as needed. --- The original motivation was noticing that `tests/run-make/instrument-coverage` was very close to being an ordinary codegen test, except that it needs some extra logic to set up platform-specific variables to be passed into filecheck. I then saw the comment in `verify_with_filecheck` indicating that a `filecheck-flags` header might be useful for other purposes as well.
2024-02-23Ignore less tests in debug buildsBen Kimock-2/+5
2024-02-23Allow tests to specify a `//@ filecheck-flags:` headerZalathar-5/+14
Any flags specified here will be passed to LLVM's `filecheck` tool, in tests that use that tool.
2024-02-23Simplify existing code for setting `filecheck` flagsZalathar-11/+17
This removes a version check for LLVM >=13, and specifies prefixes as a series of independent `--check-prefix` flags instead of a single `--check-prefixes`.
2024-02-22Update compiletest to only accept `//@` directives许杰友 Jieyou Xu (Joe)-30/+13
2024-02-22Update list of known directive names for diagnostics许杰友 Jieyou Xu (Joe)-0/+52