about summary refs log tree commit diff
path: root/src/tools/compiletest
AgeCommit message (Collapse)AuthorLines
2021-04-16Error when compiletest is passed duplicate revisionsAaron Hill-9/+19
Currently, we allow the user to write things like '// revisions: rpass1 rpass1', which will not test what they were intending to test.
2021-04-13Check for asm support in UI tests that require itTomasz Miąsko-0/+25
Add `needs-asm-support` compiletest directive, and use it in asm tests that require asm support without relying on any architecture specific features.
2021-04-09Auto merge of #81942 - the8472:reduce-ui-test-threads, r=Mark-Simulacrumbors-0/+1
reduce threads spawned by ui-tests The test harness already spawns enough tests to keep all cores busy. Individual tests should keep their own threading to a minimum to avoid context switch overhead. When running ui tests with lld enabled this shaves about 10% off that testsuite on my machine. Resolves #81946
2021-04-09reduce threads spawned by ui-testsThe8472-0/+1
the test harness already spawns enough tests for all cores, individual tests should keep their own threading to a minimum to avoid context switch overhead some tests fail with 1 CGU, so explicit compile flags have been added to keep their old behavior
2021-04-06Fix handling of `--output-format json` flagJoshua Nelson-1/+1
- Don't treat it as deprecated on stable and beta channels. Before, it would give confusing and incorrect output: ``` warning: the 'output-format' flag is considered deprecated | = warning: see issue #44136 <https://github.com/rust-lang/rust/issues/44136> for more information error: json output format isn't supported for doc generation ``` Both of those are wrong: output-format isn't deprecated, and json output is supported. - Require -Z unstable-options for `--output-format json` Previously, it was allowed by default on nightly, which made it hard to realize the flag wouldn't be accepted on beta or stable. Note that this still allows `--output-format html`, which has been stable since 1.0. - Remove unnecessary double-checking of the feature gate when parsing the output format - Add custom run-make test since compiletest passes -Zunstable-options by default
2021-04-05Rollup merge of #83705 - jyn514:theme-error, r=GuillaumeGomezDylan DPC-2/+1
Give a better error when --theme is not a CSS file Before: ``` error: invalid argument: "bacon.toml" ``` After: ``` error: invalid argument: "bacon.toml" | = help: arguments to --theme must be CSS files ``` cc https://github.com/rust-lang/rust/pull/83478
2021-04-04Rollup merge of #83532 - asomers:gdb-fbsd, r=Mark-SimulacrumDylan DPC-1/+5
Fix compiletest on FreeBSD Recent FreeBSD gdb packages have a different format for the version string.
2021-04-03Auto merge of #83738 - jyn514:only-load-some-crates, r=petrochenkovbors-2/+2
rustdoc: Don't load all extern crates unconditionally Instead, only load the crates that are linked to with intra-doc links. This doesn't help very much with any of rustdoc's fundamental issues with freezing the resolver, but it at least fixes a stable-to-stable regression, and makes the crate loading model somewhat more consistent with rustc's. I tested and it unfortunately does not help at all with https://github.com/rust-lang/rust/pull/82496. Closes https://github.com/rust-lang/rust/issues/68427. Let me know if you want me to open a separate issue for not freezing the resolver. r? `@petrochenkov` cc `@eddyb` `@ollie27`
2021-04-03tidy: Add ignore-rules for the line length checkAnthony Huang-0/+2
This is step 1 towards fixing #77548. This commit includes the tidy change from #77675. The "ignoring file length unnecessarily" check is temporarily disabled to simplify landing the ignore-rules. That check will be re-enabled in a follow-up PR.
2021-04-02Don't load all extern crates unconditionallyJoshua Nelson-2/+2
Instead, only load the crates that are linked to with intra-doc links. This doesn't help very much with any of rustdoc's fundamental issues with freezing the resolver, but it at least fixes a stable-to-stable regression, and makes the crate loading model somewhat more consistent with rustc's.
2021-03-31Give a better error when --theme is not a CSS fileJoshua Nelson-2/+1
Before: ``` error: invalid argument: "bacon.toml" ``` After: ``` error: invalid argument: "bacon.toml" | = help: arguments to --theme must be CSS files ```
2021-03-31Fix compiletest to use correct bitwidth stderr files.Hameer Abbasi-8/+11
2021-03-31Rename stderr->64bit.stderr where needed.Hameer Abbasi-2/+14
2021-03-26Fix compiletest on FreeBSDAlan Somers-1/+5
Recent FreeBSD gdb packages have a different format for the version string.
2021-03-26Handle llvm_version with suffix like "12.0.0libcxx"12101111-1/+9
2021-03-18Rollup merge of #83228 - GuillaumeGomez:no-diff-if-no-tidy, r=jyn514Dylan DPC-5/+6
Don't show HTML diff if tidy isn't installed for rustdoc tests The output without the `tidy` tool is just way too big to be of any use. It makes reading the error much more complicated. r? ``@jyn514``
2021-03-17Don't show HTML diff if tidy isn't installed for rustdoc testsGuillaume Gomez-5/+6
2021-03-15Delete non-revision ui test output file if revisions are usedOli Scherer-0/+7
2021-03-10Add spirv extension handling in compiletestErin Power-0/+2
2021-03-05Bump mir-opt-level from 3 to 4 in testsSantiago Pastorino-1/+1
2021-03-03Auto merge of #82553 - tmiasko:update-tracing, r=Mark-Simulacrumbors-1/+1
Update tracing to 0.1.25 * Update tracing from 0.1.18 to 0.1.25 * Update tracing-subscriber from 0.2.13 to 0.2.16 * Update tracing-tree from 0.1.6 to 0.1.8 * Add pin-project-lite to the list of allowed dependencies (it is now a direct dependency of tracing).
2021-03-01Use a crate to produce rustdoc tree comparisons instead of the `diff` commandMichael Howell-13/+71
It doesn't exist on Windows, so we bring our own unified diff implementation. Fixes #82409
2021-02-28Update tracing to 0.1.25Tomasz Miąsko-1/+1
2021-02-28compiletest: run mir-opt tests with -C opt-level=1Tomasz Miąsko-0/+1
The storage markers are removed at -C opt-level=0 and as a result output of mir opt tests vary based on used optimization level. Use opt-level=1 for mir-opt tests to avoid the issue.
2021-02-24Only look for `tidy` when running rustdoc testsJoshua Nelson-6/+12
This avoids printing lots of unnecessary errors, as well as making the test suite slightly faster.
2021-02-21Add new rustdoc-gui test suiteGuillaume Gomez-1/+5
2021-02-12Rollup merge of #81506 - vo4:hwasan, r=nagisaDylan DPC-0/+8
HWAddressSanitizer support # Motivation Compared to regular ASan, HWASan has a [smaller overhead](https://source.android.com/devices/tech/debug/hwasan). The difference in practice is that HWASan'ed code is more usable, e.g. Android device compiled with HWASan can be used as a daily driver. # Example ``` fn main() { let xs = vec![0, 1, 2, 3]; let _y = unsafe { *xs.as_ptr().offset(4) }; } ``` ``` ==223==ERROR: HWAddressSanitizer: tag-mismatch on address 0xefdeffff0050 at pc 0xaaaad00b3468 READ of size 4 at 0xefdeffff0050 tags: e5/00 (ptr/mem) in thread T0 #0 0xaaaad00b3464 (/root/main+0x53464) #1 0xaaaad00b39b4 (/root/main+0x539b4) #2 0xaaaad00b3dd0 (/root/main+0x53dd0) #3 0xaaaad00b61dc (/root/main+0x561dc) #4 0xaaaad00c0574 (/root/main+0x60574) #5 0xaaaad00b6290 (/root/main+0x56290) #6 0xaaaad00b6170 (/root/main+0x56170) #7 0xaaaad00b3578 (/root/main+0x53578) #8 0xffff81345e70 (/lib64/libc.so.6+0x20e70) #9 0xaaaad0096310 (/root/main+0x36310) [0xefdeffff0040,0xefdeffff0060) is a small allocated heap chunk; size: 32 offset: 16 0xefdeffff0050 is located 0 bytes to the right of 16-byte region [0xefdeffff0040,0xefdeffff0050) allocated here: #0 0xaaaad009bcdc (/root/main+0x3bcdc) #1 0xaaaad00b1eb0 (/root/main+0x51eb0) #2 0xaaaad00b20d4 (/root/main+0x520d4) #3 0xaaaad00b2800 (/root/main+0x52800) #4 0xaaaad00b1cf4 (/root/main+0x51cf4) #5 0xaaaad00b33d4 (/root/main+0x533d4) #6 0xaaaad00b39b4 (/root/main+0x539b4) #7 0xaaaad00b61dc (/root/main+0x561dc) #8 0xaaaad00b3578 (/root/main+0x53578) #9 0xaaaad0096310 (/root/main+0x36310) Thread: T0 0xeffe00002000 stack: [0xffffc0590000,0xffffc0d90000) sz: 8388608 tls: [0xffff81521020,0xffff815217d0) Memory tags around the buggy address (one tag corresponds to 16 bytes): 0xfefcefffef80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0xfefcefffef90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0xfefcefffefa0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0xfefcefffefb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0xfefcefffefc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0xfefcefffefd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0xfefcefffefe0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0xfefcefffeff0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =>0xfefceffff000: a2 a2 05 00 e5 [00] 00 00 00 00 00 00 00 00 00 00 0xfefceffff010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0xfefceffff020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0xfefceffff030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0xfefceffff040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0xfefceffff050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0xfefceffff060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0xfefceffff070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0xfefceffff080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Tags for short granules around the buggy address (one tag corresponds to 16 bytes): 0xfefcefffeff0: .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. =>0xfefceffff000: .. .. c5 .. .. [..] .. .. .. .. .. .. .. .. .. .. 0xfefceffff010: .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. See https://clang.llvm.org/docs/HardwareAssistedAddressSanitizerDesign.html#short-granules for a description of short granule tags Registers where the failure occurred (pc 0xaaaad00b3468): x0 e500efdeffff0050 x1 0000000000000004 x2 0000ffffc0d8f5a0 x3 0200efff00000000 x4 0000ffffc0d8f4c0 x5 000000000000004f x6 00000ffffc0d8f36 x7 0000efff00000000 x8 e500efdeffff0050 x9 0200efff00000000 x10 0000000000000000 x11 0200efff00000000 x12 0200effe000006b0 x13 0200effe000006b0 x14 0000000000000008 x15 00000000c00000cf x16 0000aaaad00a0afc x17 0000000000000003 x18 0000000000000001 x19 0000ffffc0d8f718 x20 ba00ffffc0d8f7a0 x21 0000aaaad00962e0 x22 0000000000000000 x23 0000000000000000 x24 0000000000000000 x25 0000000000000000 x26 0000000000000000 x27 0000000000000000 x28 0000000000000000 x29 0000ffffc0d8f650 x30 0000aaaad00b3468 ``` # Comments/Caveats * HWASan is only supported on arm64. * I'm not sure if I should add a feature gate or piggyback on the existing one for sanitizers. * HWASan requires `-C target-feature=+tagged-globals`. That flag should probably be set transparently to the user. Not sure how to go about that. # TODO * Need more tests. * Update documentation. * Fix symbolization. * Integrate with CI
2021-02-08Rollup merge of #81817 - hameerabbasi:mcp-635, r=oli-obkMara Bos-1/+17
Add option to emit compiler stderr per bitwidth. See rust-lang/compiler-team#365 r? `@oli-obk`
2021-02-08Rollup merge of #81356 - ehuss:libtest-filters, r=m-ou-seMara Bos-5/+5
libtest: allow multiple filters Libtest ignores any filters after the first. This changes it so that if multiple filters are passed, it will test against all of them. This also affects compiletest to do the same. Closes #30422
2021-02-07HWASan supportTri Vo-0/+8
2021-02-06Add option to emit compiler stderr per bitwidth.Hameer Abbasi-1/+17
See rust-lang/compiler-team#365
2021-02-02Rollup merge of #81455 - Amanieu:aarch64_ilp32, r=sanxiynJack Huey-1/+5
Add AArch64 big-endian and ILP32 targets This PR adds 3 new AArch64 targets: - `aarch64_be-unknown-linux-gnu` - `aarch64-unknown-linux-gnu_ilp32` - `aarch64_be-unknown-linux-gnu_ilp32` It also fixes some ABI issues on big-endian ARM and AArch64.
2021-01-29Rollup merge of #79570 - alexcrichton:split-debuginfo, r=bjorn3Yuki Okushi-2/+2
rustc: Stabilize `-Zrun-dsymutil` as `-Csplit-debuginfo` This commit adds a new stable codegen option to rustc, `-Csplit-debuginfo`. The old `-Zrun-dsymutil` flag is deleted and now subsumed by this stable flag. Additionally `-Zsplit-dwarf` is also subsumed by this flag but still requires `-Zunstable-options` to actually activate. The `-Csplit-debuginfo` flag takes one of three values: * `off` - This indicates that split-debuginfo from the final artifact is not desired. This is not supported on Windows and is the default on Unix platforms except macOS. On macOS this means that `dsymutil` is not executed. * `packed` - This means that debuginfo is desired in one location separate from the main executable. This is the default on Windows (`*.pdb`) and macOS (`*.dSYM`). On other Unix platforms this subsumes `-Zsplit-dwarf=single` and produces a `*.dwp` file. * `unpacked` - This means that debuginfo will be roughly equivalent to object files, meaning that it's throughout the build directory rather than in one location (often the fastest for local development). This is not the default on any platform and is not supported on Windows. Each target can indicate its own default preference for how debuginfo is handled. Almost all platforms default to `off` except for Windows and macOS which default to `packed` for historical reasons. Some equivalencies for previous unstable flags with the new flags are: * `-Zrun-dsymutil=yes` -> `-Csplit-debuginfo=packed` * `-Zrun-dsymutil=no` -> `-Csplit-debuginfo=unpacked` * `-Zsplit-dwarf=single` -> `-Csplit-debuginfo=packed` * `-Zsplit-dwarf=split` -> `-Csplit-debuginfo=unpacked` Note that `-Csplit-debuginfo` still requires `-Zunstable-options` for non-macOS platforms since split-dwarf support was *just* implemented in rustc. There's some more rationale listed on #79361, but the main gist of the motivation for this commit is that `dsymutil` can take quite a long time to execute in debug builds and provides little benefit. This means that incremental compile times appear that much worse on macOS because the compiler is constantly running `dsymutil` over every single binary it produces during `cargo build` (even build scripts!). Ideally rustc would switch to not running `dsymutil` by default, but that's a problem left to get tackled another day. Closes #79361
2021-01-28rustc: Stabilize `-Zrun-dsymutil` as `-Csplit-debuginfo`Alex Crichton-2/+2
This commit adds a new stable codegen option to rustc, `-Csplit-debuginfo`. The old `-Zrun-dsymutil` flag is deleted and now subsumed by this stable flag. Additionally `-Zsplit-dwarf` is also subsumed by this flag but still requires `-Zunstable-options` to actually activate. The `-Csplit-debuginfo` flag takes one of three values: * `off` - This indicates that split-debuginfo from the final artifact is not desired. This is not supported on Windows and is the default on Unix platforms except macOS. On macOS this means that `dsymutil` is not executed. * `packed` - This means that debuginfo is desired in one location separate from the main executable. This is the default on Windows (`*.pdb`) and macOS (`*.dSYM`). On other Unix platforms this subsumes `-Zsplit-dwarf=single` and produces a `*.dwp` file. * `unpacked` - This means that debuginfo will be roughly equivalent to object files, meaning that it's throughout the build directory rather than in one location (often the fastest for local development). This is not the default on any platform and is not supported on Windows. Each target can indicate its own default preference for how debuginfo is handled. Almost all platforms default to `off` except for Windows and macOS which default to `packed` for historical reasons. Some equivalencies for previous unstable flags with the new flags are: * `-Zrun-dsymutil=yes` -> `-Csplit-debuginfo=packed` * `-Zrun-dsymutil=no` -> `-Csplit-debuginfo=unpacked` * `-Zsplit-dwarf=single` -> `-Csplit-debuginfo=packed` * `-Zsplit-dwarf=split` -> `-Csplit-debuginfo=unpacked` Note that `-Csplit-debuginfo` still requires `-Zunstable-options` for non-macOS platforms since split-dwarf support was *just* implemented in rustc. There's some more rationale listed on #79361, but the main gist of the motivation for this commit is that `dsymutil` can take quite a long time to execute in debug builds and provides little benefit. This means that incremental compile times appear that much worse on macOS because the compiler is constantly running `dsymutil` over every single binary it produces during `cargo build` (even build scripts!). Ideally rustc would switch to not running `dsymutil` by default, but that's a problem left to get tackled another day. Closes #79361
2021-01-28Rollup merge of #81428 - phansch:compiletest-tests, r=Mark-SimulacrumYuki Okushi-1/+20
compiletest: Add two more unit tests This adds two more unit tests and fixes spelling in `compiletest`.
2021-01-27Support AArch64 big-endian and ILP32 in compiletestAmanieu d'Antras-1/+5
2021-01-27compiletest: Add two more unit testsPhilipp Hansch-1/+20
2021-01-24libtest: allow multiple filtersEric Huss-5/+5
2021-01-19No longer require unstable for jsondocck, only build it for json testsRune Tynan-4/+4
2021-01-19Address review v2Rune Tynan-1/+0
2021-01-19Add jsondocck tool, and use it for rustdoc JSONRune Tynan-11/+18
2020-12-31Merge remote-tracking branch 'origin/master' into frewsxcv-sanCorey Farwell-39/+50
2020-12-29Remove `compile-fail` test suiteVadim Petrochenkov-22/+10
2020-12-16compiletest: add split dwarf compare modeDavid Wood-0/+14
This commit adds a Split DWARF compare mode to compiletest so that debuginfo tests are also tested using Split DWARF in split mode (and manually in single mode). Signed-off-by: David Wood <david@davidtw.co>
2020-12-12Ignore .css files in the diffJoshua Nelson-1/+2
These are always static and never autogenerated, so the diffs aren't useful.
2020-12-12If tidy isn't installed, only give one error, not manyJoshua Nelson-19/+22
2020-12-12Don't abort rustdoc tests if `tidy` isn't installedJoshua Nelson-11/+16
Before: ``` Check compiletest suite=rustdoc mode=rustdoc (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu) running 396 tests ..................................................2020-11-23T12:12:37.735649Z ERROR compiletest::runtest: fatal error, panic: "failed to run tidy - is it installed? - No such file or directory (os error 2)" F................................................. 100/396 .................................................................................................... 200/396 .................................................................................................... 300/396 ...............................i...............2020-11-23T12:15:00.271271Z ERROR compiletest::runtest: fatal error, panic: "failed to run tidy - is it installed? - No such file or directory (os error 2)" F................................................ ``` After: ``` Check compiletest suite=rustdoc mode=rustdoc (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu) running 4 tests .FFF failures: ---- [rustdoc] rustdoc/fn-pointer-arg-name.rs stdout ---- error: htmldocck failed! status: exit code: 1 command: "/usr/bin/python" "/home/joshua/rustc/src/etc/htmldocck.py" "/home/joshua/rustc/build/x86_64-unknown-linux-gnu/test/rustdoc/fn-pointer-arg-name" "/home/joshua/rustc/src/test/rustdoc/fn-pointer-arg-name.rs" stdout: ------------------------------------------ ------------------------------------------ stderr: ------------------------------------------ 4: @has check failed `XPATH PATTERN` did not match // @has - '//*[@class="rust fn"]' 'pub fn f(callback: fn(len: usize, foo: u32))' Encountered 1 errors ------------------------------------------ info: generating a diff against nightly rustdoc failed to run tidy - is it installed? - Permission denied (os error 13) failed to run tidy - is it installed? - Permission denied (os error 13) # a diff without running `tidy` ```
2020-12-11Auto merge of #79349 - Nemo157:issue-79201, r=jyn514bors-1/+1
Apply `doc(cfg)` from parent items while collecting trait impls Because trait impls bypass the standard `clean` hierarchy they do not participate in the `propagate_doc_cfg` pass, so instead we need to pre-collect all possible `doc(cfg)` attributes that will apply to them when cleaning. fixes #79201
2020-12-09Enable ASan, TSan, UBSan for aarch64-apple-darwin.Corey Farwell-2/+8
2020-12-03Coverage tests for remaining TerminatorKinds and async, improve AssertRich Kadel-2/+0
Tested and validate results for panic unwind, panic abort, assert!() macro, TerminatorKind::Assert (for example, numeric overflow), and async/await. Implemented a previous documented idea to change Assert handling to be the same as FalseUnwind and Goto, so it doesn't get its own BasicCoverageBlock anymore. This changed a couple of coverage regions, but I validated those changes are not any worse than the prior results, and probably help assure some consistency (even if some people might disagree with how the code region is consistently computed). Fixed issue with async/await. AggregateKind::Generator needs to be handled like AggregateKind::Closure; coverage span for the outer async function should not "cover" the async body, which is actually executed in a separate "closure" MIR.