Auto merge of #19527 - servo:root, r=SimonSapin

Fix running `cargo test` at the repository root

<!-- 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/19527)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-12-08 12:30:03 -06:00 committed by GitHub
commit 8a8c06ac7b

View file

@ -10,7 +10,7 @@ use std::process::Command;
#[test]
fn properties_list_json() {
let top = Path::new(file!()).parent().unwrap().join("..").join("..").join("..").join("..");
let top = Path::new(&env::var("CARGO_MANIFEST_DIR").unwrap()).join("..").join("..").join("..");
let json = top.join("target").join("doc").join("servo").join("css-properties.json");
if json.exists() {
remove_file(&json).unwrap()
@ -24,7 +24,7 @@ fn properties_list_json() {
.arg("regular")
.status()
.unwrap();
assert!(status.success());
assert!(status.success(), "{:?}", status);
let properties: Value = serde_json::from_reader(File::open(json).unwrap()).unwrap();
assert!(properties.as_object().unwrap().len() > 100);