mirror of
https://github.com/servo/servo.git
synced 2025-08-12 08:55:32 +01:00
Make mach test-unit
not recompile components after mach build
Previously, the `tests` feature flag of the `embedder_traits` crate caused it and every crate recursively depending on it to be built twice. This feature flag was used to provide a specific set of "resources" when running tests. Instead, this commits overrides the `main()` function of the test harness to change resources at runtime before running any test. This is done by adding a dependency that has `name = "test"` in its `[lib]` section of `Cargo.toml`. This overrides the crate found by `extern crate test;` in code generated by `rustc --test`.
This commit is contained in:
parent
76ddbe4d7a
commit
1f7ebfc8a2
17 changed files with 50 additions and 42 deletions
13
components/std_test_override/Cargo.toml
Normal file
13
components/std_test_override/Cargo.toml
Normal file
|
@ -0,0 +1,13 @@
|
|||
[package]
|
||||
name = "std_test_override"
|
||||
version = "0.0.1"
|
||||
authors = ["The Servo Project Developers"]
|
||||
license = "MPL-2.0"
|
||||
publish = false
|
||||
|
||||
[lib]
|
||||
name = "test"
|
||||
path = "lib.rs"
|
||||
|
||||
[dependencies]
|
||||
embedder_traits = { path = "../embedder_traits" }
|
Loading…
Add table
Add a link
Reference in a new issue