about summary refs log tree commit diff
path: root/src/tools/compiletest
AgeCommit message (Collapse)AuthorLines
2018-05-04Use published rustfix 0.2 versionPascal Hertleif-1/+1
2018-05-04test: Make a dedicated testsuite for rustfixAlex Crichton-43/+82
This commit adds a dedicated mode to compiletest for running rustfix tests, adding a new `src/test/rustfix` directory which will execute all tests as a "rustfix" test, namely requiring that a `*.fixed` is next to the main file which is the result of the rustfix project's application of fixes. The `rustfix` crate is pulled in to actually perform the fixing, and the rustfix compiletest mode will assert a few properties about the fixing: * The expected fixed output must be the same as rustc's output suggestions applied to the original code. * The fixed code must compile successfully * The fixed code must have no further diagnostics emitted about it
2018-05-04tidyPascal Hertleif-3/+6
2018-05-04Skip NLL compiletest in rustfix mode for nowPascal Hertleif-3/+6
2018-05-04Use rustfix' suggestion fixing APIPascal Hertleif-74/+6
Uses branch from <https://github.com/rust-lang-nursery/rustfix/pull/63> until we publish a new release.
2018-05-04First step towards rustfix compiletest modePascal Hertleif-2/+90
This is the first small step towards testing auto-fixable compiler suggestions using compiletest. Currently, it only checks if next to a UI test there also happens to a `*.rs.fixed` file, and then uses rustfix (added as external crate) on the original file, and asserts that it produces the fixed version. To show that this works, I've included one such test. I picked this test case at random (and because it was simple) -- It is not relevant to the 2018 edition. Indeed, in the near future, we want to be able to restrict rustfix to edition-lints, so this test cast might go away soon. In case you still think this is somewhat feature-complete, here's a quick list of things currently missing that I want to add before telling people they can use this: - [ ] Make this an actual compiletest mode, with `test [fix] …` output and everything - [ ] Assert that fixed files still compile - [ ] Assert that fixed files produce no (or a known set of) diagnostics output - [ ] Update `update-references.sh` to support rustfix - [ ] Use a published version of rustfix (i.e.: publish a new version rustfix that exposes a useful API for this)
2018-05-03Include the test name when reporting that an expected line was not found in ↵Felix S. Klock II-0/+2
a mir-opt test.
2018-05-03Support test header directives in run-make mode too.Michael Woerister-7/+22
2018-04-27Auto merge of #49891 - cuviper:compiletest-crash, r=alexcrichtonbors-0/+2
compiletest: detect non-ICE compiler panics Fixes #49888, but will be blocked by revealing #49889.
2018-04-25compiletest: introduce skip-transTatsuyuki Ishi-3/+21
2018-04-24compiletest: detect non-ICE compiler panicsJosh Stone-0/+2
2018-04-20Add doc for output_base_name_stage.Eric Huss-0/+2
2018-04-20Fix revision support for UI tests.Eric Huss-26/+42
Fixes #48878
2018-04-20Fix #50113: must explicitly request file name when using with_file_name.Felix S. Klock II-2/+4
2018-04-18When running under compare-mode=nll, generate expected output to ↵Felix S. Klock II-2/+8
`foo.nll.stderr` This allows easy revision of the update-references.sh script (included here) so that it can update the expected output for nll rather than stderr. It also reminds the rustc developer via the filename that they are looking at output generated under comapre-mode=nll. One could argue that there is still a problem with the strategy encoded here: if we reach a scenario where a change to the compiler brings the output under AST and NLL modes back into sync, this code will continue to still generate output to distinct `foo.stderr` and `foo.nll.stderr` files, and will continue to copy those two files back to corresponding distinct files in the source tree, even if the *content* of the two files is now the same. * Arguably the "right thing" to do in that case is to remove the `foo.nll.stderr` file entirely. * However, I think the real answer is that we will probably want to double-check such cases by hand anyway. We should be regularly double-checking the diffs between `foo.stderr` and `foo.nll.stderr`, and if we see a zero-diff case, then we should evaluate whether that is correct, and if so, remove the file by hand.) * In any case, I think the default behavior encoded here (or at least *intended* to be encoded here) is superior to the alternative of *only* generating a `foo.nll.stderr` file if one already existed in the source tree at the time that `compiletest` was invoked (and otherwise unconditionally generating a `foo.stderr` file, as was the behavior prior to this commit), because that alternative is more likely to cause rustc developers to overwrite a `foo.stderr` file with the stderr output from a compare-mode=nll run, which will then break the *normal* `compiletest` run and probably be much more confusing for the average rustc developer.
2018-04-18Generate separate stamp files for `--compare-mode=nll`, and also use them. :)Felix S. Klock II-3/+8
2018-04-18Change output of `compiletest` to include the compare-mode when present.Felix S. Klock II-2/+6
E.g. when running with `--compare-mode=nll`, then each test line will look like e.g.: ``` test [ui (nll)] ui/issue-10969.rs ... ok ```
2018-04-17Auto merge of #49836 - nikomatsakis:nll-facts-prep, r=pnkfelixbors-1/+1
prep work for using timely dataflow with NLL Two major changes: **Two-phase borrows are overhauled.** We no longer have two bits per borrow. Instead, we track -- for each borrow -- an (optional) "activation point". Then, for each point P where the borrow is in scope, we check where P falls relative to the activation point. If P is between the reservation point and the activation point, then this is the "reservation" phase of the borrow, else the borrow is considered active. This is simpler and means that the dataflow doesn't have to care about 2-phase at all, at last not yet. **We no longer support using the MIR borrow checker without NLL.** It is going to be increasingly untenable to support lexical mode as we go forward, I think, and also of increasingly little value. This also exposed a few bugs in NLL mode due to increased testing. r? @pnkfelix cc @bobtwinkles
2018-04-16Add rustdoc-ui test suiteGuillaume Gomez-22/+35
2018-04-15remove -Znll -- borrowck=mir implies nll nowNiko Matsakis-1/+1
2018-04-13Rename must-compile-successfully into compile-passGuillaume Gomez-9/+9
2018-04-11fixed typomemoryleak47-1/+1
2018-04-06Auto merge of #49293 - memoryleak47:add-compiletest-nll-compare-mode, r=pnkfelixbors-22/+82
Add compiletest `--compare-mode nll` option Before implementing the tidy stuff, I'd appreciate if someone reviews the changes so far. This is my first non-trivial pull request, so I could really use some feedback. :) closes #48879. r? @nikomatsakis
2018-04-03make tidy happymemoryleak47-1/+2
2018-04-03running compiletest with --compare-mode will now run, even if the stamp is ↵memoryleak47-1/+1
up to date
2018-03-23Test fixesAlex Crichton-1/+1
2018-03-23the expected ui output is now the empty String if the corresponding files ↵memoryleak47-9/+6
are missing
2018-03-23some tidy fixesmemoryleak47-4/+22
2018-03-23compiletest ui does not check for //~ comments, when --compare-mode is activememoryleak47-1/+1
2018-03-23add --compare-mode option to compiletestmemoryleak47-20/+64
2018-03-22rustc: Add a `#[wasm_custom_section]` attributeAlex Crichton-7/+8
This commit is an implementation of adding custom sections to wasm artifacts in rustc. The intention here is to expose the ability of the wasm binary format to contain custom sections with arbitrary user-defined data. Currently neither our version of LLVM nor LLD supports this so the implementation is currently custom to rustc itself. The implementation here is to attach a `#[wasm_custom_section = "foo"]` attribute to any `const` which has a type like `[u8; N]`. Other types of constants aren't supported yet but may be added one day! This should hopefully be enough to get off the ground with *some* custom section support. The current semantics are that any constant tagged with `#[wasm_custom_section]` section will be *appended* to the corresponding section in the final output wasm artifact (and this affects dependencies linked in as well, not just the final crate). This means that whatever is interpreting the contents must be able to interpret binary-concatenated sections (or each constant needs to be in its own custom section). To test this change the existing `run-make` test suite was moved to a `run-make-fulldeps` folder and a new `run-make` test suite was added which applies to all targets by default. This test suite currently only has one test which only runs for the wasm target (using a node.js script to use `WebAssembly` in JS to parse the wasm output).
2018-03-22Rollup merge of #49158 - varkor:compiletest-triples, r=rkruppekennytm-7/+26
Make compiletest do exact matching on triples This avoids the issues of the previous substring matching, ensuring `ARCH_TABLE` and `OS_TABLE` will no longer contain redundant entries. Fixes #48893. r? @rkruppe
2018-03-22Rollup merge of #49140 - semarie:rustdoc-test-path, r=alexcrichtonkennytm-0/+2
Allow test target to pass without installing explicitly pass -L target-lib to rustdoc on OpenBSD, without it, it fails on several tests with: ``` error[E0463]: can't find crate for `std` ```
2018-03-21Revert "remove FIXME(#33435) and remove the spurious failures counter measure"Niv Kaminer-0/+5
This reverts commit be73a1f963e7830de2dbfbea6b362673ab7e6ded.
2018-03-20Make compiletest do exact matching on triplesvarkor-2/+4
This avoids the issues of the previous substring matching, ensuring `ARCH_TABLE` and `OS_TABLE` will no longer contain redundant entries.
2018-03-20Add more canonicalisations for OS_TABLE and ARCH_TABLEvarkor-5/+21
2018-03-19Revert "Remove useless powerpc64 entry from ARCH_TABLE, closes #47737"varkor-0/+1
This reverts commit 16ac85ce4dce1e185f2e6ce27df3833e07a9e502.
2018-03-18Allow test target to pass without installingSébastien Marie-0/+2
explicitly pass -L target-lib to rustdoc
2018-03-17remove FIXME(#33435) and remove the spurious failures counter measureNiv Kaminer-5/+0
2018-03-17remove FIXME(#11094) and allow make tests to run on targets besides hostNiv Kaminer-5/+0
2018-03-16Rollup merge of #48875 - jcowgill:mips-test-fixes, r=sanxiynkennytm-0/+1
MIPS testsuite fixes This PR adjusts various bits in the testsuite so that more stuff passes on mips*.
2018-03-14test for putting back check on jsonGuillaume Gomez-20/+43
2018-03-11test: Forcibly remove MAKEFLAGS in compiletestAlex Crichton-1/+8
When executing run-make tests we run a risk of leaking the `MAKEFLAGS` environment variable if `./x.py` itself was called from `make` (aka `make check -j3` as the OSX bots do). We may then leak accidentally fds into the child process and trick it into thinking it's got a jobserver! Hopefully addresses [this] spurious failure [this]: https://github.com/rust-lang/rust/pull/48295#issuecomment-372134717
2018-03-08tools/compiletest: add mips64 to ARCH_LISTJames Cowgill-0/+1
Don't bother distinguishing between big end little endian targets. There are currently no tests which need this.
2018-03-07Merge branch 'compiletest-update' of https://github.com/alexcrichton/rust ↵Alex Crichton-12/+15
into update-cargo
2018-03-06Update compiletest's dependenciesAlex Crichton-12/+15
Drop rustc-serialize, add winapi 0.3 and Serde!
2018-03-06Auto merge of #48642 - alexcrichton:compile-cargo-once, r=michaelwoeristerbors-2/+2
Update env_logger to 0.5.4 It looks like this cuts down on the number of dependencies in env_logger and notably cuts out a difference between a shared dependency of rls/cargo. My goal here is to ensure that when we compile the RLS/Cargo on CI we only compile Cargo once, and this is one step towards that!
2018-03-06Update env_logger to 0.5.4Alex Crichton-2/+2
It looks like this cuts down on the number of dependencies in env_logger and notably cuts out a difference between a shared dependency of rls/cargo. My goal here is to ensure that when we compile the RLS/Cargo on CI we only compile Cargo once, and this is one step towards that!
2018-03-04Remove useless powerpc64 entry from ARCH_TABLE, closes #47737debris-1/+0
2018-02-28Rollup merge of #48488 - varkor:handle-gdb-error-compiletest, r=michaelwoeristerkennytm-11/+6
Handle gdb command failure gracefully in compiletest Previously, if the gdb command was available, but threw an error, compiletest would panic. This is obviously not good. Now, gdb is treated as missing if calling `gdb --version` does not output anything on stdout.