Auto merge of #18521 - servo:cargotest, r=nox

Fix running `cargo test -p stylo_test` from repo root

… in order to add it to Rust CI though https://github.com/rust-lang/rust/blob/master/src/tools/cargotest/main.rs

<!-- 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/18521)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-09-15 09:43:08 -05:00 committed by GitHub
commit f1da967ef7

View file

@ -550,7 +550,8 @@ mod bindings {
}
fn generate_atoms() {
let script = Path::new(file!()).parent().unwrap().join("gecko").join("regen_atoms.py");
let script = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap())
.join("gecko").join("regen_atoms.py");
println!("cargo:rerun-if-changed={}", script.display());
let status = Command::new(&*PYTHON)
.arg(&script)
@ -596,11 +597,12 @@ mod bindings {
#[cfg(not(feature = "bindgen"))]
mod bindings {
use std::path::Path;
use std::env;
use std::path::PathBuf;
use super::common::*;
pub fn generate() {
let dir = Path::new(file!()).parent().unwrap().join("gecko/generated");
let dir = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap()).join("gecko/generated");
println!("cargo:rerun-if-changed={}", dir.display());
copy_dir(&dir, &*OUTDIR_PATH, |path| {
println!("cargo:rerun-if-changed={}", path.display());