mirror of
https://github.com/servo/servo.git
synced 2025-06-09 00:53:26 +00:00
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`.
15 lines
431 B
Rust
15 lines
431 B
Rust
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
#![feature(test)]
|
|
|
|
extern crate embedder_traits;
|
|
extern crate test;
|
|
|
|
pub use test::*;
|
|
|
|
pub fn test_main_static(tests: &[&TestDescAndFn]) {
|
|
embedder_traits::resources::set_for_tests();
|
|
test::test_main_static(tests);
|
|
}
|