Auto merge of #16935 - servo:out-of-crate-bindings-tests, r=emilio

Move bindings tests out of the style crate

This cuts in almost half the time to run:

```
touch components/style/lib.rs
./mach test-stylo
```

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16935)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-05-19 03:48:14 -05:00 committed by GitHub
commit a01ab9ad34
13 changed files with 37 additions and 41 deletions

View file

@ -7,6 +7,9 @@ publish = false
build = "build.rs"
# https://github.com/rust-lang/cargo/issues/3544
links = "for some reason the links key is required to pass data around between build scripts"
[lib]
name = "style"
path = "lib.rs"

View file

@ -85,6 +85,7 @@ fn generate_properties() {
fn main() {
println!("cargo:rerun-if-changed=build.rs");
println!("cargo:out_dir={}", env::var("OUT_DIR").unwrap());
generate_properties();
build_gecko::generate();
}

View file

@ -61,7 +61,7 @@ extern crate log;
extern crate matches;
#[cfg(feature = "gecko")]
#[macro_use]
extern crate nsstring_vendor as nsstring;
pub extern crate nsstring_vendor as nsstring;
#[cfg(feature = "gecko")] extern crate num_cpus;
extern crate num_integer;
extern crate num_traits;

View file

@ -2802,30 +2802,6 @@ macro_rules! longhand_properties_idents {
}
}
/// Testing function to check the size of a PropertyDeclaration. We implement
/// this here so that the code can be used by both servo and stylo unit tests.
/// This is important because structs can have different sizes in stylo and
/// servo.
#[cfg(feature = "testing")]
pub fn test_size_of_property_declaration() {
use std::mem::size_of;
let old = 32;
let new = size_of::<PropertyDeclaration>();
if new < old {
panic!("Your changes have decreased the stack size of PropertyDeclaration enum from {} to {}. \
Good work! Please update the size in components/style/properties/properties.mako.rs.",
old, new)
} else if new > old {
panic!("Your changes have increased the stack size of PropertyDeclaration enum from {} to {}. \
These enum is present in large quantities in the style, and increasing the size \
may negatively affect style system performance. Please consider using `boxed=\"True\"` in \
the longhand If you feel that the increase is necessary, update to the new size in \
components/style/properties/properties.mako.rs.",
old, new)
}
}
/// Testing function to check the size of all SpecifiedValues.
#[cfg(feature = "testing")]
pub fn test_size_of_specified_values() {