Skip to content

Commit 812637e

Browse files
committed
test: Fix tests for crate_id removal
This involved removing some tests whose functionality was removed such as many of the crateresolve tests
1 parent cc3c8bb commit 812637e

File tree

47 files changed

+144
-311
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+144
-311
lines changed

src/test/auxiliary/crateresolve1-1.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![crate_id="crateresolve1#0.1"]
12-
11+
// compile-flags:-C extra-filename=-1
12+
#![crate_name = "crateresolve1"]
1313
#![crate_type = "lib"]
1414

1515
pub fn f() -> int { 10 }

src/test/auxiliary/crateresolve1-2.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![crate_id="crateresolve1#0.2"]
12-
11+
// compile-flags:-C extra-filename=-2
12+
#![crate_name = "crateresolve1"]
1313
#![crate_type = "lib"]
1414

1515
pub fn f() -> int { 20 }

src/test/auxiliary/crateresolve1-3.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![crate_id="crateresolve1#0.3"]
12-
11+
// compile-flags:-C extra-filename=-3
12+
#![crate_name = "crateresolve1"]
1313
#![crate_type = "lib"]
1414

1515
pub fn f() -> int { 30 }

src/test/auxiliary/crateresolve2-1.rs

-15
This file was deleted.

src/test/auxiliary/extern-crosscrate-source.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![crate_id="externcallback#0.1"]
11+
#![crate_name="externcallback"]
1212
#![crate_type = "lib"]
1313

1414
extern crate libc;

src/test/compile-fail/bad-crate-id.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
extern crate foo = ""; //~ ERROR: malformed crate id
12-
extern crate bar = "#a"; //~ ERROR: malformed crate id
11+
extern crate foo = ""; //~ ERROR: crate name must not be empty
1312

1413
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -8,8 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![crate_id="crateresolve2#0.2"]
11+
extern crate bar = "#a"; //~ ERROR: invalid character in crate name: `#`
1212

13-
#![crate_type = "lib"]
13+
fn main() {}
1414

15-
pub fn f() -> int { 20 }

src/test/compile-fail/crateresolve2.rs

-24
This file was deleted.

src/test/compile-fail/crateresolve5.rs

-21
This file was deleted.

src/test/compile-fail/issue-11908-1.rs

-24
This file was deleted.

src/test/compile-fail/issue-11908-2.rs

-21
This file was deleted.

src/test/run-make/bootstrap-from-c-with-green/Makefile

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ TARGET_RPATH_DIR:=$(TARGET_RPATH_DIR):$(TMPDIR)
66

77
all:
88
$(RUSTC) lib.rs
9-
ln -nsf $(call DYLIB,boot-*) $(call DYLIB,boot)
109
$(CC) main.c -o $(call RUN_BINFILE,main) $(call RPATH_LINK_SEARCH,$(HOST_LIB_DIR)) -lboot
1110
$(call RUN,main)
1211
$(call REMOVE_DYLIBS,boot)

src/test/run-make/bootstrap-from-c-with-green/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![crate_id="boot#0.1"]
11+
#![crate_name="boot"]
1212
#![crate_type="dylib"]
1313

1414
extern crate rustuv;

src/test/run-make/bootstrap-from-c-with-native/Makefile

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ TARGET_RPATH_DIR:=$(TARGET_RPATH_DIR):$(TMPDIR)
66

77
all:
88
$(RUSTC) lib.rs
9-
ln -nsf $(call DYLIB,boot-*) $(call DYLIB,boot)
109
$(CC) main.c -o $(call RUN_BINFILE,main) $(call RPATH_LINK_SEARCH,$(HOST_LIB_DIR)) -lboot
1110
$(call RUN,main)
1211
$(call REMOVE_DYLIBS,boot)

src/test/run-make/c-link-to-rust-dylib/Makefile

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ HOST_LIB_DIR=$(TMPDIR)/../../../stage$(RUST_BUILD_STAGE)/lib
44

55
all:
66
$(RUSTC) foo.rs
7-
ln -s $(call DYLIB,foo-*) $(call DYLIB,foo)
87
$(CC) bar.c -lfoo -o $(call RUN_BINFILE,bar) $(call RPATH_LINK_SEARCH,$(HOST_LIB_DIR)) -Wl,-rpath,$(TMPDIR)
98
$(call RUN,bar)
109
$(call REMOVE_DYLIBS,foo)

