Commit Graph

461 Commits

Author SHA1 Message Date
Alex Crichton b325baf0ae rustbuild: Add support for compiletest test suites
This commit adds support in rustbuild for running all of the compiletest test
suites as part of `make check`. The `compiletest` program was moved to
`src/tools` (like `rustbook` and others) and is now just compiled like any other
old tool. Each test suite has a pretty standard set of dependencies and just
tweaks various parameters to the final compiletest executable.

Note that full support is lacking in terms of:

* Once a test suite has passed, that's not remembered. When a test suite is
  requested to be run, it's always run.
* The arguments to compiletest probably don't work for every possible
  combination of platforms and testing environments just yet. There will likely
  need to be future updates to tweak various pieces here and there.
* Cross compiled test suites probably don't work just yet, support for that will
  come in a follow-up patch.
2016-04-18 16:30:01 -07:00
Alex Crichton 7bfaeaaf9c tidy: Add a check to ensure Cargo.toml is in sync
This verifies that the crates listed in the `[dependencies]` section of
`Cargo.toml` are a subset of the crates listed in `lib.rs` for our in-tree
crates. This should help ensure that when we refactor crates over time we keep
these dependency lists in sync.
2016-04-12 15:55:14 -07:00
Alex Crichton 9dd3c54a2c rustbuild: Migrate tidy checks to Rust
This commit rewrites all of the tidy checks we have, namely:

* featureck
* errorck
* tidy
* binaries

into Rust under a new `tidy` tool inside of the `src/tools` directory. This at
the same time deletes all the corresponding Python tidy checks so we can be sure
to only have one source of truth for all the tidy checks.

cc #31590
2016-04-12 08:17:42 -07:00
Niko Matsakis 098571797c Address nits. 2016-04-06 12:42:47 -04:00
Niko Matsakis 068142a2e6 add incremental test runner and some tests 2016-04-06 12:42:46 -04:00
Alex Crichton a3fdde7453 mk: Add configure option for disabling codegen tests
Our `codegen` test suite requires the LLVM `FileCheck` utility but unfortunately
this isn't always available in all custom LLVM roots (e.g. those specified via
`--llvm-root`). This commit adds a `./configure` option called
`--disable-codegen-tests` which will manually disable running these tests. In
the case that this option is passed we can forgo the need for the `FileCheck`
executable. Note that we still require `FileCheck` by default as we will attempt
to run these tests.

Closes #28667
2016-04-03 00:18:44 -07:00
Michael Woerister fafdfa8bdc Salt test crates in buildsystem. 2016-03-25 14:07:18 -04:00
Alex Crichton 0d5cfd9117 mk: Distribute fewer TARGET_CRATES
Right now everything in TARGET_CRATES is built by default for all non-fulldeps
tests and is distributed by default for all target standard library packages.
Currenly this includes a number of unstable crates which are rarely used such as
`graphviz` and `rbml`>

This commit trims down the set of `TARGET_CRATES`, moves a number of tests to
`*-fulldeps` as a result, and trims down the dependencies of libtest so we can
distribute fewer crates in the `rust-std` packages.
2016-03-07 13:05:12 -08:00
bors f59fd46425 Auto merge of #31846 - alexcrichton:better-disable-jemallc, r=brson
The `--disable-jemalloc` configure option has a failure mode where it will
create a distribution that is not compatible with other compilers. For example
the nightly for Linux will assume that it will link to jemalloc by default as
an allocator for executable crates. If, however, a standard library is used
which was built via `./configure --disable-jemalloc` then this will fail
because the jemalloc crate wasn't built.

While this seems somewhat reasonable as a niche situation, the same mechanism is
used for disabling jemalloc for platforms that just don't support it. For
example if the rumprun target is compiled then the sibiling Linux target *also*
doesn't have jemalloc. This is currently a problem for our cross-build nightlies
which build many targets. If rumprun is also built, it will disable jemalloc for
all targets, which isn't desired.

