From 5034d1d7774eda6f8f3f9064d828b5b7c4c9f264 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Fri, 8 Dec 2017 19:21:45 +0100 Subject: [PATCH] Fix running `cargo test` at the repository root --- tests/unit/style/properties/scaffolding.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/style/properties/scaffolding.rs b/tests/unit/style/properties/scaffolding.rs index b752937ad93..faa727ff613 100644 --- a/tests/unit/style/properties/scaffolding.rs +++ b/tests/unit/style/properties/scaffolding.rs @@ -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);