src/test/run-make/c-link-to-rust-staticlib/Makefile

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ endif
1010
ifneq ($(shell uname),FreeBSD)
1111
all:
1212
$(RUSTC) foo.rs
13-
ln -s $(call STATICLIB,foo-*) $(call STATICLIB,foo)
1413
$(CC) bar.c -lfoo -o $(call RUN_BINFILE,bar) $(EXTRAFLAGS) -lstdc++
1514
$(call RUN,bar)
1615
rm $(call STATICLIB,foo*)

src/test/run-make/crate-data-smoke/Makefile

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
-include ../tools.mk
22

33
all:
4-
[ `$(RUSTC) --crate-id crate.rs` = "foo#0.11.0" ]
54
[ `$(RUSTC) --crate-name crate.rs` = "foo" ]
65
[ `$(RUSTC) --crate-file-name crate.rs` = "foo" ]
76
[ `$(RUSTC) --crate-file-name --crate-type=lib --test crate.rs` = "foo" ]

src/test/run-make/crate-data-smoke/crate.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![crate_id = "foo#0.11.0"]
11+
#![crate_name = "foo"]
1212

1313
// Querying about the crate metadata should *not* parse the entire crate, it
1414
// only needs the crate attributes (which are guaranteed to be at the top) be

src/test/run-make/crate-data-smoke/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![crate_id = "mylib"]
11+
#![crate_name = "mylib"]
1212
#![crate_type = "lib"]

src/test/run-make/crate-data-smoke/rlib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![crate_id = "mylib"]
11+
#![crate_name = "mylib"]
1212
#![crate_type = "rlib"]

src/test/run-make/dep-info/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![crate_id="foo#0.1"]
11+
#![crate_name = "foo"]
1212

1313
pub mod foo;
1414
pub mod bar;

src/test/run-make/extern-flag-disambiguates/a.rs

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
111
#![crate_name = "a"]
212
#![crate_type = "rlib"]
313

src/test/run-make/extern-flag-disambiguates/b.rs

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
111
#![crate_name = "b"]
212
#![crate_type = "rlib"]
313

src/test/run-make/extern-flag-disambiguates/c.rs

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
111
#![crate_name = "c"]
212
#![crate_type = "rlib"]
313

src/test/run-make/extern-flag-disambiguates/d.rs

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
111
#[cfg(before)] extern crate a;
212
extern crate b;
313
extern crate c;
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
111
extern crate bar;
212

313
fn main() {}
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# This test ensures that if you have the same rlib or dylib at two locations
2+
# in the same path that you don't hit an assertion in the compiler.
3+
#
4+
# Note that this relies on `liburl` to be in the path somewhere else,
5+
# and then our aux-built libraries will collide with liburl (they have
6+
# the same version listed)
7+
8+
-include ../tools.mk
9+
10+
all:
11+
mkdir $(TMPDIR)/other
12+
$(RUSTC) foo.rs --crate-type=dylib
13+
$(RUSTC) foo.rs --crate-type=dylib -o $(TMPDIR)/other/libfoo.so
14+
$(RUSTC) bar.rs -L $(TMPDIR)/other 2>&1 | \
15+
grep "multiple dylib candidates"
16+
rm -rf $(TMPDIR)
17+
mkdir -p $(TMPDIR)/other
18+
$(RUSTC) foo.rs --crate-type=rlib
19+
$(RUSTC) foo.rs --crate-type=rlib -o $(TMPDIR)/other/libfoo.rlib
20+
$(RUSTC) bar.rs -L $(TMPDIR)/other 2>&1 | \
21+
grep "multiple rlib candidates"

src/test/auxiliary/issue-11908-2.rs renamed to src/test/run-make/issue-11908/bar.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// no-prefer-dynamic
11+
extern crate foo;
1212

13-
#![crate_id = "url#0.11.0"]
14-
#![crate_type = "rlib"]
13+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -8,6 +8,4 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// error-pattern:can't find crate for `std`
12-
13-
extern crate std = "std#bogus";
11+
#![crate_name = "foo"]

src/test/run-make/lto-smoke-c/Makefile

-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,5 @@ CC := $(CC:-g=)
55

66
all:
77
$(RUSTC) foo.rs -Z lto
8-
ln -s $(call STATICLIB,foo-*) $(call STATICLIB,foo)
98
$(CC) bar.c -lfoo -o $(call RUN_BINFILE,bar) $(EXTRACFLAGS) -lstdc++
109
$(call RUN,bar)

src/test/run-make/lto-syntax-extension/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[crate_type = "rlib"];
11+
#![crate_type = "rlib"]

0 commit comments

Comments
 (0)