diff options
author | Eric Hegnes <eric.hegnes@gmail.com> | 2015-03-08 01:34:02 -0500 |
---|---|---|
committer | Eric Hegnes <eric.hegnes@gmail.com> | 2015-03-08 01:37:48 -0500 |
commit | 20cb2c395d7af1dc60401878368ce09a0966119d (patch) | |
tree | dd06c5d010d88a66167e5060af4304ce61cf72b2 | |
parent | da880af7428e3b76a9a5e7d3a5ff2c80a32d63f0 (diff) | |
download | servo-20cb2c395d7af1dc60401878368ce09a0966119d.tar.gz servo-20cb2c395d7af1dc60401878368ce09a0966119d.zip |
Fixes #5159
Fix warnings and introduce usage of `std::env` over deprecated `std::os`
functions.
-rw-r--r-- | tests/contenttest.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/contenttest.rs b/tests/contenttest.rs index 7c79401e27a..9fba495834b 100644 --- a/tests/contenttest.rs +++ b/tests/contenttest.rs @@ -7,13 +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)] + 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}; +use std::{os, str, env}; use std::old_io::fs; use std::old_io::Reader; use std::old_io::process::{Command, Ignored, CreatePipe, InheritFd, ExitStatus}; @@ -27,13 +29,13 @@ struct Config { } fn main() { - let args = os::args(); - let config = parse_config(args.into_iter().collect()); + let args = env::args(); + let config = parse_config(args.map(|x| x.into_string().unwrap()).collect()); let opts = test_options(config.clone()); let tests = find_tests(config); match run_tests_console(&opts, tests) { - Ok(false) => os::set_exit_status(1), // tests failed - Err(_) => os::set_exit_status(2), // I/O-related failure + Ok(false) => env::set_exit_status(1), // tests failed + Err(_) => env::set_exit_status(2), // I/O-related failure _ => (), } } |