Skip to content

Commit 6045c7f

Browse files
committed
---
yaml --- r: 114170 b: refs/heads/master c: b7676f2 h: refs/heads/master v: v3
1 parent 962107c commit 6045c7f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+1790
-4528
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: ba5f53009aab826d8bb8fa97f3213b2fee803e29
2+
refs/heads/master: b7676f2df5e1ff97e0baa3f7e70936d4bd4dacb5
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: ec0258a381b88b5574e3f8ce72ae553ac3a574b7
55
refs/heads/try: 7c6c492fb2af9a85f21ff952942df3523b22fd17

trunk/mk/crates.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ DEPS_collections := std rand
8080
DEPS_fourcc := syntax std
8181
DEPS_hexfloat := syntax std
8282
DEPS_num := std rand
83-
DEPS_test := std collections getopts serialize term time regex
83+
DEPS_test := std collections getopts serialize term time
8484
DEPS_time := std serialize
8585
DEPS_rand := std
8686
DEPS_url := std collections

trunk/src/compiletest/common.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
use std::from_str::FromStr;
1212
use std::fmt;
13-
use regex::Regex;
1413

1514
#[deriving(Clone, Eq)]
1615
pub enum Mode {
@@ -89,7 +88,7 @@ pub struct Config {
8988
pub run_ignored: bool,
9089

9190
// Only run tests that match this filter
92-
pub filter: Option<Regex>,
91+
pub filter: Option<~str>,
9392

9493
// Write out a parseable log of tests that were run
9594
pub logfile: Option<Path>,

trunk/src/compiletest/compiletest.rs

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ extern crate log;
2323
extern crate green;
2424
extern crate rustuv;
2525

26-
extern crate regex;
27-
2826
use std::os;
2927
use std::io;
3028
use std::io::fs;
@@ -115,19 +113,6 @@ pub fn parse_config(args: Vec<~str> ) -> Config {
115113
Path::new(m.opt_str(nm).unwrap())
116114
}
117115

118-
let filter = if !matches.free.is_empty() {
119-
let s = matches.free.get(0).as_slice();
120-
match regex::Regex::new(s) {
121-
Ok(re) => Some(re),
122-
Err(e) => {
123-
println!("failed to parse filter /{}/: {}", s, e);
124-
fail!()
125-
}
126-
}
127-
} else {
128-
None
129-
};
130-
131116
Config {
132117
compile_lib_path: matches.opt_str("compile-lib-path").unwrap(),
133118
run_lib_path: matches.opt_str("run-lib-path").unwrap(),
@@ -140,7 +125,12 @@ pub fn parse_config(args: Vec<~str> ) -> Config {
140125
stage_id: matches.opt_str("stage-id").unwrap(),
141126
mode: FromStr::from_str(matches.opt_str("mode").unwrap()).expect("invalid mode"),
142127
run_ignored: matches.opt_present("ignored"),
143-
filter: filter,
128+
filter:
129+
if !matches.free.is_empty() {
130+
Some((*matches.free.get(0)).clone())
131+
} else {
132+
None
133+
},
144134
logfile: matches.opt_str("logfile").map(|s| Path::new(s)),
145135
save_metrics: matches.opt_str("save-metrics").map(|s| Path::new(s)),
146136
ratchet_metrics:
@@ -179,7 +169,7 @@ pub fn log_config(config: &Config) {
179169
logv(c, format!("stage_id: {}", config.stage_id));
180170
logv(c, format!("mode: {}", config.mode));
181171
logv(c, format!("run_ignored: {}", config.run_ignored));
182-
logv(c, format!("filter: {}", opt_str(&config.filter.as_ref().map(|re| re.to_str()))));
172+
logv(c, format!("filter: {}", opt_str(&config.filter)));
183173
logv(c, format!("runtool: {}", opt_str(&config.runtool)));
184174
logv(c, format!("host-rustcflags: {}", opt_str(&config.host_rustcflags)));
185175
logv(c, format!("target-rustcflags: {}", opt_str(&config.target_rustcflags)));
@@ -248,7 +238,7 @@ pub fn test_opts(config: &Config) -> test::TestOpts {
248238
test::TestOpts {
249239
filter: match config.filter {
250240
None => None,
251-
Some(ref filter) => Some(filter.clone()),
241+
Some(ref filter) => Some(filter.to_strbuf()),
252242
},
253243
run_ignored: config.run_ignored,
254244
logfile: config.logfile.clone(),

trunk/src/compiletest/procsrv.rs

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
use std::os;
1212
use std::str;
13-
use std::io::process::{ProcessExit, Command, Process, ProcessOutput};
13+
use std::io::process::{ProcessExit, Process, ProcessConfig, ProcessOutput};
1414

1515
#[cfg(target_os = "win32")]
1616
fn target_env(lib_path: &str, prog: &str) -> Vec<(~str, ~str)> {
@@ -68,7 +68,14 @@ pub fn run(lib_path: &str,
6868
input: Option<~str>) -> Option<Result> {
6969

7070
let env = env.clone().append(target_env(lib_path, prog).as_slice());
71-
match Command::new(prog).args(args).env(env.as_slice()).spawn() {
71+
let opt_process = Process::configure(ProcessConfig {
72+
program: prog,
73+
args: args,
74+
env: Some(env.as_slice()),
75+
.. ProcessConfig::new()
76+
});
77+
78+
match opt_process {
7279
Ok(mut process) => {
7380
for input in input.iter() {
7481
process.stdin.get_mut_ref().write(input.as_bytes()).unwrap();
@@ -93,7 +100,14 @@ pub fn run_background(lib_path: &str,
93100
input: Option<~str>) -> Option<Process> {
94101

95102
let env = env.clone().append(target_env(lib_path, prog).as_slice());
96-
match Command::new(prog).args(args).env(env.as_slice()).spawn() {
103+
let opt_process = Process::configure(ProcessConfig {
104+
program: prog,
105+
args: args,
106+
env: Some(env.as_slice()),
107+
.. ProcessConfig::new()
108+
});
109+
110+
match opt_process {
97111
Ok(mut process) => {
98112
for input in input.iter() {
99113
process.stdin.get_mut_ref().write(input.as_bytes()).unwrap();

trunk/src/compiletest/runtest.rs

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
420420
}
421421

422422
fn run_debuginfo_lldb_test(config: &Config, props: &TestProps, testfile: &Path) {
423-
use std::io::process::{Command, ProcessOutput};
423+
use std::io::process::{Process, ProcessConfig, ProcessOutput};
424424

425425
if config.lldb_python_dir.is_none() {
426426
fatal("Can't run LLDB test because LLDB's python path is not set.".to_owned());
@@ -483,13 +483,25 @@ fn run_debuginfo_lldb_test(config: &Config, props: &TestProps, testfile: &Path)
483483

484484
fn run_lldb(config: &Config, test_executable: &Path, debugger_script: &Path) -> ProcRes {
485485
// Prepare the lldb_batchmode which executes the debugger script
486-
let mut cmd = Command::new("python");
487-
cmd.arg("./src/etc/lldb_batchmode.py")
488-
.arg(test_executable)
489-
.arg(debugger_script)
490-
.env([("PYTHONPATH", config.lldb_python_dir.clone().unwrap().as_slice())]);
491-
492-
let (status, out, err) = match cmd.spawn() {
486+
let lldb_batchmode_script = "./src/etc/lldb_batchmode.py".to_owned();
487+
let test_executable_str = test_executable.as_str().unwrap().to_owned();
488+
let debugger_script_str = debugger_script.as_str().unwrap().to_owned();
489+
let commandline = format!("python {} {} {}",
490+
lldb_batchmode_script.as_slice(),
491+
test_executable_str.as_slice(),
492+
debugger_script_str.as_slice());
493+
494+
let args = &[lldb_batchmode_script, test_executable_str, debugger_script_str];
495+
let env = &[("PYTHONPATH".to_owned(), config.lldb_python_dir.clone().unwrap())];
496+
497+
let opt_process = Process::configure(ProcessConfig {
498+
program: "python",
499+
args: args,
500+
env: Some(env),
501+
.. ProcessConfig::new()
502+
});
503+
504+
let (status, out, err) = match opt_process {
493505
Ok(process) => {
494506
let ProcessOutput { status, output, error } =
495507
process.wait_with_output().unwrap();
@@ -508,7 +520,7 @@ fn run_debuginfo_lldb_test(config: &Config, props: &TestProps, testfile: &Path)
508520
status: status,
509521
stdout: out,
510522
stderr: err,
511-
cmdline: format!("{}", cmd)
523+
cmdline: commandline
512524
};
513525
}
514526
}

trunk/src/doc/guide-testing.md

Lines changed: 7 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,10 @@ fn test_out_of_bounds_failure() {
9090
~~~
9191

9292
A test runner built with the `--test` flag supports a limited set of
93-
arguments to control which tests are run:
94-
95-
- the first free argument passed to a test runner is interpreted as a
96-
regular expression
97-
([syntax reference](regex/index.html#syntax))
98-
and is used to narrow down the set of tests being run. Note: a plain
99-
string is a valid regular expression that matches itself.
100-
- the `--ignored` flag tells the test runner to run only tests with the
101-
`ignore` attribute.
93+
arguments to control which tests are run: the first free argument
94+
passed to a test runner specifies a filter used to narrow down the set
95+
of tests being run; the `--ignored` flag tells the test runner to run
96+
only tests with the `ignore` attribute.
10297

10398
## Parallelism
10499

@@ -151,31 +146,16 @@ result: FAILED. 1 passed; 1 failed; 0 ignored
151146

152147
### Running a subset of tests
153148

154-
Using a plain string:
155-
156-
~~~ {.notrust}
157-
$ mytests mytest23
158-
159-
running 1 tests
160-
running driver::tests::mytest23 ... ok
161-
162-
result: ok. 1 passed; 0 failed; 0 ignored
163-
~~~
164-
165-
Using some regular expression features:
166-
167149
~~~ {.notrust}
168-
$ mytests 'mytest[145]'
150+
$ mytests mytest1
169151
170-
running 13 tests
152+
running 11 tests
171153
running driver::tests::mytest1 ... ok
172-
running driver::tests::mytest4 ... ok
173-
running driver::tests::mytest5 ... ok
174154
running driver::tests::mytest10 ... ignored
175155
... snip ...
176156
running driver::tests::mytest19 ... ok
177157
178-
result: ok. 13 passed; 0 failed; 1 ignored
158+
result: ok. 11 passed; 0 failed; 1 ignored
179159
~~~
180160

181161
# Microbenchmarking

trunk/src/libnative/io/mod.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,13 @@ use std::c_str::CString;
2727
use std::io;
2828
use std::io::IoError;
2929
use std::io::net::ip::SocketAddr;
30+
use std::io::process::ProcessConfig;
3031
use std::io::signal::Signum;
3132
use std::os;
3233
use std::rt::rtio;
3334
use std::rt::rtio::{RtioTcpStream, RtioTcpListener, RtioUdpSocket};
3435
use std::rt::rtio::{RtioUnixListener, RtioPipe, RtioFileStream, RtioProcess};
35-
use std::rt::rtio::{RtioSignal, RtioTTY, CloseBehavior, RtioTimer, ProcessConfig};
36+
use std::rt::rtio::{RtioSignal, RtioTTY, CloseBehavior, RtioTimer};
3637
use ai = std::io::net::addrinfo;
3738

3839
// Local re-exports
@@ -257,10 +258,10 @@ impl rtio::IoFactory for IoFactory {
257258
fn timer_init(&mut self) -> IoResult<Box<RtioTimer:Send>> {
258259
timer::Timer::new().map(|t| box t as Box<RtioTimer:Send>)
259260
}
260-
fn spawn(&mut self, cfg: ProcessConfig)
261+
fn spawn(&mut self, config: ProcessConfig)
261262
-> IoResult<(Box<RtioProcess:Send>,
262263
Vec<Option<Box<RtioPipe:Send>>>)> {
263-
process::Process::spawn(cfg).map(|(p, io)| {
264+
process::Process::spawn(config).map(|(p, io)| {
264265
(box p as Box<RtioProcess:Send>,
265266
io.move_iter().map(|p| p.map(|p| {
266267
box p as Box<RtioPipe:Send>

0 commit comments

Comments
 (0)