This commit moves the platform-specific disabling of jemalloc as hardcoded logic
into the makefiles that is scoped per-platform. This way when configuring
multiple targets **without the `--disable-jemalloc` option specified** all
targets will get jemalloc as they should.
2016-02-26 13:38:46 +00:00
Alex Crichton b980f22877 mk: Move disable-jemalloc logic into makefiles
The `--disable-jemalloc` configure option has a failure mode where it will
create a distribution that is not compatible with other compilers. For example
the nightly for Linux will assume that it will link to jemalloc by default as
an allocator for executable crates. If, however, a standard library is used
which was built via `./configure --disable-jemalloc` then this will fail
because the jemalloc crate wasn't built.

While this seems somewhat reasonable as a niche situation, the same mechanism is
used for disabling jemalloc for platforms that just don't support it. For
example if the rumprun target is compiled then the sibiling Linux target *also*
doesn't have jemalloc. This is currently a problem for our cross-build nightlies
which build many targets. If rumprun is also built, it will disable jemalloc for
all targets, which isn't desired.

This commit moves the platform-specific disabling of jemalloc as hardcoded logic
into the makefiles that is scoped per-platform. This way when configuring
multiple targets **without the `--disable-jemalloc` option specified** all
targets will get jemalloc as they should.
2016-02-25 21:05:59 -08:00
Niko Matsakis c1ec32d4f7 Recurse to find test files in any subdirectory of the base path. If a
subdirectory contains `compiletest-ignore-dir`, then ignore it.
2016-02-24 18:40:39 -05:00
Sébastien Marie 263de3d0e7 pass CXX to run-make
use CXX value found at configure time inside run-make tests.

it permits OpenBSD to pass llvm-module-pass test (which use CXX
variable).
2016-02-16 06:30:30 +01:00
bors 86e6e3235e Auto merge of #31391 - frewsxcv:test, r=alexcrichton
Part of #31185
2016-02-14 08:25:39 +00:00
Corey Farwell e5e2cdb9e3 Add LLVM ModulePass regression test using run-make.
Part of #31185
2016-02-13 22:04:51 -05:00
Guillaume Gomez ed6b575648 Update Makefile 2016-02-09 05:22:24 +01:00
Alex Crichton 178d4b0fd3 Revert "mk: fix some undefined variable warnings"
This reverts commit d03712977d.
2016-02-01 23:27:04 -08:00
Tamir Duberstein d03712977d mk: fix some undefined variable warnings
Some of this is scary stuff. Probably time to lint against this.

Found with `make --warn-undefined-variables`.
2016-02-01 05:21:06 -05:00
bors 9bda7ea81d Auto merge of #31274 - brson:nobench, r=nikomatsakis
I don't believe these test cases have served any purpose in years.

The shootout benchmarks are now upstreamed. A new benchmark suite
should rather be maintained out of tree.

r? @nikomatsakis
2016-01-30 14:50:44 +00:00
bors 303892ee15 Auto merge of #30448 - alexcrichton:llvmup, r=nikomatsakis
These commits perform a few high-level changes with the goal of enabling i686 MSVC unwinding:

* LLVM is upgraded to pick up the new exception handling instructions and intrinsics for MSVC. This puts us somewhere along the 3.8 branch, but we should still be compatible with LLVM 3.7 for non-MSVC targets.
* All unwinding for MSVC targets (both 32 and 64-bit) are implemented in terms of this new LLVM support. I would like to also extend this to Windows GNU targets to drop the runtime dependencies we have on MinGW, but I'd like to land this first.
* Some tests were fixed up for i686 MSVC here and there where necessary. The full test suite should be passing now for that target.

In terms of landing this I plan to have this go through first, then verify that i686 MSVC works, then I'll enable `make check` on the bots for that target instead of just `make` as-is today.

Closes #25869
2016-01-30 00:25:44 +00:00
Alex Crichton 58f1b9c7fc Get tests working on MSVC 32-bit 2016-01-29 16:25:21 -08:00
Brian Anderson 005c9624bb Remove src/test/bench
I don't believe these test cases have served any purpose in years.

