aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbors-servo <metajack+bors@gmail.com>2015-03-12 20:48:47 -0600
committerbors-servo <metajack+bors@gmail.com>2015-03-12 20:48:47 -0600
commit5f439e7eaa02245f64d5041d3d4e6dec51dfb993 (patch)
tree66081cafd044923b1da0a89c8352146b6c14b345
parent1a9679857a324f08337215bddad16f4667770997 (diff)
parent6208eaa628cff0998869e205760a1eb32761988b (diff)
downloadservo-5f439e7eaa02245f64d5041d3d4e6dec51dfb993.tar.gz
servo-5f439e7eaa02245f64d5041d3d4e6dec51dfb993.zip
auto merge of #5204 : ehegnes/servo/squelch_contenttest, r=jdm
This actually fixes 5159.
-rw-r--r--tests/contenttest.rs13
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/contenttest.rs b/tests/contenttest.rs
index 9fba495834b..c8175311304 100644
--- a/tests/contenttest.rs
+++ b/tests/contenttest.rs
@@ -7,7 +7,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![feature(collections, core, io, os, path, rustc_private, std_misc, test)]
+#![feature(collections, core, env, io, os, path, rustc_private, std_misc, test)]
extern crate getopts;
extern crate test;
@@ -15,7 +15,7 @@ extern crate test;
use test::{AutoColor, TestOpts, run_tests_console, TestDesc, TestDescAndFn, DynTestFn, DynTestName};
use test::ShouldFail;
use getopts::{getopts, reqopt};
-use std::{os, str, env};
+use std::{str, env};
use std::old_io::fs;
use std::old_io::Reader;
use std::old_io::process::{Command, Ignored, CreatePipe, InheritFd, ExitStatus};
@@ -88,14 +88,19 @@ fn make_test(file: String) -> TestDescAndFn {
}
fn run_test(file: String) {
- let path = os::make_absolute(&Path::new(file)).unwrap();
+ let path = env::current_dir().unwrap().join(&file);
// FIXME (#1094): not the right way to transform a path
let infile = format!("file://{}", path.display());
let stdout = CreatePipe(false, true);
let stderr = InheritFd(2);
let args = ["-z", "-f", infile.as_slice()];
- let mut prc = match Command::new(os::self_exe_path().unwrap().join("servo"))
+ let mut prc_arg = env::current_exe().unwrap();
+ let prc_arg = match prc_arg.pop() {
+ true => prc_arg.join("servo"),
+ _ => panic!("could not pop directory"),
+ };
+ let mut prc = match Command::new(prc_arg)
.args(args.as_slice())
.stdin(Ignored)
.stdout(stdout)