Fix test fallout from removing vecs_implicitly_copyable

This commit is contained in:
Alex Crichton 2013-05-12 16:50:57 -04:00
parent 5614e83e81
commit ffcc680f9c
14 changed files with 52 additions and 62 deletions

View file

@ -41,6 +41,7 @@ use context::Ctx;
mod conditions;
mod context;
mod path_util;
#[cfg(test)]
mod tests;
mod util;
mod workspace;

View file

@ -77,7 +77,6 @@ fn is_rwx(p: &Path) -> bool {
}
}
#[cfg(test)]
fn test_sysroot() -> Path {
// Totally gross hack but it's just for test cases.
// Infer the sysroot from the exe name and tack "stage2"
@ -107,19 +106,19 @@ fn test_install_valid() {
let temp_pkg_id = fake_pkg();
let temp_workspace = mk_temp_workspace(&temp_pkg_id.path);
// should have test, bench, lib, and main
ctxt.install(&temp_workspace, temp_pkg_id);
ctxt.install(&temp_workspace, &temp_pkg_id);
// Check that all files exist
let exec = target_executable_in_workspace(temp_pkg_id, &temp_workspace);
let exec = target_executable_in_workspace(&temp_pkg_id, &temp_workspace);
debug!("exec = %s", exec.to_str());
assert!(os::path_exists(&exec));
assert!(is_rwx(&exec));
let lib = target_library_in_workspace(temp_pkg_id, &temp_workspace);
let lib = target_library_in_workspace(&temp_pkg_id, &temp_workspace);
debug!("lib = %s", lib.to_str());
assert!(os::path_exists(&lib));
assert!(is_rwx(&lib));
// And that the test and bench executables aren't installed
assert!(!os::path_exists(&target_test_in_workspace(temp_pkg_id, &temp_workspace)));
let bench = target_bench_in_workspace(temp_pkg_id, &temp_workspace);
assert!(!os::path_exists(&target_test_in_workspace(&temp_pkg_id, &temp_workspace)));
let bench = target_bench_in_workspace(&temp_pkg_id, &temp_workspace);
debug!("bench = %s", bench.to_str());
assert!(!os::path_exists(&bench));
}
@ -140,7 +139,7 @@ fn test_install_invalid() {
do cond.trap(|_| {
error_occurred = true;
}).in {
ctxt.install(&temp_workspace, pkgid);
ctxt.install(&temp_workspace, &pkgid);
}
}
assert!(error_occurred && error1_occurred);
@ -155,19 +154,19 @@ fn test_install_url() {
let temp_pkg_id = remote_pkg();
let temp_workspace = mk_temp_workspace(&temp_pkg_id.path);
// should have test, bench, lib, and main
ctxt.install(&temp_workspace, temp_pkg_id);
ctxt.install(&temp_workspace, &temp_pkg_id);
// Check that all files exist
let exec = target_executable_in_workspace(temp_pkg_id, &temp_workspace);
let exec = target_executable_in_workspace(&temp_pkg_id, &temp_workspace);
debug!("exec = %s", exec.to_str());
assert!(os::path_exists(&exec));
assert!(is_rwx(&exec));
let lib = target_library_in_workspace(temp_pkg_id, &temp_workspace);
let lib = target_library_in_workspace(&temp_pkg_id, &temp_workspace);
debug!("lib = %s", lib.to_str());
assert!(os::path_exists(&lib));
assert!(is_rwx(&lib));
// And that the test and bench executables aren't installed
assert!(!os::path_exists(&target_test_in_workspace(temp_pkg_id, &temp_workspace)));
let bench = target_bench_in_workspace(temp_pkg_id, &temp_workspace);
assert!(!os::path_exists(&target_test_in_workspace(&temp_pkg_id, &temp_workspace)));
let bench = target_bench_in_workspace(&temp_pkg_id, &temp_workspace);
debug!("bench = %s", bench.to_str());
assert!(!os::path_exists(&bench));
}
}

View file

@ -23,7 +23,7 @@ use syntax::codemap::{dummy_sp, spanned, dummy_spanned};
use syntax::ext::base::{mk_ctxt, ext_ctxt};
use syntax::ext::build;
use syntax::{ast, attr, codemap, diagnostic, fold};
use syntax::ast::{meta_name_value, meta_list, attribute, crate_};
use syntax::ast::{meta_name_value, meta_list, attribute};
use syntax::attr::{mk_attr};
use rustc::back::link::output_type_exe;
use rustc::driver::session::{lib_crate, unknown_crate, crate_type};