about summary refs log tree commit diff
path: root/src/tools/compiletest
AgeCommit message (Collapse)AuthorLines
2023-12-14update use of feature flagslcnr-2/+2
2023-12-07also print 'immutable' flagRalf Jung-2/+5
2023-11-30Auto merge of #118036 - DianQK:thinlto-tests, r=tmiaskobors-15/+55
Add thinlto support to codegen, assembly and coverage tests Using `--emit=llvm-ir` with thinlto usually result in multiple IR files. Resolve test case failure issue reported in #113923.
2023-11-30Add thinlto support to codegen, assembly and coverage testsDianQK-15/+55
2023-11-29Auto merge of #118132 - onur-ozkan:stdlib-assertion-status-to-compiletest, ↵bors-2/+8
r=wesleywiser utilize stdlib debug assertion status in compiletest Implemented a new flag `--with-debug-assertions` on compiletest to pass the stdlib debug assertion status from bootstrap. Resolves #115171
2023-11-24Replace `option.map(cond) == Some(true)` with `option.is_some_and(cond)`David Tolnay-1/+1
2023-11-21utilize stdlib debug assertion status in compiletestonur-ozkan-2/+8
Implemented a new flag, `--with-debug-assertions` on compiletest to pass the stdlib debug assertion status from bootstrap. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-11-17Rollup merge of #117338 - workingjubilee:asmjs-meets-thanatos, r=b-naberMatthias Krüger-15/+1
Remove asmjs Fulfills [MCP 668](https://github.com/rust-lang/compiler-team/issues/668). `asmjs-unknown-emscripten` does not work as-specified, and lacks essential upstream support for generating asm.js, so it should not exist at all.
2023-11-15Re-format code with new rustfmtMark Rousskov-3/+1
2023-11-11Auto merge of #115694 - clarfonthey:std-hash-private, r=dtolnaybors-2/+1
Add `std::hash::{DefaultHasher, RandomState}` exports (needs FCP) This implements rust-lang/libs-team#267 to move the libstd hasher types to `std::hash` where they belong, instead of `std::collections::hash_map`. <details><summary>The below no longer applies, but is kept for clarity.</summary> This is a small refactor for #27242, which moves the definitions of `RandomState` and `DefaultHasher` into `std::hash`, but in a way that won't be noticed in the public API. I've opened rust-lang/libs-team#267 as a formal ACP to move these directly into the root of `std::hash`, but for now, they're at least separated out from the collections code in a way that will make moving that around easier. I decided to simply copy the rustdoc for `std::hash` from `core::hash` since I think it would be ideal for the two to diverge longer-term, especially if the ACP is accepted. However, I would be willing to factor them out into a common markdown document if that's preferred. </details>
2023-11-09Auto merge of #117122 - ferrocene:pa-configure-git-diff, r=albertlarsan68bors-3/+20
Allow configuring the parent GitHub repository The git integration in build_helper hardcoded `rust-lang/rust` as the parent GitHub repository, and `master` as the branch name. This works great for `rust-lang/rust`, but causes problems in downstream forks like Ferrocene whenever those functions are invoked (like `./x fmt`). In `src/stage0.json` there was already a configuration key for the name of the nightly branch, but it wasn't used by build_helper. This PR adds the `github_repository` key to the file, and requires both values to be passed to build_helper whenever a git function is called. This will allow downstream forks to tweak the values.
2023-11-09fmtPietro Albini-4/+1
2023-11-08coverage: Rename the `run-coverage` test mode to `coverage-run`Zalathar-11/+11
This makes it more consistent with the `coverage-map` mode and the shared `tests/coverage` test directory.
2023-11-08Auto merge of #117484 - Zalathar:tests, r=cjgillotbors-5/+15
coverage: Unify `tests/coverage-map` and `tests/run-coverage` into `tests/coverage` Ever since the introduction of the `coverage-map` suite, it's been awkward to have to manage two separate coverage test directories containing dozens of mostly-identical files. However, those two suites were separate for good reasons. They have very different requirements (since only one of them requires actually running the test program), running only one suite is noticeably faster than running both, and having separate suites allows them to be blessed separately if desired. So while unifying them was an obvious idea, actually doing so was non-trivial. --- Nevertheless, this PR finds a way to merge the two suites into one directory while retaining almost all of the developer-experience benefits of having two suites. This required non-trivial implementations of `Step`, but the end result works very smoothly. --- The first 5 commits are a copy of #117340, which has been closed in favour of this PR.
2023-11-07coverage: Give each coverage test mode a separate output directoryZalathar-2/+12
When multiple test modes share the same test directory, this will allow them to avoid interfering with each others' files and timestamps.
2023-11-07coverage: Copy all remaining run-coverage tests into coverage-mapZalathar-1/+1
These multi-file tests were not copied over in #114843 because they weren't working, but it turns out that they just need the correct crate-type.
2023-11-07coverage: Use `-Copt-level=2` by default in run-coverage testsZalathar-2/+2
This is a step towards being able to unify the two coverage test directories. There are two tests that require adjustment: - `overflow.rs` requires an explicit `-Coverflow-checks=yes` - `sort_groups.rs` is sensitive to provably unused instantiations
2023-11-06Allow tests with rust-rustfix and revisionsMatthew Jasper-1/+1
2023-11-06rename github_repository to git_repositoryPietro Albini-5/+5
2023-11-02Add insta-stable std::hash::{DefaultHasher, RandomState} exportsltdk-2/+1
2023-10-28Remove asmjs from toolsJubilee Young-15/+1
2023-10-27Don't provide `rust-demangler` to run-make testsZalathar-4/+0
The demangler was only needed by coverage tests, but those tests were migrated into their own custom test mode in #112300. This avoids having to build the demangler just for run-make tests. It will still be built as needed by run-coverage tests or for other purposes.
2023-10-25compiletest: Display compilation errors in mir-opt testsTomasz Miąsko-1/+1
2023-10-24allow configuring the parent GitHub repositoryPietro Albini-3/+23
The git integration in build_helper hardcoded `rust-lang/rust` as the parent GitHub repository, and `master` as the branch name. This works great for `rust-lang/rust`, but causes problems in downstream forks like Ferrocene whenever those functions are invoked (like `./x fmt`). In `src/stage0.json` there was already a configuration key for the name of the nightly branch, but it wasn't used by build_helper. This commit adds the `github_repository` key to the file, and requires both values to be passed to build_helper whenever a git function is called. This will allow downstream forks to tweak the values.
2023-10-23Fix comment: coverage-map tests compile to LLVM IR, not MIRZalathar-1/+1
2023-10-19Allow to run filecheck in mir-opt tests.Camille GILLOT-39/+26
2023-10-16Stop trying to preserve pretty-printing.Camille GILLOT-17/+17
2023-10-16Elaborate comment.Camille GILLOT-0/+2
2023-10-16Motivate renumbering and avoid underflow.Camille GILLOT-3/+6
2023-10-16Normalize alloc-id in tests.Camille GILLOT-0/+29
2023-10-14Auto merge of #116407 - Mark-Simulacrum:bootstrap-bump, r=onur-ozkanbors-11/+8
Bump bootstrap compiler to just-released beta https://forge.rust-lang.org/release/process.html#master-bootstrap-update-t-2-day-tuesday
2023-10-08compiletest: add a way to specify params with spacesMichael Howell-1/+9
This use single quotes, because those aren't used in params, while double quotes are and would be tougher to parse.
2023-10-08Bump to latest betaMark Rousskov-11/+8
2023-10-08linker: Remove `-Zgcc-ld` optionVadim Petrochenkov-2/+2
It is subsumed by `-Clinker-flavor=*-lld-cc -Clink-self-contained=+linker` options now
2023-09-29add needs-relocation-model-pic to compiletestPietro Albini-0/+11
2023-09-21compiletest: load supports-xray from target specTomasz Miąsko-15/+3
2023-09-21compiletest: load supported sanitizers from target specTomasz Miąsko-101/+31
2023-09-21compiletest: use builder pattern to construct Config in testsTomasz Miąsko-93/+141
2023-09-21Fix ui-fulldeps --stage=1 with -Zignore-directory-in-diagnostics-source-blocksMichael Goulet-8/+11
2023-09-19Auto merge of #115644 - danakj:catalyst-asan, r=cjgillot,thomccbors-0/+5
Enable ASAN/LSAN/TSAN for *-apple-ios-macabi The -macabi targets are iOS running on MacOS, and they use the runtime libraries for MacOS, thus they have the same sanitizers available as the *-apple-darwin targets. This is based on the work of https://github.com/rust-lang/rust/commit/aacf3213b142f074999429eab767ef7b53c3a1a5. Closes #113935.
2023-09-19Rollup merge of #115943 - ehuss:compiletest-errors, r=compiler-errorsMatthias Krüger-8/+8
compiletest: Don't swallow some error messages. This updates some error handling in compiletest to display the underlying error rather than discarding it. There have been cases where the lack of error information makes it difficult to understand what went wrong.
2023-09-18compiletest: Don't swallow some error messages.Eric Huss-8/+8
2023-09-18Enable ASAN/LSAN/TSAN for *-apple-ios-macabidanakj-0/+5
The -macabi targets are iOS running on MacOS, and they use the runtime libraries for MacOS, thus they have the same sanitizers available as the *-apple-darwin targets.
2023-09-15avoid blessing cargo deps's source code in ui testsPietro Albini-0/+10
2023-09-13Auto merge of #115706 - RalfJung:compiletest-truncation, r=wesleywiserbors-70/+74
Make compiletest output truncation less disruptive When the test output becomes too large, compiletest stops recording all of it. However: - this can lead to invalid JSON, which then causes compiletest itself to throw further errors - the note that output was truncated is in the middle of the output, with >100kb of text on each side; that makes it almost impossible to actually see that note in the terminal So assuming that we do need to keep the output truncation, I propose that we only ever do a cut at the end, so that it is very clear by looking at the end of the log that truncation happened. I added a message at the beginning of the output as well. Also I added some logic to make it less likely that we'll cut things off in the middle of a JSON record. (I tested that successfully by reducing the output limit to something very low and running a few ui tests.) Furthermore I increased the max buffer size to 512KB; that's really not a lot of memory compared to how much RAM it takes to build rustc (it's ~25% more than the previous maximum HEAD+TAIL length). And finally, the information that things got truncated is now propagated to the higher levels, so that we can fail the test instead of comparing the truncated output with the reference. Fixes https://github.com/rust-lang/rust/issues/115675 Fixes https://github.com/rust-lang/rust/issues/96229 Fixes https://github.com/rust-lang/rust/issues/94322 Fixes https://github.com/rust-lang/rust/issues/92211
2023-09-12Auto merge of #115128 - davidtwco:re-enable-debuginfo-test, r=wesleywiserbors-0/+9
tests: re-enable pretty-std-collections on macOS Fixes #78665. I made some small modifications to this test so that it would pass for me locally (though I was only able to test using lldb without built-in Rust support, but that seems to be the mode in which it would fail). I ran it a few hundred times with stage one and stage two to see if I could re-produce the spurious failures that were being reported in #78665 and couldn't. From the discussion in #78665, it seemed like this was related to Xcode versions and could be reproduced locally fairly easily. It's been a couple years since this was disabled so a lot has changed. If this starts failing spuriously again then we can disable it and I can look into that. r? `@wesleywiser` (discussed in wg-debugging's triage meeting)
2023-09-09don't even try to compare with reference when there was truncationRalf Jung-7/+43
2023-09-09compiletest: only truncate at the end, to make it more clearly visibleRalf Jung-63/+31
2023-09-05Add test suite `coverage-map` to test coverage mappings emitted by LLVMZalathar-5/+74
We compile each test file to LLVM IR assembly, and then pass that IR to a dedicated program that can decode LLVM coverage maps and print them in a more human-readable format. We can then check that output against known-good snapshots. This test suite has some advantages over the existing `run-coverage` tests: - We can test coverage instrumentation without needing to run target binaries. - We can observe subtle improvements/regressions in the underlying coverage mappings that don't make a visible difference to coverage reports.
2023-08-30compiletest: support for newer lldb versionsDavid Wood-0/+9
Newer lldb versions disable printing of persistent results by default, but lots of rustc debuginfo tests rely on these being printed, so re-enable this by defining an alias as suggested by the patch which disabled persistent result printing in lldb. Signed-off-by: David Wood <david@davidtw.co>