The shootout benchmarks are now upstreamed. A new benchmark suite
should rather be maintained out of tree.
2016-01-29 21:54:30 +00:00
Michael Woerister 862911df9a Implement the translation item collector.
The purpose of the translation item collector is to find all monomorphic instances of functions, methods and statics that need to be translated into LLVM IR in order to compile the current crate.
So far these instances have been discovered lazily during the trans path. For incremental compilation we want to know the set of these instances in advance, and that is what the trans::collect module provides.
In the future, incremental and regular translation will be driven by the collector implemented here.
2016-01-26 10:17:45 -05:00
Alex Crichton 5cd9ca90c5 mk: Remove all perf-related targets
I don't believe these have been used at all recently, and I doubt many of them
still work, so remove the stale support.
2016-01-21 14:45:23 -08:00
Sébastien Marie e6418964b9 remove specific code for OpenBSD that define STDCPP_LIBDIR_RUSTFLAGS
it isn't the good way to process, as it makes conflicts when building rustc while another version of rustc in installed system-wide.
2015-12-20 07:21:36 +01:00
Richard Diamond 7bd69f2248 Better support for `--llvm-root`.
This handles cases when the LLVM used isn't configured will the 'usual'
targets. Also, cases where LLVM is shared are also handled (ie with
`LD_LIBRARY_PATH` etc).
2015-12-13 15:05:43 -06:00
Jake Worth 4632101fc2 Fix typo 2015-12-03 18:29:00 -05:00
Steve Klabnik 1a2d1b8d36 Re-enable testing the book
In #29932, I moved the location of TRPL, but I missed making the changes
in mk/tests.mk. This led to #30088 landing with a broken example.

As such, #30113 will need to land before this.
2015-11-30 14:55:26 -05:00
bors 4bd302ee9f Auto merge of #29794 - semarie:openbsd-stdcpp-path, r=alexcrichton
under openbsd, the library path of libstdc++ need to be explicit (due
to the fact the default linker `cc` is gcc-4.2, and not gcc-4.9).

but when a recent LLVM is installed, rustc compilation pikes the bad
LLVM version (which live in /usr/local/lib, which is same directory of
libestdc++.so for gcc-4.9).

this patch move the libstdc++ path from RUST_FLAGS_<target> to special
variable, and use it *after* LLVM_LIBDIR_RUSTFLAGS_<target> in
arguments.

r? @alexcrichton
2015-11-17 02:21:20 +00:00
Kevin Butler 8e23e2fbcb libtest: deny warnings in doctests 2015-11-12 05:17:07 +00:00
Kevin Butler c0fc402ab6 libterm: deny warnings in doctests 2015-11-12 05:17:02 +00:00
Kevin Butler d64e551248 libsyntax: deny warnings in doctests 2015-11-12 05:16:57 +00:00
Kevin Butler a17f81b4b7 libserialize: deny warnings in doctests 2015-11-12 05:16:53 +00:00
Kevin Butler a715dd52e7 librbml: deny warnings in doctests 2015-11-12 05:16:43 +00:00
Kevin Butler 86c55e7d99 librand: deny warnings in doctests 2015-11-12 05:16:38 +00:00
Kevin Butler d28d000ef9 liblog: deny warnings in doctests 2015-11-12 05:16:34 +00:00
Kevin Butler ac36e10e2f libgraphviz: deny warnings in doctests 2015-11-12 05:16:29 +00:00
Kevin Butler 82ad9738b3 libgetopts: deny warnings in doctests 2015-11-12 05:16:24 +00:00
Kevin Butler e3976cda64 libfmt_macros: deny warnings in doctests 2015-11-12 05:16:20 +00:00
Kevin Butler 0226fa17cc libflate: deny warnings in doctests 2015-11-12 05:16:14 +00:00
Kevin Butler 89a8203898 libarena: deny warnings in doctests 2015-11-12 05:15:29 +00:00
Sébastien Marie 646b0b6392 pass stdc++ library path after LVVM library path
under openbsd, the library path of libstdc++ need to be explicit (due
to the fact the default linker `cc` is gcc-4.2, and not gcc-4.9).

