about summary refs log tree commit diff
path: root/src/bootstrap/test.rs
AgeCommit message (Collapse)AuthorLines
2018-04-16Fix nitsGuillaume Gomez-2/+0
2018-04-16Add rustdoc-ui test suiteGuillaume Gomez-7/+21
2018-04-16Add warning if a resolution failedGuillaume Gomez-0/+35
2018-04-14Rollup merge of #49922 - f-bro:zmiri, r=oli-obkkennytm-1/+1
Remove -Zmiri debugging option
2018-04-13Remove -Z miri debugging optionFabio B-1/+1
2018-04-12Fix test failure in src/tools/rustdoc-themes when rust.rpath = falseChris Coulson-1/+1
2018-04-09Add rustc book to the build systemsteveklabnik-0/+1
2018-04-03Fix a few accidental expectationsMark Simulacrum-8/+14
2018-04-03Avoid printing output when in dry run modeMark Simulacrum-24/+25
2018-04-03Refactor to use a dry-run config instead of cfg(test)Mark Simulacrum-1/+8
This ensures that each build will support the testing design of "dry running" builds. It's also checked that a dry run build is equivalent step-wise to a "wet" run build; the graphs we generate when running are directly compared node/node and edge/edge, both for order and contents.
2018-04-03Add tests to rustbuildMark Simulacrum-0/+1
In order to run tests, previous commits have cfg'd out various parts of rustbuild. Generally speaking, these are filesystem-related operations and process-spawning related parts. Then, rustbuild is run "as normal" and the various steps that where run are retrieved from the cache and checked against the expected results. Note that this means that the current implementation primarily tests "what" we build, but doesn't actually test that what we build *will* build. In other words, it doesn't do any form of dependency verification for any crate. This is possible to implement, but is considered future work. This implementation strives to cfg out as little code as possible; it also does not currently test anywhere near all of rustbuild. The current tests are also not checked for "correctness," rather, they simply represent what we do as of this commit, which may be wrong. Test cases are drawn from the old implementation of rustbuild, though the expected results may vary.
2018-03-25Rollup merge of #49089 - alexcrichton:fix-timings, r=Mark-Simulacrumkennytm-27/+28
rustbuild: Tweak where timing information goes This commit tweaks where timing and step information is printed out as part of the build, ensuring that we do it as close to the location where work happens as possible. In rustbuild various functions may perform long blocking work as dependencies are assembled, so if we print out timing information early on we may accidentally time more than just the step we were intending to time!
2018-03-23Auto merge of #49311 - SimonSapin:bootstrap-vs-rustflags-the-return, ↵bors-0/+6
r=Mark-Simulacrum Use the same RUSTFLAGS for building and testing `bootstrap` This avoids recompiling the whole dependency graph twice for every `./x.py test` run. Fixes #49215
2018-03-23Use the same RUSTFLAGS for building and testing `bootstrap`Simon Sapin-0/+6
Fixes #49215
2018-03-22rustc: Add a `#[wasm_custom_section]` attributeAlex Crichton-7/+12
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-17rustbuild: Tweak where timing information goesAlex Crichton-27/+28
This commit tweaks where timing and step information is printed out as part of the build, ensuring that we do it as close to the location where work happens as possible. In rustbuild various functions may perform long blocking work as dependencies are assembled, so if we print out timing information early on we may accidentally time more than just the step we were intending to time!
2018-03-16Automatically enable the `clippy` feature of `rls` if clippy buildsOliver Schneider-4/+14
2018-03-11Auto merge of #48599 - Mark-Simulacrum:rustbuild-updates-step-1, r=alexcrichtonbors-12/+4
Remove ONLY_BUILD and ONLY_BUILD_TARGETS Primarily removes `ONLY_BUILD` and `ONLY_BUILD_TARGETS`. These aren't actually needed in the new system since we can simply not take the relevant `host` and `target` fields if we don't want to run with them in `Step::make_run`. This PR also includes a few other commits which generally clean up the state of rustbuild, but are not related to the `Step` changes.
2018-03-09rustbuild: Fix MSBuild location of `llvm-config.exe`Alex Crichton-2/+5
For LLD integration the path to `llvm-config` needed to change to inside the build directory itself (for whatever reason) but the build directory is different on MSBuild than it is on `ninja` for MSVC builds, so the path to `llvm-config.exe` was actually wrong and not working! This commit removes the `Build::llvm_config` function in favor of the source of truth, the `Llvm` build step itself. The build step was then updated to find the right build directory for MSBuild as well as `ninja` for where `llvm-config.exe` is located. Closes #48749
2018-03-08Remove ONLY_BUILD.Mark Simulacrum-12/+4
All uses are replaced with not accessing run.target/run.host, and instead directly using run.builder.build.build.
2018-03-05Get the path to cargo from rustbuildMark Mansi-0/+1
2018-03-03rust: Import LLD for linking wasm objectsAlex Crichton-1/+1
This commit imports the LLD project from LLVM to serve as the default linker for the `wasm32-unknown-unknown` target. The `binaryen` submoule is consequently removed along with "binaryen linker" support in rustc. Moving to LLD brings with it a number of benefits for wasm code: * LLD is itself an actual linker, so there's no need to compile all wasm code with LTO any more. As a result builds should be *much* speedier as LTO is no longer forcibly enabled for all builds of the wasm target. * LLD is quickly becoming an "official solution" for linking wasm code together. This, I believe at least, is intended to be the main supported linker for native code and wasm moving forward. Picking up support early on should help ensure that we can help LLD identify bugs and otherwise prove that it works great for all our use cases! * Improvements to the wasm toolchain are currently primarily focused around LLVM and LLD (from what I can tell at least), so it's in general much better to be on this bandwagon for bugfixes and new features. * Historical "hacks" like `wasm-gc` will soon no longer be necessary, LLD will [natively implement][gc] `--gc-sections` (better than `wasm-gc`!) which means a postprocessor is no longer needed to show off Rust's "small wasm binary size". LLD is added in a pretty standard way to rustc right now. A new rustbuild target was defined for building LLD, and this is executed when a compiler's sysroot is being assembled. LLD is compiled against the LLVM that we've got in tree, which means we're currently on the `release_60` branch, but this may get upgraded in the near future! LLD is placed into rustc's sysroot in a `bin` directory. This is similar to where `gcc.exe` can be found on Windows. This directory is automatically added to `PATH` whenever rustc executes the linker, allowing us to define a `WasmLd` linker which implements the interface that `wasm-ld`, LLD's frontend, expects. Like Emscripten the LLD target is currently only enabled for Tier 1 platforms, notably OSX/Windows/Linux, and will need to be installed manually for compiling to wasm on other platforms. LLD is by default turned off in rustbuild, and requires a `config.toml` option to be enabled to turn it on. Finally the unstable `#![wasm_import_memory]` attribute was also removed as LLD has a native option for controlling this. [gc]: https://reviews.llvm.org/D42511
2018-02-24Run the external doc tests in tools job.kennytm-6/+16
2018-02-23Split test::Docs into one Step for each book.kennytm-12/+53
The *.md at the root directory in src/doc are no longer tested, but this should be fine since all files there are deprecated.
2018-02-18Rollup merge of #48275 - matthiaskrgr:codespell, r=kennytm,varkorGuillaume Gomez-1/+1
fix more typos found by codespell.
2018-02-17fix more typos found by codespell.Matthias Krüger-1/+1
2018-02-17Add command to launch only doc testsGuillaume Gomez-0/+3
2018-02-11Change Step to be invoked with a path when in default mode.Mark Simulacrum-245/+298
Previously, a Step would be able to tell on its own when it was invoked "by-default" (that is, `./x.py test` was called instead of `./x.py test some/path`). This commit replaces that functionality, invoking each Step with each of the paths it has specified as "should be invoked by." For example, if a step calls `path("src/tools/cargo")` and `path("src/doc/cargo")` then it's make_run will be called twice, with "src/tools/cargo" and "src/doc/cargo." This makes it so that default handling logic is in builder, instead of spread across various Steps. However, this meant that some Step specifications needed to be updated, since for example `rustdoc` can be built by `./x.py build src/librustdoc` or `./x.py build src/tools/rustdoc`. A `PathSet` abstraction is added that handles this: now, each Step can not only list `path(...)` but also `paths(&[a, b, ...])` which will make it so that we don't invoke it with each of the individual paths, instead invoking it with the first path in the list (though this shouldn't be depended on). Future work likely consists of implementing a better/easier way for a given Step to work with "any" crate in-tree, especially those that want to run tests, build, or check crates in the std, test, or rustc crate trees. Currently this is rather painful to do as most of the logic is duplicated across should_run and make_run. It seems likely this can be abstracted away into builder somehow.
2018-02-10fix typos in src/{bootstrap,ci,etc,lib{backtrace,core,fmt_macros}}Matthias Krüger-1/+1
2018-02-08Convert python script to rustGuillaume Gomez-11/+8
2018-02-08Pass themes folder as parameterGuillaume Gomez-1/+3
2018-02-08Add tests for themesGuillaume Gomez-0/+42
2018-02-04Run the `run-make` tests last, so more tests run on Windows when `make` is ↵John Kåre Alsaker-1/+1
unavailable
2018-01-30Add wasm_syscall feature to build systemDiggory Blake-0/+8
2018-01-27rustc: Load the `rustc_trans` crate at runtimeAlex Crichton-1/+3
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-23Rename check.rs to test.rsMark Simulacrum-0/+1542