@@ -26,7 +26,7 @@ use extra::getopts::groups::getopts;
26
26
use std:: run:: ProcessOutput ;
27
27
use installed_packages:: list_installed_packages;
28
28
use crate_id:: { CrateId } ;
29
- use version:: { ExactRevision , NoVersion , Version , Tagged } ;
29
+ use version:: { ExactRevision , NoVersion , Version } ;
30
30
use path_util:: { target_executable_in_workspace, target_test_in_workspace,
31
31
target_bench_in_workspace, make_dir_rwx,
32
32
library_in_workspace, installed_library_in_workspace,
@@ -35,7 +35,6 @@ use path_util::{target_executable_in_workspace, target_test_in_workspace,
35
35
chmod_read_only, platform_library_name} ;
36
36
use rustc:: back:: link:: get_cc_prog;
37
37
use rustc:: metadata:: filesearch:: { rust_path, libdir, rustlibdir} ;
38
- use rustc:: driver:: session;
39
38
use rustc:: driver:: driver:: { build_session, build_session_options, host_triple, optgroups} ;
40
39
use syntax:: diagnostic;
41
40
use target:: * ;
@@ -76,14 +75,6 @@ fn git_repo_pkg() -> CrateId {
76
75
}
77
76
}
78
77
79
- fn git_repo_pkg_with_tag ( a_tag : ~str ) -> CrateId {
80
- CrateId {
81
- path : Path :: new ( "mockgithub.com/catamorphism/test-pkg" ) ,
82
- short_name : ~"test-pkg",
83
- version : Tagged ( a_tag)
84
- }
85
- }
86
-
87
78
fn writeFile ( file_path : & Path , contents : & str ) {
88
79
let mut out = File :: create ( file_path) ;
89
80
out. write ( contents. as_bytes ( ) ) ;
@@ -487,12 +478,6 @@ fn lib_output_file_name(workspace: &Path, short_name: &str) -> Path {
487
478
& NoVersion ) . expect ( "lib_output_file_name" )
488
479
}
489
480
490
- fn output_file_name ( workspace : & Path , short_name : ~str ) -> Path {
491
- target_build_dir ( workspace) . join ( short_name. as_slice ( ) )
492
- . join ( format ! ( "{}{}" , short_name,
493
- os:: consts:: EXE_SUFFIX ) )
494
- }
495
-
496
481
#[ cfg( target_os = "linux" ) ]
497
482
fn touch_source_file ( workspace : & Path , crateid : & CrateId ) {
498
483
use conditions:: bad_path:: cond;
@@ -746,8 +731,8 @@ fn test_crate_ids_must_be_relative_path_like() {
746
731
CrateId::new(" github. com/catamorphism/test-pkg").to_str());
747
732
748
733
cond.trap(|(p, e)| {
749
- assert!(p.filename().is_none())
750
- assert!(" 0 -length crate_id " == e);
734
+ assert!(p.filename().is_none());
735
+ assert!(" bad crateid " == e);
751
736
whatever.clone()
752
737
}).inside(|| {
753
738
let x = CrateId::new(" ");
@@ -757,7 +742,7 @@ fn test_crate_ids_must_be_relative_path_like() {
757
742
cond.trap(|(p, e)| {
758
743
let abs = os::make_absolute(&Path::new(" foo/bar/quux"));
759
744
assert_eq!(p, abs);
760
- assert!(" absolute crate_id " == e);
745
+ assert!(" bad crateid " == e);
761
746
whatever.clone()
762
747
}).inside(|| {
763
748
let zp = os::make_absolute(&Path::new(" foo/bar/quux"));
@@ -1894,9 +1879,11 @@ fn crateid_pointing_to_subdir() {
1894
1879
fs:: mkdir_recursive ( & foo_dir, io:: UserRWX ) ;
1895
1880
fs:: mkdir_recursive ( & bar_dir, io:: UserRWX ) ;
1896
1881
writeFile ( & foo_dir. join ( "lib.rs" ) ,
1897
- "#[crate_id=\" mockgithub.com/mozilla/some_repo/extras/foo\" ]; pub fn f() {}" ) ;
1882
+ "#[crate_id=\" mockgithub.com/mozilla/some_repo/extras/rust-foo#foo:0.0\" ];" +
1883
+ "pub fn f() {}" ) ;
1898
1884
writeFile ( & bar_dir. join ( "lib.rs" ) ,
1899
- "#[crate_id=\" mockgithub.com/mozilla/some_repo/extras/bar\" ]; pub fn g() {}" ) ;
1885
+ "#[crate_id=\" mockgithub.com/mozilla/some_repo/extras/rust-bar#bar:0.0\" ];" +
1886
+ "pub fn g() {}" ) ;
1900
1887
1901
1888
debug ! ( "Creating a file in {}" , workspace. display( ) ) ;
1902
1889
let testpkg_dir = workspace. join_many ( [ "src" , "testpkg-0.0" ] ) ;
@@ -2318,7 +2305,7 @@ fn find_sources_in_cwd() {
2318
2305
let source_dir = temp_dir.join(" foo");
2319
2306
fs::mkdir_recursive(&source_dir, io::UserRWX);
2320
2307
writeFile(&source_dir.join(" main. rs"),
2321
- r#" #[ crate_id="foo" ] ; fn main( ) { let _x = ( ) ; } "#);
2308
+ r#" #[ crate_id="rust- foo#foo:0.0 " ] ; fn main( ) { let _x = ( ) ; } "#);
2322
2309
command_line_test([~" install", ~" foo"], &source_dir);
2323
2310
assert_executable_exists(&source_dir.join(" . rust"), " foo");
2324
2311
}
0 commit comments