Skip to content

Commit e78d647

Browse files
committed
auto merge of #81 : alexcrichton/cargo/fix-windows, r=wycats
2 parents fb1988a + e742a90 commit e78d647

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

tests/support/mod.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ use ham = hamcrest;
1212
use cargo::util::{process,ProcessBuilder};
1313
use cargo::util::ProcessError;
1414

15+
use support::paths::PathExt;
16+
1517
pub mod paths;
1618

1719
/*
@@ -107,7 +109,7 @@ impl ProjectBuilder {
107109
try!(mkdir_recursive(&self.root));
108110

109111
for file in self.files.iter() {
110-
try!(file.mk());
112+
try!(file.mk());
111113
}
112114

113115
Ok(())
@@ -116,8 +118,7 @@ impl ProjectBuilder {
116118
fn rm_root(&self) -> Result<(), String> {
117119
if self.root.exists() {
118120
rmdir_recursive(&self.root)
119-
}
120-
else {
121+
} else {
121122
Ok(())
122123
}
123124
}
@@ -137,7 +138,7 @@ pub fn mkdir_recursive(path: &Path) -> Result<(), String> {
137138
}
138139

139140
pub fn rmdir_recursive(path: &Path) -> Result<(), String> {
140-
fs::rmdir_recursive(path)
141+
path.rm_rf()
141142
.with_err_msg(format!("could not rm directory; path={}",
142143
path.display()))
143144
}

tests/test_cargo_test.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use support::{project, execs, basic_bin_manifest, COMPILING};
1+
use support::{project, execs, basic_bin_manifest, COMPILING, cargo_dir};
22
use hamcrest::{assert_that, existing_file};
33
use cargo::util::process;
44

@@ -28,13 +28,13 @@ test!(cargo_test_simple {
2828
process(p.bin("foo")),
2929
execs().with_stdout("hello\n"));
3030

31-
assert_that(p.cargo_process("cargo-test"),
31+
assert_that(p.process(cargo_dir().join("cargo-test")),
3232
execs().with_stdout(format!("{} foo v0.5.0 (file:{})\n\n\
3333
running 1 test\n\
3434
test test_hello ... ok\n\n\
3535
test result: ok. 1 passed; 0 failed; \
3636
0 ignored; 0 measured\n\n",
3737
COMPILING, p.root().display())));
38-
38+
3939
assert_that(&p.bin("tests/foo"), existing_file());
4040
})

0 commit comments

Comments
 (0)