Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Further squelch warnings from contenttest.rs #5204

Merged
merged 1 commit into from Mar 13, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 9 additions & 4 deletions tests/contenttest.rs
Expand Up @@ -7,15 +7,15 @@
// 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;

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};
Expand Down Expand Up @@ -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)
Expand Down