but when a recent LLVM is installed, rustc compilation pikes the bad
LLVM version (which live in /usr/local/lib, which is same directory of
libestdc++.so for gcc-4.9).

this patch move the libstdc++ path from RUST_FLAGS_<target> to special
variable, and use it *after* LLVM_LIBDIR_RUSTFLAGS_<target> in
arguments.
2015-11-11 20:16:17 +01:00
Alex Crichton 3d28b8b98e std: Migrate to the new libc
* Delete `sys::unix::{c, sync}` as these are now all folded into libc itself
* Update all references to use `libc` as a result.
* Update all references to the new flat namespace.
* Moves all windows bindings into sys::c
2015-11-09 22:55:50 -08:00
Alex Crichton 0675dffac4 rmake: Get all tests passing on MSVC 2015-09-17 08:40:33 -07:00
Alex Crichton 45bf1ed1a1 rustc: Allow changing the default allocator
This commit is an implementation of [RFC 1183][rfc] which allows swapping out
the default allocator on nightly Rust. No new stable surface area should be
added as a part of this commit.

[rfc]: https://github.com/rust-lang/rfcs/pull/1183

Two new attributes have been added to the compiler:

* `#![needs_allocator]` - this is used by liballoc (and likely only liballoc) to
  indicate that it requires an allocator crate to be in scope.
* `#![allocator]` - this is a indicator that the crate is an allocator which can
  satisfy the `needs_allocator` attribute above.

The ABI of the allocator crate is defined to be a set of symbols that implement
the standard Rust allocation/deallocation functions. The symbols are not
currently checked for exhaustiveness or typechecked. There are also a number of
restrictions on these crates:

* An allocator crate cannot transitively depend on a crate that is flagged as
  needing an allocator (e.g. allocator crates can't depend on liballoc).
* There can only be one explicitly linked allocator in a final image.
* If no allocator is explicitly requested one will be injected on behalf of the
  compiler. Binaries and Rust dylibs will use jemalloc by default where
  available and staticlibs/other dylibs will use the system allocator by
  default.

Two allocators are provided by the distribution by default, `alloc_system` and
`alloc_jemalloc` which operate as advertised.

Closes #27389
2015-08-14 15:13:10 -07:00
bors 7b7fc67dd4 Auto merge of #27625 - wthrowe:find, r=alexcrichton
New enough find on Linux doesn't support "-perm +..." and suggests
using "-perm /..." instead, but that doesn't work on Windows.
Hopefully all platforms are happy with this expanded version.

I don't have access to a Windows development system to test this, so someone needs to verify that this actually works there before merging.

Closes #19981.
2015-08-13 16:09:22 +00:00
William Throwe 904e428dba Whitelist .pp files in tidy-binaries
Pretty-printed files sometimes start with #![some_feature], which
looks like a shebang line and confuses Windows builds into thinking
they are executables.
2015-08-12 19:08:22 -04:00
Alex Crichton b6b4f5a0e7 trans: Re-enable unwinding on 64-bit MSVC
This commit leverages the runtime support for DWARF exception info added
in #27210 to enable unwinding by default on 64-bit MSVC. This also additionally
adds a few minor fixes here and there in the test harness and such to get
`make check` entirely passing on 64-bit MSVC:

* The invocation of `maketest.py` now works with spaces/quotes in CC
* debuginfo tests are disabled on MSVC
* A link error for librustc was hacked around (see #27438)
2015-08-11 16:45:02 -07:00
William Throwe f001f9a73e Make tidy-binaries find invocation work on Linux
New enough find on Linux doesn't support "-perm +..." and suggests
using "-perm /..." instead, but that doesn't work on Windows.
Hopefully all platforms are happy with this expanded version.
2015-08-10 00:12:45 -04:00
Diggory Blake 6203d97a86 Fix setting of PATH for `make check` on windows 2015-08-06 04:47:15 +01:00
Alexis Beingessner ca902dd8cb rename TARPL to The Rustinomicon 2015-08-03 11:22:08 -07:00