Skip to content

rustpkg: Add a test that rustpkg install doesn't copy a non-changed file #10371

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

Merged
merged 1 commit into from
Nov 9, 2013
Merged
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
18 changes: 18 additions & 0 deletions src/librustpkg/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1096,6 +1096,24 @@ fn no_rebuilding() {
}
}

#[test]
fn no_recopying() {
let p_id = PkgId::new("foo");
let workspace = create_local_package(&p_id);
let workspace = workspace.path();
command_line_test([~"install", ~"foo"], workspace);
let foo_lib = installed_library_in_workspace(&p_id.path, workspace);
assert!(foo_lib.is_some());
// Now make `foo` read-only so that subsequent attempts to copy to it will fail
assert!(chmod_read_only(&foo_lib.unwrap()));

match command_line_test_partial([~"install", ~"foo"], workspace) {
Success(*) => (), // ok
Fail(65) => fail!("no_recopying failed: it tried to re-copy foo"),
Fail(_) => fail!("no_copying failed for some other reason")
}
}

#[test]
fn no_rebuilding_dep() {
let p_id = PkgId::new("foo");
Expand Down