summary refs log tree commit diff
path: root/src/tools/compiletest
AgeCommit message (Collapse)AuthorLines
2017-04-13Auto merge of #40570 - nikomatsakis:inference-subtype-through-obligation, ↵bors-0/+1
r=arielb1 Handle subtyping in inference through obligations We currently store subtyping relations in the `TypeVariables` structure as a kind of special case. This branch uses normal obligations to propagate subtyping, thus converting our inference variables into normal fallback. It also does a few other things: - Removes the (unstable, outdated) support for custom type inference fallback. - It's not clear how we want this to work, but we know that we don't want it to work the way it currently does. - The existing support was also just getting in my way. - Fixes #30225, which was caused by the trait caching code pretending type variables were normal unification variables, when indeed they were not (but now are). There is one fishy part of these changes: when computing the LUB/GLB of a "bivariant" type parameter, I currently return the `a` value. Bivariant type parameters are only allowed in a very particular situation, where the type parameter is only used as an associated type output, like this: ```rust pub struct Foo<A, B> where A: Fn() -> B { data: A } ``` In principle, if one had `T=Foo<A, &'a u32>` and `U=Foo<A, &'b u32>` and (e.g.) `A: for<'a> Fn() -> &'a u32`, then I think that computing the LUB of `T` and `U` might do the wrong thing. Probably the right behavior is just to create a fresh type variable. However, that particular example would not compile (because the where-clause is illegal; `'a` does not appear in any input type). I was not able to make an example that *would* compile and demonstrate this shortcoming, and handling the LUB/GLB was mildly inconvenient, so I left it as is. I am considering whether to revisit this or what. I have started a crater run to test the impact of these changes.
2017-04-12Make compiletest write test output to different files for different revisions.Michael Woerister-2/+8
2017-04-11fix a bug in compiletest JSON parsing for duplicate errorsNiko Matsakis-0/+1
In some cases, we give multiple primary spans, in which case we would report one `//~` annotation per primary span. That was very confusing because these things are reported to the user as a single error. UI tests would be better here.
2017-03-30Auto merge of #40524 - alexcrichton:update-bootstrap, r=alexcrichtonbors-1/+0
rustbuild: Update bootstrap compiler Now that we've also updated cargo's release process this commit also changes the download location of Cargo from Cargos archives back to the static.r-l.o archives. This should ensure that the Cargo download is the exact Cargo paired with the rustc that we release.
2017-03-29rustbuild: Update bootstrap compilerAlex Crichton-1/+0
Now that we've also updated cargo's release process this commit also changes the download location of Cargo from Cargos archives back to the static.r-l.o archives. This should ensure that the Cargo download is the exact Cargo paired with the rustc that we release.
2017-03-27appveyor: Downgrade MinGW to 6.2.0Alex Crichton-18/+2
It looks like the 6.3.0 MinGW comes with a gdb which has issues (#40184) that an attempted workaround (#40777) does not actually fix (#40835). The original motivation for upgradin MinGW was to fix build flakiness (#40546) due to newer builds not exhibiting the same bug, so let's hope that 6.2.0 isn't too far back in time and still contains the fix we need. Closes #40835
2017-03-26Auto merge of #40347 - alexcrichton:rm-liblog, r=brsonbors-1/+1
Remove internal liblog This commit deletes the internal liblog in favor of the implementation that lives on crates.io. Similarly it's also setting a convention for adding crates to the compiler. The main restriction right now is that we want compiler implementation details to be unreachable from normal Rust code (e.g. requires a feature), and by default everything in the sysroot is reachable via `extern crate`. The proposal here is to require that crates pulled in have these lines in their `src/lib.rs`: #![cfg_attr(rustbuild, feature(staged_api, rustc_private))] #![cfg_attr(rustbuild, unstable(feature = "rustc_private", issue = "27812"))] This'll mean that by default they're not using these attributes but when compiled as part of the compiler they do a few things: * Mark themselves as entirely unstable via the `staged_api` feature and the `#![unstable]` attribute. * Allow usage of other unstable crates via `feature(rustc_private)` which is required if the crate relies on any other crates to compile (other than std).
2017-03-24appveyor: Upgrade MinGW toolchains we useAlex Crichton-1/+18
In debugging #40546 I was able to reproduce locally finally using the literal toolchain that the bots were using. I reproduced the error maybe 4 in 10 builds. I also have the 6.3.0 toolchain installed through `pacman` which has yet to have a failed build. When attempting to reproduce the bug with the toolchain that this commit switches to I was unable to reproduce anything after a few builds. I have no idea what the original problem was, but I'm hoping that it was just some random bug fixed somewhere along the way. I don't currently know of a technical reason to stick to the 4.9.2 toolchains we were previously using. Historcal 5.3.* toolchains would cause llvm to segfault (maybe a miscompile?) but this seems to have been fixed recently. To me if it passes CI then I think we're good. Closes #40546
2017-03-23Remove internal liblogAlex Crichton-1/+1
This commit deletes the internal liblog in favor of the implementation that lives on crates.io. Similarly it's also setting a convention for adding crates to the compiler. The main restriction right now is that we want compiler implementation details to be unreachable from normal Rust code (e.g. requires a feature), and by default everything in the sysroot is reachable via `extern crate`. The proposal here is to require that crates pulled in have these lines in their `src/lib.rs`: #![cfg_attr(rustbuild, feature(staged_api, rustc_private))] #![cfg_attr(rustbuild, unstable(feature = "rustc_private", issue = "27812"))] This'll mean that by default they're not using these attributes but when compiled as part of the compiler they do a few things: * Mark themselves as entirely unstable via the `staged_api` feature and the `#![unstable]` attribute. * Allow usage of other unstable crates via `feature(rustc_private)` which is required if the crate relies on any other crates to compile (other than std).
2017-03-21Make the filenames of .stamp files generated by compiletest shorter.Michael Woerister-3/+1
Otherwise we run into filename length limitations on some file systems (especially ecryptfs).
2017-03-17Fix race condition in fs::create_dir_allDavid Roundy-22/+6
It is more robust to not fail if any directory in a path was created concurrently. This change lifts rustc internal `create_dir_racy` that was created to handle such conditions to be new `create_dir_all` implementation.
2017-03-12Update usages of 'OSX' (and other old names) to 'macOS'.Corey Farwell-1/+1
As of last year with version 'Sierra', the Mac operating system is now called 'macOS'.
2017-02-25Rollup merge of #39859 - GuillaumeGomez:rustdoc-test-relative-path, ↵Eduard-Mihai Burtescu-3/+14
r=alexcrichton Set rustdoc --test files' path relative to the current directory r? @alexcrichton
2017-02-22Make path separator replacement for subfiles as wellGuillaume Gomez-1/+1
2017-02-20Fix #39690: make mir-opt mode for compiletest check timestamps.Felix S. Klock II-0/+14
This version removes prior use of `time` crate, to satisify vendoring requirements. remove extraneous whitespace change
2017-02-20Fix rustdoc test with new file pathGuillaume Gomez-3/+14
2017-02-11Add tested item in the rustdoc --test outputGuillaume Gomez-6/+10
2017-02-08Rollup merge of #39597 - GuillaumeGomez:correct_rustdoc_test_file, ↵Corey Farwell-25/+58
r=alexcrichton Display correct filename with --test option Fixes #39592. With the current files: ```rust pub mod foo; /// This is a Foo; /// /// ``` /// println!("baaaaaar"); /// ``` pub struct Foo; /// This is a Bar; /// /// ``` /// println!("fooooo"); /// ``` pub struct Bar; ``` ```rust // note the whitespaces /// ``` /// println!("foo"); /// ``` pub fn foo() {} ``` It displays: ``` ./build/x86_64-apple-darwin/stage1/bin/rustdoc --test test.rs running 3 tests test test.rs - line 13 ... ok test test.rs - line 5 ... ok test foo.rs - line 2 ... ok test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured ``` ``` ` `` println!("lol"); ` `` asdjnfasd asd ``` It displays: ``` ./build/x86_64-apple-darwin/stage1/bin/rustdoc --test foo.md running 1 test test <input> - line 3 ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured ``` r? @alexcrichton
2017-02-08Add more test for rustdoc --testGuillaume Gomez-25/+58
2017-02-07Rollup merge of #39431 - alexcrichton:no-more-makefiles, r=brsonCorey Farwell-27/+49
Delete the makefile build system This PR deletes the makefile build system in favor of the rustbuild build system. The beta has now been branched so 1.16 will continue to be buildable from the makefiles, but going forward 1.17 will only be buildable with rustbuild. Rustbuild has been the default build system [since 1.15.0](https://github.com/rust-lang/rust/pull/37817) and the makefiles were [proposed for deletion](https://internals.rust-lang.org/t/proposal-for-promoting-rustbuild-to-official-status/4368) at this time back in November of last year. And now with the deletion of these makefiles we can start getting those sweet sweet improvements of using crates.io crates in the compiler!
2017-02-07Rollup merge of #39400 - alexcrichton:arm-cross-test, r=brsonCorey Farwell-1/+52
Add support for test suites emulated in QEMU This commit adds support to the build system to execute test suites that cannot run natively but can instead run inside of a QEMU emulator. A proof-of-concept builder was added for the `arm-unknown-linux-gnueabihf` target to show off how this might work. In general the architecture is to have a server running inside of the emulator which a local client connects to. The protocol between the server/client supports compiling tests on the host and running them on the target inside the emulator. Closes #33114
2017-02-06compiletest: Add caching of test resultsAlex Crichton-1/+48
Don't re-run tests in compiletest if all the inputs haven't changed, manage stamp files in the output directory.
2017-02-06std: Remove cfg(cargobuild) annotationsAlex Crichton-26/+1
These are all now no longer needed that we've only got rustbuild in tree.
2017-02-03Create new flag to test rustdoc --testGuillaume Gomez-47/+49
2017-02-03Move test from bootstrap to compiletestGuillaume Gomez-14/+84
2017-01-31Auto merge of #38847 - michaelwoerister:gate-on-incr-comp, r=alexcrichtonbors-0/+4
travis: Gate on some minimal support for incremental compilation. This commit adds a travis job that 1. builds a stage2 compiler in incremental mode (but with empty incremental compilation cache), and 2. builds and runs the run-pass test suite also in incremental mode. Building incrementally with an empty cache makes sure that the compiler doesn't crash in dependency tracking during bootstrapping. Executing the incrementally built test suite gives some measure of confidence that we generate valid code. Note, however, that the above does not give strong guarantees about the validity of incremental compilation, it just provides a basis for being able to rely on from-scratch incr. comp. builds as reference values in further tests (which then do actual incremental compilation). r? @alexcrichton
2017-01-30compiletest: Clear RUSTFLAGS env-var for run-make tests.Michael Woerister-0/+4
2017-01-29Add support for test suites emulated in QEMUAlex Crichton-1/+52
This commit adds support to the build system to execute test suites that cannot run natively but can instead run inside of a QEMU emulator. A proof-of-concept builder was added for the `arm-unknown-linux-gnueabihf` target to show off how this might work. In general the architecture is to have a server running inside of the emulator which a local client connects to. The protocol between the server/client supports compiling tests on the host and running them on the target inside the emulator. Closes #33114
2017-01-20Rollup merge of #39068 - alexcrichton:more-small-tests, r=brsonAlex Crichton-32/+41
travis: Add i586 linux and i686 musl This commit expands the existing x86_64-musl entry in the Travis matrix to also build/test i586-unknown-linux-gnu and i686-unknown-linux-musl. cc #38531 Closes #35599 Closes #39053
2017-01-16ignore-gdb-version: Address review comments.Michael Woerister-6/+15
2017-01-15travis: Add i586 linux and i686 muslAlex Crichton-32/+41
This commit expands the existing x86_64-musl entry in the Travis matrix to also build/test i586-unknown-linux-gnu and i686-unknown-linux-musl. cc #38531 Closes #39053
2017-01-13compiletest: Allow for ignoring tests if certain GDB version is detected.Michael Woerister-9/+35
2017-01-06compiletest: Fix flaky Android gdb test runsAlex Crichton-42/+39
Local testing showed that I was able to reproduce an error where debuginfo tests on Android would fail with "connection reset by peer". Further investigation turned out that the gdb tests are android with bit of process management: * First an `adb forward` command is run to ensure that the host's port 5039 is the same as the emulator's. * Next an `adb shell` command is run to execute the `gdbserver` executable inside the emulator. This gdb server will attach to port 5039 and listen for remote gdb debugging sessions. * Finally, we run `gdb` on the host (not in the emulator) and then connect to this gdb server to send it commands. The problem was happening when the host's gdb was failing to connect to the remote gdbserver running inside the emulator. The previous test for this was that after `adb shell` executed we'd sleep for a second and then attempt to make a TCP connection to port 5039. If successful we'd run gdb and on failure we'd sleep again. It turns out, however, that as soon as we've executed `adb forward` all TCP connections to 5039 will succeed. This means that we would only ever sleep for at most one second, and if this wasn't enough time we'd just fail later because we would assume that gdbserver had started but it may not have done so yet. This commit fixes these issues by removing the TCP connection to test if gdbserver is ready to go. Instead we read the stdout of the process and wait for it to print that it's listening at which point we start running gdb. I've found that locally at least I was unable to reproduce the failure after these changes. Closes #38710
2016-12-30rustbuild: Compile all support tools in stage0Alex Crichton-1/+5
This commit changes all tools and such to get compiled in stage0, not in later stages. The purpose of this commit is to cut down dependencies on later stages for future modifications to the build system. Notably we're going to be adding builders that produce a full suite of cross-compiled artifacts for a particular host, and that shouldn't compile the `x86_64-unknown-linux-gnu` compiler more than once. Currently dependencies on, for example, the error index end up compiling the `x86_64-unknown-linux-gnu` compiler more than necessary. As a result here we move many dependencies on these tools to being produced by a stage0 compiler, not a stage1+ compiler. None of these tools actually need to be staged at all, so they'll exhibit consistent behavior across the stages.
2016-12-29A few small test fixes and such from rollupAlex Crichton-2/+1
2016-12-29Rollup merge of #38695 - alexcrichton:debug-appveyor, r=brsonAlex Crichton-0/+38
appveyor: Attempt to debug flaky test runs This commit is an attempt to debug #38620 since we're unable to reproduce it locally. It follows the [advice] of those with AppVeyor to use the `handle.exe` tool to try to debug what processes have a handle to the file open. This won't be guaranteed to actually help us, but hopefully it'll diagnose something at some point? [advice]: http://help.appveyor.com/discussions/questions/2898
2016-12-29appveyor: Attempt to debug flaky test runsAlex Crichton-0/+38
This commit is an attempt to debug #38620 since we're unable to reproduce it locally. It follows the [advice] of those with AppVeyor to use the `handle.exe` tool to try to debug what processes have a handle to the file open. This won't be guaranteed to actually help us, but hopefully it'll diagnose something at some point? [advice]: http://help.appveyor.com/discussions/questions/2898
2016-12-27compiletest: Don't limit all suites on AndroidAlex Crichton-1/+18
On Android we only have one test thread for supposed problems with concurrency and the remote debugger. Not all of our suites require one concurrency, however, and suites like compile-fail or pretty can be much faster if they're parallelized on Travis. This commit only sets the test threads to one on Android for suites which actually run code, and other suites aren't tampered with.
2016-12-20mk: Fix compile with makefilesAlex Crichton-4/+10
A tweak was made to dependencies in #38451 but the makefiles weren't updated to accompany this. Instead of trying to integerate the `build_helper` crate into the makefiles (which currently isn't present) this commit takes the approach of just duplicating the required logic, which should be small enough for now.
2016-12-20Rollup merge of #38451 - semarie:openbsd-rustbuild, r=alexcrichtonAlex Crichton-1/+4
adaptation to rustbuild for openbsd Since the switch to rustbuild, the build for openbsd is broken: - [X] `ar` inference based on compiler name is wrong (OpenBSD usually use `egcc`, but `ear` doesn't exist) - [X] `make` isn't GNU-make under OpenBSD (and others BSD platforms) - [x] `stdc++` isn't the right stdc++ library to link with (it should be `estdc++`) - [x] corrects tests that don't pass anymore (problems related to rustbuild) r? @alexcrichton
2016-12-20Rollup merge of #38289 - bluss:mir-verbose-test-fail, r=michaelwoeristerAlex Crichton-5/+19
A more verbose matching failure for mir tests This makes it easier to work with mir test failures during development. - Show which expected line was not found - Show full expected output - Show full actual output
2016-12-17let BSD to use gmake for GNU-makeSébastien Marie-1/+4
the diff extends build_helper to provide an function to return the expected name of GNU-make on the host: "make" or "gmake". Fixes #38429
2016-12-14libtest: add --list option to list tests and benchmarksJeremy Fitzhardinge-0/+1
This option lists all the tests and benchmarks a binary provides. By default the listing is sent to stdout, but if --logfile is also specified, it is written there. If filters are specified, they're applied before the output is emitted.
2016-12-10compiletest: A more verbose matching failure for mir testsUlrik Sverdrup-5/+19
This makes it easier to work with mir test failures during development. - Show which expected line was not found - Show full expected output - Show full actual output
2016-12-05libtest: add --exact to make filter matching exactJeremy Fitzhardinge-0/+7
Filter matching is by substring by default. This makes it impossible to run a single test if its name is a substring of some other test. For example, its not possible to run just "mymod::test" with these tests: mymod::test mymod::test1 mymod::test_module::moretests You could declare by convention that no test has a name that's a substring of another test, but that's not really practical. This PR adds the "--exact" flag, to make filter matching exactly match the complete name.
2016-11-30Update the bootstrap compilerAlex Crichton-8/+0
Now that we've got a beta build, let's use it!
2016-11-17Improved error reporting when target sysroot is missing.Robert Vally-2/+12
2016-11-10compiletest: detect nodejs binary, allow overrideMark-Simulacrum-2/+5
Allow passing a custom nodejs directory in configure.
2016-11-05Merge branch 'gdb-next-gen' of https://github.com/TimNN/rust into rollupAlex Crichton-92/+199
2016-11-05ignore gdb check for androidTim Neumann-5/+6