about summary refs log tree commit diff
path: root/src/tools/compiletest
AgeCommit message (Collapse)AuthorLines
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.
2020-12-01Address review comments.Nixon Enraght-Moony-7/+7
Go back to CRATE_DEF_INDEX Minor niceness improvements Don't output hidden items Remove striped items from fields Add $TEST_BASE_DIR Small catch
2020-12-01Add tests for rustdoc jsonNixon Enraght-Moony-10/+62
Move rustdoc/rustdoc-json to rustdoc-json Scaffold rustdoc-json test mode Implement run_rustdoc_json_test Fix up python Make tidy happy
2020-11-23Fix order of diff when rustdoc tests failWim Looman-1/+1
2020-11-22Drop support for cloudabi targetsLzu Tao-3/+1
2020-11-22Auto merge of #78752 - jyn514:html-diff, r=GuillaumeGomezbors-10/+146
Give a better error when rustdoc tests fail - Run the default rustdoc against the current rustdoc - Diff output recursively - Colorize diff output Closes https://github.com/rust-lang/rust/issues/78750. ## Resolved questions - Should this be opt-in instead of on by default? + No - Should this call through to `delta`? That's not a very common program to have installed, but I'm not sure how to do diffs after the fact. Maybe `compiletest` can take a `--syntax-highlighter` parameter or something? + I decided to use `delta` if available and `diff --color` otherwise. It prints a warning if delta isn't installed so you know you can get nicer diffs ## Open questions. - What version of rustdoc would this compare against? Ideally it would compare against `$(git merge-base HEAD origin/master)` - maybe that's feasible if we install those artifacts from CI? - Does it always make sense to compare the tests? Especially for new tests, I'm not sure how useful it would be ... but then again, one of the questions I want to know most as a reviewer is 'did it break before?'. r? `@GuillaumeGomez` cc `@Mark-Simulacrum`
2020-11-20Move from bash to rustJoshua Nelson-40/+33
2020-11-17compiletest: Fix a warning in debuginfo tests on windows-gnuVadim Petrochenkov-1/+2
2020-11-14Use default git pager instead of hard-coding `delta`Joshua Nelson-9/+23
2020-11-14Capture stdout and stderr of diff so they'll be printed at the endJoshua Nelson-8/+14
2020-11-14Fix tests with auxiliary docsJoshua Nelson-3/+22
2020-11-14Fall back to `diff` if `delta` isn't installedJoshua Nelson-14/+20
2020-11-14Fix bugsJoshua Nelson-4/+5
2020-11-14Address review commentsJoshua Nelson-29/+21
- remove unused args - Fix formatting - Improve naming - Fix typo
2020-11-14Give a better error when rustdoc tests failJoshua Nelson-8/+113
- Run the default rustdoc against the current rustdoc - Diff output recursively - Colorize diff output
2020-11-03Print a summary of which test suite failedMark Rousskov-2/+35
Especially on CI, where cross-compiling is common and single builder may end up with multiple hosts and multiple targets, it can be annoying to scroll back to the nearest start of test marker. This prints out a summary of the test suite being run directly in compiletest.
2020-11-02Auto merge of #78667 - pietroalbini:lldb-unbuffered, r=Mark-Simulacrumbors-0/+1
Try running lldb_batchmode.py with PYTHONUNBUFFERED When reporting fatal errors, LLVM calls abort() to exit the program. There is a chance that might interfere with Python printing stuff to stdout, as by default it relies on buffering to increase performance. This commit tries to disable Python buffering, to hopefully get useful logs while debugging #78665.
2020-11-02compiletest: try running lldb_batchmode.py with PYTHONUNBUFFEREDPietro Albini-0/+1
When reporting fatal errors, LLVM calls abort() to exit the program. There is a chance that might interfere with Python printing stuff to stdout, as by default it relies on buffering to increase performance. This commit tries to disable Python buffering, to hopefully get useful logs while debugging #78665.
2020-10-30Always pass `-Z future-incompat-report` to UI testsAaron Hill-0/+1
2020-10-30Don't display empty future-compat reportAaron Hill-16/+21
2020-10-30Update into-iter-on-arrays test to check future-incompat-reportAaron Hill-11/+22
2020-10-30Only error on unfixed diagnosticsAaron Hill-1/+3
2020-10-30Strip out non-diagnostic lines from rustfix inputAaron Hill-7/+20
2020-10-30Print future breakage reportAaron Hill-6/+9
2020-10-30Some workAaron Hill-2/+17
2020-10-29Add support for rustc-env and unset-rustc-env for aux-buildsTomasz Miąsko-0/+5
2020-10-20Initialize tracing subscriber in compiletest toolTomasz Miąsko-2/+2
The logging in compiletest was migrated from log crate to a tracing, but the initialization code was never changed, so logging is non-functional. Initialize tracing subscriber using default settings.
2020-10-05Updates to experimental coverage counter injectionRich Kadel-2/+12
This is a combination of 18 commits. Commit #2: Additional examples and some small improvements. Commit #3: fixed mir-opt non-mir extensions and spanview title elements Corrected a fairly recent assumption in runtest.rs that all MIR dump files end in .mir. (It was appending .mir to the graphviz .dot and spanview .html file names when generating blessed output files. That also left outdated files in the baseline alongside the files with the incorrect names, which I've now removed.) Updated spanview HTML title elements to match their content, replacing a hardcoded and incorrect name that was left in accidentally when originally submitted. Commit #4: added more test examples also improved Makefiles with support for non-zero exit status and to force validation of tests unless a specific test overrides it with a specific comment. Commit #5: Fixed rare issues after testing on real-world crate Commit #6: Addressed PR feedback, and removed temporary -Zexperimental-coverage -Zinstrument-coverage once again supports the latest capabilities of LLVM instrprof coverage instrumentation. Also fixed a bug in spanview. Commit #7: Fix closure handling, add tests for closures and inner items And cleaned up other tests for consistency, and to make it more clear where spans start/end by breaking up lines. Commit #8: renamed "typical" test results "expected" Now that the `llvm-cov show` tests are improved to normally expect matching actuals, and to allow individual tests to override that expectation. Commit #9: test coverage of inline generic struct function Commit #10: Addressed review feedback * Removed unnecessary Unreachable filter. * Replaced a match wildcard with remining variants. * Added more comments to help clarify the role of successors() in the CFG traversal Commit #11: refactoring based on feedback * refactored `fn coverage_spans()`. * changed the way I expand an empty coverage span to improve performance * fixed a typo that I had accidently left in, in visit.rs Commit #12: Optimized use of SourceMap and SourceFile Commit #13: Fixed a regression, and synched with upstream Some generated test file names changed due to some new change upstream. Commit #14: Stripping out crate disambiguators from demangled names These can vary depending on the test platform. Commit #15: Ignore llvm-cov show diff on test with generics, expand IO error message Tests with generics produce llvm-cov show results with demangled names that can include an unstable "crate disambiguator" (hex value). The value changes when run in the Rust CI Windows environment. I added a sed filter to strip them out (in a prior commit), but sed also appears to fail in the same environment. Until I can figure out a workaround, I'm just going to ignore this specific test result. I added a FIXME to follow up later, but it's not that critical. I also saw an error with Windows GNU, but the IO error did not specify a path for the directory or file that triggered the error. I updated the error messages to provide more info for next, time but also noticed some other tests with similar steps did not fail. Looks spurious. Commit #16: Modify rust-demangler to strip disambiguators by default Commit #17: Remove std::process::exit from coverage tests Due to Issue #77553, programs that call std::process::exit() do not generate coverage results on Windows MSVC. Commit #18: fix: test file paths exceeding Windows max path len
2020-09-29Ensure that all LLVM components requested by tests are available on CIVadim Petrochenkov-2/+5
2020-09-18Fix --bless for mir-opt 32/64 bit fileNixon Enraght-Moony-3/+4
2020-09-17Put bit qualifier before mir/diffNixon Enraght-Moony-2/+2
2020-09-05compiletest: Introduce "min-cdb-version"MaulingMonkey-6/+51
2020-08-27Adds --bless support to test/run-make-fulldepsRich Kadel-0/+12
The ability to "bless" output for some of these tests is critical to making it practical to adapt tests to unrelated changes. This is needed for new coverage tests, as shown in PR #75828 (or its derivative).
2020-08-22compiletest: fix a couple clippy lint findingsMatthias Krüger-72/+59
2020-08-18Validate the MIR of all optimizations in the mir-opt directoryOliver Scherer-0/+1
2020-08-15replaced log with tracingGurpreet Singh-6/+6
2020-08-09Add sanitizer support on FreeBSDGreg V-3/+8
2020-08-07Auto merge of #74821 - oli-obk:const_eval_read_uninit_fast_path, r=wesleywiserbors-2/+13
Check whether locals are too large instead of whether accesses into them are too large Essentially this stops const prop from attempting to optimize ```rust let mut x = [0_u8; 5000]; x[42] = 3; ``` I don't expect this to be a perf improvement without #73656 (which is also where the lack of this PR will be a perf regression). r? @wesleywiser
2020-08-07Auto merge of #73842 - euclio:doctest-expn, r=GuillaumeGomezbors-2/+4
Use outermost invocation span for doctest names Fixes #70090. This PR also allows using aux-build files in rustdoc-ui tests.
2020-08-07Rollup merge of #74888 - infinity0:ignore-endian-big, r=nikomatsakisYuki Okushi-0/+21
compiletest: ignore-endian-big, fixes #74829, fixes #74885 See discussion on #74829 I tested it on a Debian s390x machine, works well.
2020-08-02Rollup merge of #75064 - petrochenkov:llvmtarg, r=Mark-SimulacrumManish Goregaokar-0/+12
compiletest: Support ignoring tests requiring missing LLVM components This PR implements a more principled solution to the problem described in https://github.com/rust-lang/rust/pull/66084. Builds of LLVM backends take a lot of time and disk space. So it usually makes sense to build rustc with ```toml [llvm] targets = "X86" experimental-targets = "" ``` unless you are working on some target-specific tasks. A few tests, however, require non-x86 backends to be built. A new test directive `// needs-llvm-components: component1 component2 component3` makes such tests to be automatically ignored if one of the listed components is missing in the provided LLVM (this is determined through `llvm-config --components`). As a result, the test suite now fully passes with LLVM built only with the x86 backend. The component list in this case is ``` aggressiveinstcombine all all-targets analysis asmparser asmprinter binaryformat bitreader bitstreamreader bitwriter cfguard codegen core coroutines coverage debuginfocodeview debuginfodwarf debuginfogsym debuginfomsf debuginfopdb demangle dlltooldriver dwarflinker engine executionengine frontendopenmp fuzzmutate globalisel instcombine instrumentation interpreter ipo irreader jitlink libdriver lineeditor linker lto mc mca mcdisassembler mcjit mcparser mirparser native nativecodegen objcarcopts object objectyaml option orcerror orcjit passes profiledata remarks runtimedyld scalaropts selectiondag support symbolize tablegen target textapi transformutils vectorize windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info x86utils xray ``` (With the default target list it's much larger.) ``` aarch64 aarch64asmparser aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils aggressiveinstcombine all all-targets analysis arm armasmparser armcodegen armdesc armdisassembler arminfo armutils asmparser asmprinter avr avrasmparser avrcodegen avrdesc avrdisassembler avrinfo binaryformat bitreader bitstreamreader bitwriter cfguard codegen core coroutines coverage debuginfocodeview debuginfodwarf debuginfogsym debuginfomsf debuginfopdb demangle dlltooldriver dwarflinker engine executionengine frontendopenmp fuzzmutate globalisel hexagon hexagonasmparser hexagoncodegen hexagondesc hexagondisassembler hexagoninfo instcombine instrumentation interpreter ipo irreader jitlink libdriver lineeditor linker lto mc mca mcdisassembler mcjit mcparser mips mipsasmparser mipscodegen mipsdesc mipsdisassembler mipsinfo mirparser msp430 msp430asmparser msp430codegen msp430desc msp430disassembler msp430info native nativecodegen nvptx nvptxcodegen nvptxdesc nvptxinfo objcarcopts object objectyaml option orcerror orcjit passes powerpc powerpcasmparser powerpccodegen powerpcdesc powerpcdisassembler powerpcinfo profiledata remarks riscv riscvasmparser riscvcodegen riscvdesc riscvdisassembler riscvinfo riscvutils runtimedyld scalaropts selectiondag sparc sparcasmparser sparccodegen sparcdesc sparcdisassembler sparcinfo support symbolize systemz systemzasmparser systemzcodegen systemzdesc systemzdisassembler systemzinfo tablegen target textapi transformutils vectorize webassembly webassemblyasmparser webassemblycodegen webassemblydesc webassemblydisassembler webassemblyinfo windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info x86utils xray ``` https://github.com/rust-lang/rust/pull/66084 is also reverted now. r? @Mark-Simulacrum
2020-08-02compiletest: Support ignoring tests requiring missing LLVM componentsVadim Petrochenkov-0/+12
2020-08-02compiletest: print diff for pretty testsDavid Wood-9/+16
This commit modifies compiletest so that a diff of actual and expected output is shown for pretty tests. This makes it far easier to work out what has changed. Signed-off-by: David Wood <david@davidtw.co>