about summary refs log tree commit diff
path: root/src/tools/compiletest
AgeCommit message (Collapse)AuthorLines
2022-05-22Disallow non-same compare-mode-nllJack Huey-18/+44
2022-05-13Auto merge of #96493 - chbaker0:issue-96342-fix, r=Mark-Simulacrumbors-1/+9
Add compiletest and bootstrap "--skip" option forwarded to libtest With this PR, "x.py test --skip SKIP ..." will run the specified test suite, but forward "--skip SKIP" to the test tool. libtest already supports this option. The PR also adds it to compiletest which itself just forwards it to libtest. Adds the functionality requested in https://github.com/rust-lang/rust/issues/96342. This is useful to work around tests broken upstream. https://github.com/rust-lang/rust/issues/96362#issuecomment-1108609893 is the specific test issue my project is trying to work around.
2022-05-12compiletest: normalize paths from repository rootDavid Wood-10/+9
When testing macros from `rustc_macros` in `ui-fulldeps` tests, sometimes paths from the compiler source tree can be shown in error messages - these need to be normalized. Signed-off-by: David Wood <david.wood@huawei.com>
2022-05-10Add test skip supportCollin Baker-1/+9
libtest already supports a "--skip SUBSTRING" arg which excludes any test names matching SUBSTRING. This adds a "--skip" argument to compiletest and bootstrap which is forwarded to libtest.
2022-04-28extract code to detect files related to a test into a different functionPietro Albini-11/+35
2022-04-27compiletest: add support for unused extern notificationsJeremy Fitzhardinge-0/+11
As generated by --json unused-externs.
2022-04-25Rollup merge of #96090 - JakobDegen:mir-tests, r=nagisaMatthias Krüger-1/+12
Implement MIR opt unit tests This implements rust-lang/compiler-team#502 . There's not much to say here, this implementation does everything as proposed. I also added the flag to a bunch of existing tests (mostly those to which I could add it without causing huge diffs due to changes in line numbers). Summarizing the changes to test outputs: - Every time an `MirPatch` is created, it adds a cleanup block to the body if it did not exist already. If this block is unused (as is usually the case), it usually gets removed soon after by some pass calling `SimplifyCFG` for unrelated reasons (in many cases this cycle happens quite a few times for a single body). We now run `SimplifyCFG` less often, so those blocks end up in some of our outputs. I looked at changing `MirPatch` to not do this, but that seemed too complicated for this PR. I may still do that in a follow-up. - The `InstCombine` test had set `-C opt-level=0` in its flags and so there were no storage markers. I don't really see a good motivation for doing this, so bringing it back in line with what everything else does seems correct. - One of the `EarlyOtherwiseBranch` tests had `UnreachableProp` running on it. Preventing that kind of thing is the goal of this feature, so this seems fine. For the remaining tests for which this feature might be useful, we can gradually migrate them as opportunities present themselves. In terms of documentation, I plan on submitting a PR to the rustc dev guide in the near future documenting this and other recent changes to MIR. If there's any other places to update, do let me know r? `@nagisa`
2022-04-19compiletest: combine `--*-python` argsAlec Goncharow-16/+10
Since these arguments are now always the same, combine them into a singular `--python` argument.
2022-04-16Add support for MIR opt unit testsJakob Degen-1/+12
2022-04-11Auto merge of #94243 - compiler-errors:compiler-flags-typo, r=Mark-Simulacrumbors-0/+5
`s/compiler-flags/compile-flags` in compiletest Also make compiletest panic so this doesn't happen in the future! I literally always forget which it's called, so I wanted to make my life easier in the future. Also open to the possibility of parsing both.
2022-04-07Auto merge of #95678 - pietroalbini:pa-1.62.0-bootstrap, r=Mark-Simulacrumbors-3/+1
Bump bootstrap compiler to 1.61.0 beta This PR bumps the bootstrap compiler to the 1.61.0 beta. The first commit changes the stage0 compiler, the second commit applies the "mechanical" changes and the third and fourth commits apply changes explained in the relevant comments. r? `@Mark-Simulacrum`
2022-04-05trivial cfg(bootstrap) changesPietro Albini-3/+1
2022-03-26Print the full relative path to failed testsJoshua Nelson-6/+4
Before: ``` failures: [ui] rustdoc-ui/intra-doc/feature-gate-intra-doc-pointers.rs test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 163 filtered out; finished in 0.45s ``` After: ``` failures: [ui] src/test/rustdoc-ui/intra-doc/feature-gate-intra-doc-pointers.rs test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 163 filtered out; finished in 0.45s ``` This allows copy pasting the path or using Ctrl+Click in IDEs to go directly to the file, instead of having to edit the filename first.
2022-03-18Re-enable parallel debuginfo testsTom Tromey-5/+0
Debuginfo tests are serialized due to some older version of LLDB. However, that comment was last touched in 2014, so presumably these older versions are long since obsolete. Partially fixes bug #72719.
2022-03-14debuginfo: Refactor debuginfo generation for types -- Address review comments.Michael Woerister-0/+2
2022-03-14debuginfo: Refactor debuginfo generation for types -- Run x.py fmtMichael Woerister-35/+7
2022-03-14compiletest: Don't update PDB files of test cases in-place.Michael Woerister-9/+48
2022-03-03bootstrap: correct reading of flags for llvmJon Gjengset-2/+13
First, this reverts the `CFLAGS`/`CXXFLAGS` of #93918. Those flags are already read by `cc` and populated into `Build` earlier on in the process. We shouldn't be overriding that based on `CFLAGS`, since `cc` also respects overrides like `CFLAGS_{TARGET}` and `HOST_CFLAGS`, which we want to take into account. Second, this adds the same capability to specify target-specific versions of `LDFLAGS` as we have through `cc` for the `C*` flags: https://github.com/alexcrichton/cc-rs#external-configuration-via-environment-variables Note that this also necessitated an update to compiletest to treat CXXFLAGS separately from CFLAGS.
2022-02-25Switch bootstrap cfgsMark Rousskov-2/+0
2022-02-24Include ignore message in libtest outputAntonio Yang-0/+4
As an example: #[test] #[ignore = "not yet implemented"] fn test_ignored() { ... } Will now render as: running 2 tests test tests::test_ignored ... ignored, not yet implemented test result: ok. 1 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 0.00s
2022-02-21reject compiler-flags as a compiletest attributeMichael Goulet-0/+5
2022-02-20compiletest: Print process output info with less whitespaceNixon Enraght-Moony-15/+19
Before: ``` error: jsondocck failed! status: exit status: 1 command: "/data/ne321/rust/build/x86_64-unknown-linux-gnu/stage0-tools-bin/jsondocck" "--doc-dir" "/data/ne321/rust/build/x86_64-unknown-linux-gnu/test/rustdoc-json/traits/supertrait" "--template" "/data/ne321/rust/src/test/rustdoc-json/traits/supertrait.rs" stdout: ------------------------------------------ ------------------------------------------ stderr: ------------------------------------------ Invalid command: Tried to use the previous path in the first command on line 10 Error: "Jsondocck failed for /data/ne321/rust/src/test/rustdoc-json/traits/supertrait.rs" ------------------------------------------ Rustdoc Output: status: exit status: 0 command: "/data/ne321/rust/build/x86_64-unknown-linux-gnu/stage2/bin/rustdoc" "-L" "/data/ne321/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-L" "/data/ne321/rust/build/x86_64-unknown-linux-gnu/test/rustdoc-json/traits/supertrait/auxiliary" "-o" "/data/ne321/rust/build/x86_64-unknown-linux-gnu/test/rustdoc-json/traits/supertrait" "--deny" "warnings" "/data/ne321/rust/src/test/rustdoc-json/traits/supertrait.rs" "--output-format" "json" "-Zunstable-options" stdout: ------------------------------------------ ------------------------------------------ stderr: ------------------------------------------ ------------------------------------------ ``` After: ``` error: jsondocck failed! status: exit status: 1 command: "/data/ne321/rust/build/x86_64-unknown-linux-gnu/stage0-tools-bin/jsondocck" "--doc-dir" "/data/ne321/rust/build/x86_64-unknown-linux-gnu/test/rustdoc-json/traits/supertrait" "--template" "/data/ne321/rust/src/test/rustdoc-json/traits/supertrait.rs" stdout: none --- stderr ------------------------------- Invalid command: Tried to use the previous path in the first command on line 10 Error: "Jsondocck failed for /data/ne321/rust/src/test/rustdoc-json/traits/supertrait.rs" ------------------------------------------ Rustdoc Output: status: exit status: 0 command: "/data/ne321/rust/build/x86_64-unknown-linux-gnu/stage2/bin/rustdoc" "-L" "/data/ne321/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-L" "/data/ne321/rust/build/x86_64-unknown-linux-gnu/test/rustdoc-json/traits/supertrait/auxiliary" "-o" "/data/ne321/rust/build/x86_64-unknown-linux-gnu/test/rustdoc-json/traits/supertrait" "--deny" "warnings" "/data/ne321/rust/src/test/rustdoc-json/traits/supertrait.rs" "--output-format" "json" "-Zunstable-options" stdout: none stderr: none ```
2022-02-18Rollup merge of #93953 - jackh726:known_bug, r=Mark-SimulacrumMatthias Krüger-221/+186
Add the `known-bug` test directive, use it, and do some cleanup cc rust-lang/compiler-team#476 Now tests can be annotated with `known-bug`, which should indicate that the test *should* pass (or at least that the current output is a bug). Adding it relaxes the requirement to add error annotations to the test (though it is still allowed). In the future, this could be extended with further relaxations - with the goal to make adding these tests need minimal effort. I've used this attribute for the GAT tests added in #93757. Finally, I've also cleaned up `header.rs` in compiletest a bit, by extracting out a bit of common logic. I've also split out some of the directives into their own consts. This removes a lot of very similar functions from `Config` and makes `TestProps::load_from` read nicer. I've split these into separate commits, so I in theory could split these into separate PRs if they're controversial, but I think they're pretty straightforward. r? ``@Mark-Simulacrum``
2022-02-16MemTagSanitizer SupportIvan Lozano-0/+5
Adds support for the LLVM MemTagSanitizer.
2022-02-14Don't allow error annotations in known-bug testsJack Huey-7/+11
2022-02-12Cleanup header parsing by extracting common logicJack Huey-229/+168
2022-02-12Add the known-bug compiletest propJack Huey-1/+23
2022-02-07Rollup merge of #93416 - name1e5s:chore/remove_allow_fail, r=m-ou-seMara Bos-1/+2
remove `allow_fail` test flag close #93345
2022-02-04Rollup merge of #93508 - CraftSpider:jsondocck-runtest-output, r=Mark-SimulacrumMatthias Krüger-5/+12
Add rustdoc info to jsondocck output Makes debugging issues in the generated output simpler by handling emitted logs and etc.
2022-02-01Add rustdoc info to jsondocck outputRune Tynan-5/+12
2022-01-28add allow_fail field in TestDesc to pass checkyuhaixin.hx-0/+2
2022-01-28remove allow_fail test flagyuhaixin.hx-1/+0
2022-01-21Auto merge of #92363 - the8472:less-compiletest-normalization, r=Mark-Simulacrumbors-65/+32
Override rustc version in ui and mir-opt tests to get stable hashes Building a dozen separate regexps for each test in compiletest consumes significant amounts of CPU cycles. UI test timings on my machine: OLD: 39.63s NEW: 30.27s
2022-01-21use lazy_static to compile `Regex::new` instances once instead on each testThe 8472-31/+32
2022-01-21Override rustc version in ui and mir-opt tests to get stable hashesThe 8472-34/+0
Building a dozen separate regexps for each test in compiletest consumes significant amounts of CPU cycles. Using `RUSTC_FORCE_INCR_COMP_ARTIFACT_HEADER` stabilizes hashes calcuated for the individual tests so no test-dependent normalization is needed. Hashes for the standard library still change so some normalizations are still needed.
2022-01-19Support --bless for pp-exact pretty printer testsDavid Tolnay-1/+13
2021-12-29Auto merge of #92309 - ehuss:remove-check_lines, r=Mark-Simulacrumbors-11/+0
compiletest: Remove some vestigial code The `check_lines` header is no longer parsed as a header, but instead inside the debuginfo tests. I believe this was changed in #13726.
2021-12-26compiletest: Remove some vestigial codeEric Huss-11/+0
2021-12-22Upgrade `tracing-subscriber`pierwill-1/+1
2021-12-13Add run-make-fulldeps testpierwill-0/+13
Implement RUSTC_FORCE_INCR_COMP_ARTIFACT_HEADER Also makes minor docs edits.
2021-12-13Include rustc version in `rustc_span::StableCrateId`pierwill-0/+53
Normalize symbol hashes in compiletest. Remove DefId sorting
2021-12-05Rollup merge of #91535 - Aaron1011:stabilize-future-incompat, r=nagisaMatthias Krüger-1/+2
Stabilize `-Z emit-future-incompat` as `--json future-incompat` The FCP was completed in https://github.com/rust-lang/rust/issues/71249
2021-12-04Stabilize `-Z emit-future-incompat` as `--json future-incompat`Aaron Hill-1/+2
2021-12-04Rollup merge of #91209 - camelid:snapshot, r=jyn514Matthias Krüger-6/+6
Implement `@snapshot` check for htmldocck This form of check allows performing snapshot tests (à la `src/test/ui`) on rustdoc HTML output, making it easier to create and update tests. See [this Zulip thread][1] for more information about the motivation for this change. [1]: https://zulip-archive.rust-lang.org/stream/266220-rustdoc/topic/HTML.20snapshot.20tests.html#262651142 r? `@GuillaumeGomez`
2021-12-01Implement `@snapshot` check for htmldocckNoah Lev-6/+6
This form of check allows performing snapshot tests (à la `src/test/ui`) on rustdoc HTML output, making it easier to create and update tests. See this Zulip thread [1] for more information about the motivation for this change. [1]: https://zulip-archive.rust-lang.org/stream/266220-rustdoc/topic/HTML.20snapshot.20tests.html#262651142
2021-11-26Deny warnings in rustdoc non-UI testsNoah Lev-0/+2
These warnings were silently ignored since they did not appear in a `.stderr` file and did not fail the test. With this change, warnings in tests are denied, causing the tests to fail if they have warnings. I will fix all the warnings that are now test failures next.
2021-11-07Auto merge of #90348 - Amanieu:asm_feature_gates, r=joshtriplettbors-2/+4
Add features gates for experimental asm features This PR splits off parts of `asm!` into separate features because they are not ready for stabilization. Specifically this adds: - `asm_const` for `const` operands. - `asm_sym` for `sym` operands. - `asm_experimental_arch` for architectures other than x86, x86_64, arm, aarch64 and riscv. r? `@nagisa`
2021-11-07Restrict tests that use needs-asm-support to non-experimentalAmanieu d'Antras-2/+4
architectures
2021-11-05Rollup merge of #90569 - wesleywiser:fix_only_i686_tests, r=Mark-SimulacrumMatthias Krüger-1/+1
Fix tests using `only-i686` to use the correct `only-x86` directive We translate `i686` to `x86` which means tests marked as `only-i686` never ran. Update those tests to use `only-x86`. We parse the `only-` architecture directive here https://github.com/rust-lang/rust/blob/27143a9094b55a00d5f440b05b0cb4233b300d33/src/tools/compiletest/src/util.rs#L160-L168 and we translate `i686` to `x86` here https://github.com/rust-lang/rust/blob/27143a9094b55a00d5f440b05b0cb4233b300d33/src/tools/compiletest/src/util.rs#L56
2021-11-04Fix tests using `only-i686` to use the correct `only-x86` directiveWesley Wiser-1/+1
We translate `i686` to `x86` which means tests marked as `only-i686` never ran. Update those tests to use `only-x86`.