summary refs log tree commit diff
path: root/src/tools/compiletest
AgeCommit message (Collapse)AuthorLines
2018-03-23Test fixesAlex Crichton-1/+1
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.
2018-02-26Implement opt-out from UI testing normalizationVadim Petrochenkov-3/+16
2018-02-26Support flag `-Z ui-testing` for tweaking diagnostic output for UI testsVadim Petrochenkov-5/+2
2018-02-25Update tools codeGuillaume Gomez-38/+21
2018-02-23Handle gdb command failure gracefully in compiletestvarkor-11/+6
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.
2018-02-18Auto merge of #47544 - U007D:master, r=nikomatsakisbors-6/+20
Relax termination_trait's error bound As per [this conversation](https://github.com/withoutboats/failure/issues/130#issuecomment-358572413) with @withoutboats and @bkchr
2018-02-15Auto merge of #48203 - kennytm:rollup, r=kennytmbors-10/+14
Rollup of 23 pull requests - Successful merges: #47784, #47806, #47846, #48005, #48033, #48065, #48087, #48114, #48126, #48130, #48133, #48151, #48154, #48156, #48162, #48163, #48165, #48167, #48181, #48186, #48195, #48035, #48210 - Failed merges:
2018-02-13Improve debuggability of #48116.kennytm-1/+1
1. When the invalid condition is hit, write out the relevant variables too 2. In compile-fail/parse-fail tests, check for ICE first, so the invalid error patterns won't mask our ICE output.
2018-02-12changed termination_trait's bound from Error to Debug; added compiletest ↵Brad Gibson-6/+20
header command and appropriate tests
2018-02-12Update compiletest's `read2` functionAlex Crichton-10/+14
This was originally copied over from Cargo and Cargo has since [been updated][update] so let's pull in the fixes here too! [update]: https://github.com/rust-lang/cargo/pull/5030
2018-02-11Delete executables if the test ran successfully.Mark Simulacrum-3/+5
This isn't a perfect heuristic, but since the amount of run-fail tests is far lower than run-pass tests for now, it should be sufficient to ensure that we don't run into CI limits. This makes it possible to run the test binary manually (e.g., under gdb/lldb) if it failed to attempt to find out why.
2018-02-12compiletest: Delete the executable immediately after running.kennytm-2/+8
This should save a lot of space on musl test cases (whose standard library are linked statically).
2018-02-04Rollup merge of #47978 - eddyb:iu, r=kennytmkennytm-4/+4
ui tests: diff from old (expected) to new (actual) instead of backwards. Previously `actual` was "old" and `expected` was "new" which resulted in `+` before `-`. AFAIK all diff tools put `-` before `+`, which made the previous behavior *very confusing*. r? @nikomatsakis
2018-02-03ui tests: diff from old (expected) to new (actual) instead of backwards.Eduard-Mihai Burtescu-4/+4
2018-01-31Enable stack-probe tests with system LLVM >= 5.0Josh Stone-1/+1
2018-01-30Rollup merge of #47780 - varkor:cross-file-errors-line-col, r=estebankkennytm-1/+1
Add line numbers and columns to error messages spanning multiple files If an error message is emitted that spans several files, only the primary file currently has line and column data attached. This is useful information, even in files other than the one in which the error occurs. We can often work out which line and column the error corresponds to in other files — in this case it is helpful to add them (in the case of ambiguity, the first relevant line/column is picked, which is still helpful than none).
2018-01-28Auto merge of #47671 - alexcrichton:trans-c-api-only, r=Mark-Simulacrumbors-3/+10
rustc: Load the `rustc_trans` crate at runtime Building on the work of #45684 this commit updates the compiler to unconditionally load the `rustc_trans` crate at runtime instead of linking to it at compile time. The end goal of this work is to implement #46819 where rustc will have multiple backends available to it to load. This commit starts off by removing the `extern crate rustc_trans` from the driver. This involved moving some miscellaneous functionality into the `TransCrate` trait and also required an implementation of how to locate and load the trans backend. This ended up being a little tricky because the sysroot isn't always the right location (for example `--sysroot` arguments) so some extra code was added as well to probe a directory relative to the current dll (the rustc_driver dll). Rustbuild has been updated accordingly as well to have a separate compilation invocation for the `rustc_trans` crate and assembly it accordingly into the sysroot. Finally, the distribution logic for the `rustc` package was also updated to slurp up the trans backends folder. A number of assorted fallout changes were included here as well to ensure tests pass and such, and they should all be commented inline.
2018-01-27rustc: Load the `rustc_trans` crate at runtimeAlex Crichton-3/+10
Building on the work of # 45684 this commit updates the compiler to unconditionally load the `rustc_trans` crate at runtime instead of linking to it at compile time. The end goal of this work is to implement # 46819 where rustc will have multiple backends available to it to load. This commit starts off by removing the `extern crate rustc_trans` from the driver. This involved moving some miscellaneous functionality into the `TransCrate` trait and also required an implementation of how to locate and load the trans backend. This ended up being a little tricky because the sysroot isn't always the right location (for example `--sysroot` arguments) so some extra code was added as well to probe a directory relative to the current dll (the rustc_driver dll). Rustbuild has been updated accordingly as well to have a separate compilation invocation for the `rustc_trans` crate and assembly it accordingly into the sysroot. Finally, the distribution logic for the `rustc` package was also updated to slurp up the trans backends folder. A number of assorted fallout changes were included here as well to ensure tests pass and such, and they should all be commented inline.
2018-01-26Added JSON output to libtest.Gilad Naaman-1/+1
libtest: Json format now outputs failed tests' stdouts. libtest: Json format now outputs failed tests' stdouts. libtest: Json formatter now spews individiual events, not as an array libtest: JSON fixes libtest: Better JSON escaping libtest: Test start event is printed on time
2018-01-26Add line numbers and columns to error messages spanning multiple filesvarkor-1/+1
If an error message is emitted that spans several files, only the primary file currently has line and column data attached. This is useful information, even in files other than the one in which the error occurs. We can often work out which line and column the error corresponds to in other files — in this case it is helpful to add them (in the case of ambiguity, the first relevant line/column is picked, which is still helpful than none).
2018-01-18Change the --unpretty flag to -Z unprettyMark Mansi-2/+1
-Z unpretty no longer requires -Z unstable-options. Also, I mildly changed the syntax of the flag to match the other -Z flags. All uses of the flag take the form `unpretty=something` where something can either `string` or `string=string` (see the help messages of the CLI).
2018-01-16add a comment about parsing only prefix in header.rsPulkit Goyal-0/+2
2018-01-16rename parse_cfg_prefix() to has_cfg_prefix()Pulkit Goyal-2/+2
The function parse_cfg_prefix() is not really parsing. It's just checking whether the prefix is present or not. So the new function name as suggested by @Mark-Simulacrum is better.
2018-01-16return the boolean value directly instead of using if-elsePulkit Goyal-5/+1
Previous patch introduced something like if x {true} else {false} which can be simply replaced by returning x here. Thanks to @kennytm for spotting it.
2018-01-16implement "only-<platforms>" for test headersPulkit Goyal-0/+13
This patch implements "only-<platforms>" for tests headers using which one can specify just the platforms on which the test should run rather than listing all the platforms to ignore using "ignore-<platforms>". This is a fix for issues #33581 and #47459.
2018-01-13Rollup merge of #47185 - ritiek:ui-test-failed-output, r=nikomatsakiskennytm-9/+106
Show only stderr diff when a ui test fails Addresses #46826. This PR will print the normalized output if expected text is empty otherwise it will just print the diff. Should we also show a few (actual == expected) lines above & below when displaying the diff? What about indicating line numbers as well so one can quickly check mismatch lines in .stderr file?
2018-01-09Rollup merge of #46777 - frewsxcv:frewsxcv-rotate, r=alexcrichtonCorey Farwell-1/+1
Deprecate [T]::rotate in favor of [T]::rotate_{left,right}. Background ========== Slices currently have an **unstable** [`rotate`] method which rotates elements in the slice to the _left_ N positions. [Here][tracking] is the tracking issue for this unstable feature. ```rust let mut a = ['a', 'b' ,'c', 'd', 'e', 'f']; a.rotate(2); assert_eq!(a, ['c', 'd', 'e', 'f', 'a', 'b']); ``` Proposal ======== Deprecate the [`rotate`] method and introduce `rotate_left` and `rotate_right` methods. ```rust let mut a = ['a', 'b' ,'c', 'd', 'e', 'f']; a.rotate_left(2); assert_eq!(a, ['c', 'd', 'e', 'f', 'a', 'b']); ``` ```rust let mut a = ['a', 'b' ,'c', 'd', 'e', 'f']; a.rotate_right(2); assert_eq!(a, ['e', 'f', 'a', 'b', 'c', 'd']); ``` Justification ============= I used this method today for my first time and (probably because I’m a naive westerner who reads LTR) was surprised when the docs mentioned that elements get rotated in a left-ward direction. I was in a situation where I needed to shift elements in a right-ward direction and had to context switch from the main problem I was working on and think how much to rotate left in order to accomplish the right-ward rotation I needed. Ruby’s `Array.rotate` shifts left-ward, Python’s `deque.rotate` shifts right-ward. Both of their implementations allow passing negative numbers to shift in the opposite direction respectively. The current `rotate` implementation takes an unsigned integer argument which doesn't allow the negative number behavior. Introducing `rotate_left` and `rotate_right` would: - remove ambiguity about direction (alleviating need to read docs 😉) - make it easier for people who need to rotate right [`rotate`]: https://doc.rust-lang.org/std/primitive.slice.html#method.rotate [tracking]: https://github.com/rust-lang/rust/issues/41891
2018-01-08Shorten names of some compiler generated artifacts.Michael Woerister-0/+4
2018-01-07Try to fix a perf regression by updating logMalo Jaffré-1/+1
Upgrade `log` to `0.4` in multiple crates.
2018-01-06Show line numbersritiek-5/+101