about summary refs log tree commit diff
path: root/src/tools/compiletest
AgeCommit message (Collapse)AuthorLines
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
2024-02-21Rollup merge of #121373 - Zalathar:test-revision, r=oli-obkMatthias Krüger-65/+81
Consistently refer to a test's `revision` instead of `cfg` Compiletest allows a test file to specify multiple “revisions” (`//@ revisions: foo bar`), with each revision running as a separate test, and having the ability to define revision-specific headers (`//`@[foo]` ignore-blah`) and revision-specific code (`#[cfg(foo)]`). The code that implements this feature sometimes uses the term “cfg” instead of “revision”. This results in two confusingly-different names for the same concept, one of which is ambiguous with other kinds of configuration (such as compiletest's own config). This PR replaces those occurrences of `cfg` with `revision`, so that one name is used consistently.
2024-02-21Rollup merge of #121347 - davidtwco:compiletest-aux-aux, r=oli-obkLeón Orell Valerian Liehr-23/+23
compiletest: support auxiliaries with auxiliaries To test behaviour that depends on the extern options of intermediate crates, compiletest auxiliaries must have their own auxiliaries. Auxiliary compilation previously did not trigger compilation of any auxiliaries in the auxiliary's headers. In addition, those auxiliaries would need to be in an `auxiliary/auxiliary` directory, which is unnecessary and makes some crate graphs harder to write tests for, such as when A depends on B and C, and B depends on C. For a test `tests/ui/$path/root.rs`, with the following crate graph: ``` root |-- grandparent `-- parent `-- grandparent ``` then the intermediate outputs from compiletest will be: ``` build/$target/test/ui/$path/ |-- auxiliary | |-- libgrandparent.dylib | |-- libparent.dylib | |-- grandparent | | |-- grandparent.err | | `-- grandparent.out | `-- parent | |-- parent.err | `-- parent.out |-- libroot.rmeta |-- root.err `-- root.out ```
2024-02-21compiletest: support auxiliaries with auxiliariesDavid Wood-23/+23
To test behaviour that depends on the extern options of intermediate crates, compiletest auxiliaries must have their own auxiliaries. Auxiliary compilation previously did not trigger compilation of any auxiliaries in the auxiliary's headers. In addition, those auxiliaries would need to be in an `auxiliary/auxiliary` directory, which is unnecessary and makes some crate graphs harder to write tests for, such as when A depends on B and C, and B depends on C. For a test `tests/ui/$path/root.rs`, with the following crate graph: ``` root |-- grandparent `-- parent `-- grandparent ``` then the intermediate outputs from compiletest will be: ``` build/$target/test/ui/$path/ |-- auxiliary | |-- libgrandparent.dylib | |-- libparent.dylib | |-- grandparent | | |-- grandparent.err | | `-- grandparent.out | `-- parent | |-- parent.err | `-- parent.out |-- libroot.rmeta |-- root.err `-- root.out ``` Signed-off-by: David Wood <david@davidtw.co>
2024-02-21Flatten the parse logic in `line_directive`Zalathar-18/+13
2024-02-21Consistently refer to a test's `revision` instead of `cfg`Zalathar-41/+44
Compiletest code sometimes refers to a test's revision as its `cfg`. This results in two different names for the same thing, one of which is ambiguous with other kinds of configuration (such as compiletest's own config). This patch replaces those occurrences of `cfg` with `revision`.
2024-02-21Improve internal docs for the `HeaderLine` callback structZalathar-8/+26
2024-02-20Update panic message for missing `//@ run-rustfix` ui test suite when a ↵许杰友 Jieyou Xu (Joe)-4/+9
.fixed file exists
2024-02-20Rollup merge of #121233 - Zalathar:extra-directives, r=oli-obkNilstrieb-49/+43
Move the extra directives for `Mode::CoverageRun` into `iter_header` When these extra directives were ported over as part of #112300, it made sense to introduce `iter_header_extra` and pass them in as an extra argument. But now that #120881 has added a `mode` parameter to `iter_header` for its own purposes, it's slightly simpler to move the coverage special-case code directly into `iter_header` as well. This lets us get rid of `iter_header_extra`.
2024-02-18Auto merge of #121265 - klensy:bump-18-02-24, r=Mark-Simulacrumbors-1/+1
bump some deps First commit dedupes darling* crates and remove one more syn 1.* dep Second one bumps windows crate to 0.52
2024-02-18windows bump to 0.52klensy-1/+1
2024-02-18Move the extra directives for `Mode::CoverageRun` into `iter_header`Zalathar-39/+21
When these extra directives were ported over as part of #112300, it made sense to introduce `iter_header_extra` and pass them in as an extra argument. But now that #120881 has added a `mode` parameter to `iter_header` for its own purposes, it's slightly simpler to move the coverage special-case code directly into `iter_header` as well. This lets us get rid of `iter_header_extra`.
2024-02-18Wrap `iter_header` callback arguments in a documentable structZalathar-12/+24
2024-02-17compiletest: fix regex rebuildsklensy-2/+4
2024-02-16Implement infra support for migrating from `//` to `//@` ui test directives许杰友 Jieyou Xu (Joe)-300/+557
2024-02-12Rollup merge of #120273 - klensy:ct-run, r=onur-ozkanMatthias Krüger-11/+16
compiletest: few naive improvements Tested on `python x.py --stage=1 t tests/ui/borrowck/ --force-rerun`, see individual commits. Wall time didn't improved :-) .
2024-02-06Tweak a few mir-opt tests instead of using -Clink-dead-codeBen Kimock-1/+0
2024-02-06Use a better set of targets for blessing mir-opt testsBen Kimock-0/+2
2024-01-24add fixme about walking tests treeklensy-0/+2
2024-01-23don't collect found paths into BTreeSet:klensy-5/+6
keeping order of inserted Paths having high cost on hot path, collect into HashSet instead and sort afterward. from 1,858,963,938 to 1,448,975,825 I refs.
2024-01-23Remove support for no-system-llvmNikita Popov-12/+12
Also add tests for min-system-llvm-version.
2024-01-23reduce bufreader size from default(8kb) to 1kbklensy-1/+1
Headers WAY less than 1kb anyway, so this can be improved more? before ==18725== Total: 429,769,246 bytes in 957,259 blocks ==18725== At t-gmax: 8,058,316 bytes in 3,502 blocks ==18725== At t-end: 3,045,261 bytes in 1,097 blocks ==18725== Reads: 431,872,599 bytes ==18725== Writes: 214,738,653 bytes after ==49344== Total: 201,418,575 bytes in 957,174 blocks ==49344== At t-gmax: 7,937,250 bytes in 3,310 blocks ==49344== At t-end: 3,035,637 bytes in 1,076 blocks ==49344== Reads: 431,607,448 bytes ==49344== Writes: 210,731,540 bytes
2024-01-23compiletest: reduce useless regex rebuildsklensy-5/+7
before: ==8812== Total: 2,374,977,159 bytes in 6,840,026 blocks ==8812== At t-gmax: 8,090,486 bytes in 3,389 blocks ==8812== At t-end: 3,185,454 bytes in 757 blocks ==8812== Reads: 1,873,472,286 bytes ==8812== Writes: 1,249,411,589 bytes ==11212== I refs: 6,370,244,180 after: ==18725== Total: 429,769,246 bytes in 957,259 blocks ==18725== At t-gmax: 8,058,316 bytes in 3,502 blocks ==18725== At t-end: 3,045,261 bytes in 1,097 blocks ==18725== Reads: 431,872,599 bytes ==18725== Writes: 214,738,653 bytes ==20839== I refs: 1,873,010,089
2024-01-18Warn when no profiler runtime means coverage tests won't be run/blessedZalathar-0/+9
2024-01-09Rollup merge of #119619 - onur-ozkan:panic-abort-mir-opt, r=oli-obkMatthias Krüger-12/+33
mir-opt and custom target fixes From https://github.com/rust-lang/rust/issues/115642#issuecomment-1879589022 > > Could you please test the last two commits from https://github.com/onur-ozkan/rust/commits/panic-abort-mir-opt when you have the time? The first commit should resolve the error of using the nightly flag with a stable compiler, and the second one should resolve the custom target issue. > I tested with the two commits and the errors of using nightly flag and custom target specs were not seen. Testing was completed for the test suites like ui, run-pass-valgrind, coverage, mir-opt, codegen, assembly, incremental. Fixes #115642
2024-01-08detect user-specified custom targets in compiletestonur-ozkan-12/+33
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-01-07coverage: Anonymize line numbers in branch viewsZalathar-3/+93
The code for anonymizing line numbers in coverage reports now supports the slightly different line number syntax used by branch regions.
2024-01-05Allow coverage tests to enable `llvm-cov --use-color`Zalathar-0/+11
2024-01-05Extract a `split_flags` helper in header directive parsingZalathar-9/+16
2024-01-05Allow tests to ignore individual test modesZalathar-3/+36
Normally, each test in `tests/coverage` is automatically run in both `coverage-map` mode and `coverage-run` mode. This new family of directives allows an individual test to specify that it should not be run in a particular mode.
2024-01-05Check for profiler support via a flag, instead of an environment varZalathar-1/+26
2024-01-04Rollup merge of #119184 - Rajveer100:branch-for-issue-118752, r=davidtwcoMatthias Krüger-11/+17
Switch from using `//~ERROR` annotations with `--error-format` to `error-pattern` Fixes #118752 As noticed by ```@jyn514``` while working on a patch, tests failed due to `//~ERROR` annotations used in combination with the older `--error-format` which is now `error-pattern`.
2023-12-21Switch from using `//~ERROR` annotations with `--error-format` to ↵Rajveer-11/+17
`error-pattern` Resolves Issue #118752
2023-12-21Enable -Zlint-mir by default for mir-opt testsTomasz Miąsko-0/+1
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.