Skip to content

Use a custom rm_rf to paper over windows git funkiness #81

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions tests/support/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ use ham = hamcrest;
use cargo::util::{process,ProcessBuilder};
use cargo::util::ProcessError;

use support::paths::PathExt;

pub mod paths;

/*
Expand Down Expand Up @@ -107,7 +109,7 @@ impl ProjectBuilder {
try!(mkdir_recursive(&self.root));

for file in self.files.iter() {
try!(file.mk());
try!(file.mk());
}

Ok(())
Expand All @@ -116,8 +118,7 @@ impl ProjectBuilder {
fn rm_root(&self) -> Result<(), String> {
if self.root.exists() {
rmdir_recursive(&self.root)
}
else {
} else {
Ok(())
}
}
Expand All @@ -137,7 +138,7 @@ pub fn mkdir_recursive(path: &Path) -> Result<(), String> {
}

pub fn rmdir_recursive(path: &Path) -> Result<(), String> {
fs::rmdir_recursive(path)
path.rm_rf()
.with_err_msg(format!("could not rm directory; path={}",
path.display()))
}
Expand Down
6 changes: 3 additions & 3 deletions tests/test_cargo_test.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use support::{project, execs, basic_bin_manifest, COMPILING};
use support::{project, execs, basic_bin_manifest, COMPILING, cargo_dir};
use hamcrest::{assert_that, existing_file};
use cargo::util::process;

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

assert_that(p.cargo_process("cargo-test"),
assert_that(p.process(cargo_dir().join("cargo-test")),
execs().with_stdout(format!("{} foo v0.5.0 (file:{})\n\n\
running 1 test\n\
test test_hello ... ok\n\n\
test result: ok. 1 passed; 0 failed; \
0 ignored; 0 measured\n\n",
COMPILING, p.root().display())));

assert_that(&p.bin("tests/foo"), existing_file());
})