From 812637e683ef1092cdd62704ab53f0b4c5aabe19 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 1 Jul 2014 11:51:41 -0700 Subject: [PATCH] test: Fix tests for crate_id removal This involved removing some tests whose functionality was removed such as many of the crateresolve tests --- src/test/auxiliary/crateresolve1-1.rs | 4 +-- src/test/auxiliary/crateresolve1-2.rs | 4 +-- src/test/auxiliary/crateresolve1-3.rs | 4 +-- src/test/auxiliary/crateresolve2-1.rs | 15 -------- .../auxiliary/extern-crosscrate-source.rs | 2 +- src/test/compile-fail/bad-crate-id.rs | 3 +- .../bad-crate-id2.rs} | 7 ++-- src/test/compile-fail/crateresolve2.rs | 24 ------------- src/test/compile-fail/crateresolve5.rs | 21 ------------ src/test/compile-fail/issue-11908-1.rs | 24 ------------- src/test/compile-fail/issue-11908-2.rs | 21 ------------ .../bootstrap-from-c-with-green/Makefile | 1 - .../bootstrap-from-c-with-green/lib.rs | 2 +- .../bootstrap-from-c-with-native/Makefile | 1 - .../run-make/c-link-to-rust-dylib/Makefile | 1 - .../c-link-to-rust-staticlib/Makefile | 1 - src/test/run-make/crate-data-smoke/Makefile | 1 - src/test/run-make/crate-data-smoke/crate.rs | 2 +- src/test/run-make/crate-data-smoke/lib.rs | 2 +- src/test/run-make/crate-data-smoke/rlib.rs | 2 +- src/test/run-make/dep-info/lib.rs | 2 +- .../run-make/extern-flag-disambiguates/a.rs | 10 ++++++ .../run-make/extern-flag-disambiguates/b.rs | 10 ++++++ .../run-make/extern-flag-disambiguates/c.rs | 10 ++++++ .../run-make/extern-flag-disambiguates/d.rs | 10 ++++++ src/test/run-make/extern-flag-fun/bar.rs | 10 ++++++ src/test/run-make/extern-flag-fun/foo.rs | 10 ++++++ src/test/run-make/issue-11908/Makefile | 21 ++++++++++++ .../issue-11908/bar.rs} | 5 ++- .../issue-11908/foo.rs} | 6 ++-- src/test/run-make/lto-smoke-c/Makefile | 1 - src/test/run-make/lto-syntax-extension/lib.rs | 2 +- .../metadata-flag-frobs-symbols/bar.rs | 10 ++++++ .../metadata-flag-frobs-symbols/foo.rs | 10 ++++++ src/test/run-make/multiple-versions/Makefile | 9 +++++ .../multiple-versions/bar.rs} | 6 ++-- .../multiple-versions/foo.rs} | 8 ++--- .../run-make/output-type-permutations/foo.rs | 2 +- .../run-make/weird-output-filenames/Makefile | 12 +++---- src/test/run-pass/crateresolve1.rs | 19 ----------- src/test/run-pass/crateresolve2.rs | 34 ------------------- src/test/run-pass/crateresolve3.rs | 30 ---------------- src/test/run-pass/crateresolve4.rs | 29 ---------------- src/test/run-pass/crateresolve5.rs | 23 ------------- src/test/run-pass/crateresolve8.rs | 20 ----------- src/test/run-pass/extern-crosscrate.rs | 2 +- src/test/run-pass/use.rs | 2 -- 47 files changed, 144 insertions(+), 311 deletions(-) delete mode 100644 src/test/auxiliary/crateresolve2-1.rs rename src/test/{auxiliary/crateresolve2-2.rs => compile-fail/bad-crate-id2.rs} (72%) delete mode 100644 src/test/compile-fail/crateresolve2.rs delete mode 100644 src/test/compile-fail/crateresolve5.rs delete mode 100644 src/test/compile-fail/issue-11908-1.rs delete mode 100644 src/test/compile-fail/issue-11908-2.rs create mode 100644 src/test/run-make/issue-11908/Makefile rename src/test/{auxiliary/issue-11908-2.rs => run-make/issue-11908/bar.rs} (86%) rename src/test/{compile-fail/use-meta.rc => run-make/issue-11908/foo.rs} (74%) create mode 100644 src/test/run-make/multiple-versions/Makefile rename src/test/{auxiliary/issue-11908-1.rs => run-make/multiple-versions/bar.rs} (86%) rename src/test/{auxiliary/crateresolve2-3.rs => run-make/multiple-versions/foo.rs} (73%) delete mode 100644 src/test/run-pass/crateresolve1.rs delete mode 100644 src/test/run-pass/crateresolve2.rs delete mode 100644 src/test/run-pass/crateresolve3.rs delete mode 100644 src/test/run-pass/crateresolve4.rs delete mode 100644 src/test/run-pass/crateresolve5.rs delete mode 100644 src/test/run-pass/crateresolve8.rs diff --git a/src/test/auxiliary/crateresolve1-1.rs b/src/test/auxiliary/crateresolve1-1.rs index eddedfa36bb..e26ea7c4fa6 100644 --- a/src/test/auxiliary/crateresolve1-1.rs +++ b/src/test/auxiliary/crateresolve1-1.rs @@ -8,8 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![crate_id="crateresolve1#0.1"] - +// compile-flags:-C extra-filename=-1 +#![crate_name = "crateresolve1"] #![crate_type = "lib"] pub fn f() -> int { 10 } diff --git a/src/test/auxiliary/crateresolve1-2.rs b/src/test/auxiliary/crateresolve1-2.rs index 48042de0bad..715171b143a 100644 --- a/src/test/auxiliary/crateresolve1-2.rs +++ b/src/test/auxiliary/crateresolve1-2.rs @@ -8,8 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![crate_id="crateresolve1#0.2"] - +// compile-flags:-C extra-filename=-2 +#![crate_name = "crateresolve1"] #![crate_type = "lib"] pub fn f() -> int { 20 } diff --git a/src/test/auxiliary/crateresolve1-3.rs b/src/test/auxiliary/crateresolve1-3.rs index c126560fe3e..f733b5b908a 100644 --- a/src/test/auxiliary/crateresolve1-3.rs +++ b/src/test/auxiliary/crateresolve1-3.rs @@ -8,8 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![crate_id="crateresolve1#0.3"] - +// compile-flags:-C extra-filename=-3 +#![crate_name = "crateresolve1"] #![crate_type = "lib"] pub fn f() -> int { 30 } diff --git a/src/test/auxiliary/crateresolve2-1.rs b/src/test/auxiliary/crateresolve2-1.rs deleted file mode 100644 index f436e7c95d1..00000000000 --- a/src/test/auxiliary/crateresolve2-1.rs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![crate_id="crateresolve2#0.1"] - -#![crate_type = "lib"] - -pub fn f() -> int { 10 } diff --git a/src/test/auxiliary/extern-crosscrate-source.rs b/src/test/auxiliary/extern-crosscrate-source.rs index e26f8effb47..5c83b327912 100644 --- a/src/test/auxiliary/extern-crosscrate-source.rs +++ b/src/test/auxiliary/extern-crosscrate-source.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![crate_id="externcallback#0.1"] +#![crate_name="externcallback"] #![crate_type = "lib"] extern crate libc; diff --git a/src/test/compile-fail/bad-crate-id.rs b/src/test/compile-fail/bad-crate-id.rs index 43956752cd9..883bfd035f4 100644 --- a/src/test/compile-fail/bad-crate-id.rs +++ b/src/test/compile-fail/bad-crate-id.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -extern crate foo = ""; //~ ERROR: malformed crate id -extern crate bar = "#a"; //~ ERROR: malformed crate id +extern crate foo = ""; //~ ERROR: crate name must not be empty fn main() {} diff --git a/src/test/auxiliary/crateresolve2-2.rs b/src/test/compile-fail/bad-crate-id2.rs similarity index 72% rename from src/test/auxiliary/crateresolve2-2.rs rename to src/test/compile-fail/bad-crate-id2.rs index 1f92ce5943c..fcbdc6d1f24 100644 --- a/src/test/auxiliary/crateresolve2-2.rs +++ b/src/test/compile-fail/bad-crate-id2.rs @@ -1,4 +1,4 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -8,8 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![crate_id="crateresolve2#0.2"] +extern crate bar = "#a"; //~ ERROR: invalid character in crate name: `#` -#![crate_type = "lib"] +fn main() {} -pub fn f() -> int { 20 } diff --git a/src/test/compile-fail/crateresolve2.rs b/src/test/compile-fail/crateresolve2.rs deleted file mode 100644 index c5e9d128152..00000000000 --- a/src/test/compile-fail/crateresolve2.rs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// aux-build:crateresolve2-1.rs -// aux-build:crateresolve2-2.rs -// aux-build:crateresolve2-3.rs -// error-pattern:using multiple versions of crate `crateresolve2` - -extern crate crateresolve2 = "crateresolve2#0.1"; - -mod m { - pub extern crate crateresolve2 = "crateresolve2#0.2"; -} - -fn main() { - let x: int = false; -} diff --git a/src/test/compile-fail/crateresolve5.rs b/src/test/compile-fail/crateresolve5.rs deleted file mode 100644 index 8b4801466b9..00000000000 --- a/src/test/compile-fail/crateresolve5.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// aux-build:crateresolve5-1.rs -// aux-build:crateresolve5-2.rs - -extern crate cr5_1 = "crateresolve5#0.1"; -extern crate cr5_2 = "crateresolve5#0.2"; - - -fn main() { - // Nominal types from two multiple versions of a crate are different types - assert!(cr5_1::nominal() == cr5_2::nominal()); //~ ERROR mismatched types: expected -} diff --git a/src/test/compile-fail/issue-11908-1.rs b/src/test/compile-fail/issue-11908-1.rs deleted file mode 100644 index dbedf355a56..00000000000 --- a/src/test/compile-fail/issue-11908-1.rs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// aux-build:issue-11908-1.rs -// ignore-android this test is incompatible with the android test runner -// error-pattern: multiple dylib candidates for `url` found - -// This test ensures that if you have the same rlib or dylib at two locations -// in the same path that you don't hit an assertion in the compiler. -// -// Note that this relies on `liburl` to be in the path somewhere else, -// and then our aux-built libraries will collide with liburl (they have -// the same version listed) - -extern crate url; - -fn main() {} diff --git a/src/test/compile-fail/issue-11908-2.rs b/src/test/compile-fail/issue-11908-2.rs deleted file mode 100644 index 8b916aad653..00000000000 --- a/src/test/compile-fail/issue-11908-2.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// aux-build:issue-11908-2.rs -// no-prefer-dynamic -// ignore-android this test is incompatible with the android test runner -// error-pattern: multiple rlib candidates for `url` found - -// see comments in issue-11908-1 for what's going on here - -extern crate url; - -fn main() {} - diff --git a/src/test/run-make/bootstrap-from-c-with-green/Makefile b/src/test/run-make/bootstrap-from-c-with-green/Makefile index 3b28af9b0e8..c7753a67464 100644 --- a/src/test/run-make/bootstrap-from-c-with-green/Makefile +++ b/src/test/run-make/bootstrap-from-c-with-green/Makefile @@ -6,7 +6,6 @@ TARGET_RPATH_DIR:=$(TARGET_RPATH_DIR):$(TMPDIR) all: $(RUSTC) lib.rs - ln -nsf $(call DYLIB,boot-*) $(call DYLIB,boot) $(CC) main.c -o $(call RUN_BINFILE,main) $(call RPATH_LINK_SEARCH,$(HOST_LIB_DIR)) -lboot $(call RUN,main) $(call REMOVE_DYLIBS,boot) diff --git a/src/test/run-make/bootstrap-from-c-with-green/lib.rs b/src/test/run-make/bootstrap-from-c-with-green/lib.rs index 69c65ef8b03..7f17018c486 100644 --- a/src/test/run-make/bootstrap-from-c-with-green/lib.rs +++ b/src/test/run-make/bootstrap-from-c-with-green/lib.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![crate_id="boot#0.1"] +#![crate_name="boot"] #![crate_type="dylib"] extern crate rustuv; diff --git a/src/test/run-make/bootstrap-from-c-with-native/Makefile b/src/test/run-make/bootstrap-from-c-with-native/Makefile index 3b28af9b0e8..c7753a67464 100644 --- a/src/test/run-make/bootstrap-from-c-with-native/Makefile +++ b/src/test/run-make/bootstrap-from-c-with-native/Makefile @@ -6,7 +6,6 @@ TARGET_RPATH_DIR:=$(TARGET_RPATH_DIR):$(TMPDIR) all: $(RUSTC) lib.rs - ln -nsf $(call DYLIB,boot-*) $(call DYLIB,boot) $(CC) main.c -o $(call RUN_BINFILE,main) $(call RPATH_LINK_SEARCH,$(HOST_LIB_DIR)) -lboot $(call RUN,main) $(call REMOVE_DYLIBS,boot) diff --git a/src/test/run-make/c-link-to-rust-dylib/Makefile b/src/test/run-make/c-link-to-rust-dylib/Makefile index e743004a9cb..a5b4430ab6a 100644 --- a/src/test/run-make/c-link-to-rust-dylib/Makefile +++ b/src/test/run-make/c-link-to-rust-dylib/Makefile @@ -4,7 +4,6 @@ HOST_LIB_DIR=$(TMPDIR)/../../../stage$(RUST_BUILD_STAGE)/lib all: $(RUSTC) foo.rs - ln -s $(call DYLIB,foo-*) $(call DYLIB,foo) $(CC) bar.c -lfoo -o $(call RUN_BINFILE,bar) $(call RPATH_LINK_SEARCH,$(HOST_LIB_DIR)) -Wl,-rpath,$(TMPDIR) $(call RUN,bar) $(call REMOVE_DYLIBS,foo) diff --git a/src/test/run-make/c-link-to-rust-staticlib/Makefile b/src/test/run-make/c-link-to-rust-staticlib/Makefile index 40b6feac678..8a6d6e4dd6d 100644 --- a/src/test/run-make/c-link-to-rust-staticlib/Makefile +++ b/src/test/run-make/c-link-to-rust-staticlib/Makefile @@ -10,7 +10,6 @@ endif ifneq ($(shell uname),FreeBSD) all: $(RUSTC) foo.rs - ln -s $(call STATICLIB,foo-*) $(call STATICLIB,foo) $(CC) bar.c -lfoo -o $(call RUN_BINFILE,bar) $(EXTRAFLAGS) -lstdc++ $(call RUN,bar) rm $(call STATICLIB,foo*) diff --git a/src/test/run-make/crate-data-smoke/Makefile b/src/test/run-make/crate-data-smoke/Makefile index a44481b4b7f..a709320c0f9 100644 --- a/src/test/run-make/crate-data-smoke/Makefile +++ b/src/test/run-make/crate-data-smoke/Makefile @@ -1,7 +1,6 @@ -include ../tools.mk all: - [ `$(RUSTC) --crate-id crate.rs` = "foo#0.11.0" ] [ `$(RUSTC) --crate-name crate.rs` = "foo" ] [ `$(RUSTC) --crate-file-name crate.rs` = "foo" ] [ `$(RUSTC) --crate-file-name --crate-type=lib --test crate.rs` = "foo" ] diff --git a/src/test/run-make/crate-data-smoke/crate.rs b/src/test/run-make/crate-data-smoke/crate.rs index 9faa7c01628..305b3dc70a6 100644 --- a/src/test/run-make/crate-data-smoke/crate.rs +++ b/src/test/run-make/crate-data-smoke/crate.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![crate_id = "foo#0.11.0"] +#![crate_name = "foo"] // Querying about the crate metadata should *not* parse the entire crate, it // only needs the crate attributes (which are guaranteed to be at the top) be diff --git a/src/test/run-make/crate-data-smoke/lib.rs b/src/test/run-make/crate-data-smoke/lib.rs index b40e055b3cb..639a5d0387b 100644 --- a/src/test/run-make/crate-data-smoke/lib.rs +++ b/src/test/run-make/crate-data-smoke/lib.rs @@ -8,5 +8,5 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![crate_id = "mylib"] +#![crate_name = "mylib"] #![crate_type = "lib"] diff --git a/src/test/run-make/crate-data-smoke/rlib.rs b/src/test/run-make/crate-data-smoke/rlib.rs index 94b8371e537..4e093748600 100644 --- a/src/test/run-make/crate-data-smoke/rlib.rs +++ b/src/test/run-make/crate-data-smoke/rlib.rs @@ -8,5 +8,5 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![crate_id = "mylib"] +#![crate_name = "mylib"] #![crate_type = "rlib"] diff --git a/src/test/run-make/dep-info/lib.rs b/src/test/run-make/dep-info/lib.rs index 4255b1d934d..7c15785bbb2 100644 --- a/src/test/run-make/dep-info/lib.rs +++ b/src/test/run-make/dep-info/lib.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![crate_id="foo#0.1"] +#![crate_name = "foo"] pub mod foo; pub mod bar; diff --git a/src/test/run-make/extern-flag-disambiguates/a.rs b/src/test/run-make/extern-flag-disambiguates/a.rs index db1a0e0433e..11b9ba6fce3 100644 --- a/src/test/run-make/extern-flag-disambiguates/a.rs +++ b/src/test/run-make/extern-flag-disambiguates/a.rs @@ -1,3 +1,13 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + #![crate_name = "a"] #![crate_type = "rlib"] diff --git a/src/test/run-make/extern-flag-disambiguates/b.rs b/src/test/run-make/extern-flag-disambiguates/b.rs index f4fb09631a9..3156cf0ba72 100644 --- a/src/test/run-make/extern-flag-disambiguates/b.rs +++ b/src/test/run-make/extern-flag-disambiguates/b.rs @@ -1,3 +1,13 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + #![crate_name = "b"] #![crate_type = "rlib"] diff --git a/src/test/run-make/extern-flag-disambiguates/c.rs b/src/test/run-make/extern-flag-disambiguates/c.rs index e017d747e6f..d3bbc762ef2 100644 --- a/src/test/run-make/extern-flag-disambiguates/c.rs +++ b/src/test/run-make/extern-flag-disambiguates/c.rs @@ -1,3 +1,13 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + #![crate_name = "c"] #![crate_type = "rlib"] diff --git a/src/test/run-make/extern-flag-disambiguates/d.rs b/src/test/run-make/extern-flag-disambiguates/d.rs index e3c968edb6a..d850daffc39 100644 --- a/src/test/run-make/extern-flag-disambiguates/d.rs +++ b/src/test/run-make/extern-flag-disambiguates/d.rs @@ -1,3 +1,13 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + #[cfg(before)] extern crate a; extern crate b; extern crate c; diff --git a/src/test/run-make/extern-flag-fun/bar.rs b/src/test/run-make/extern-flag-fun/bar.rs index e69de29bb2d..2152aa79c33 100644 --- a/src/test/run-make/extern-flag-fun/bar.rs +++ b/src/test/run-make/extern-flag-fun/bar.rs @@ -0,0 +1,10 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + diff --git a/src/test/run-make/extern-flag-fun/foo.rs b/src/test/run-make/extern-flag-fun/foo.rs index 0edda7d7b88..52741668640 100644 --- a/src/test/run-make/extern-flag-fun/foo.rs +++ b/src/test/run-make/extern-flag-fun/foo.rs @@ -1,3 +1,13 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + extern crate bar; fn main() {} diff --git a/src/test/run-make/issue-11908/Makefile b/src/test/run-make/issue-11908/Makefile new file mode 100644 index 00000000000..66f360daa1a --- /dev/null +++ b/src/test/run-make/issue-11908/Makefile @@ -0,0 +1,21 @@ +# This test ensures that if you have the same rlib or dylib at two locations +# in the same path that you don't hit an assertion in the compiler. +# +# Note that this relies on `liburl` to be in the path somewhere else, +# and then our aux-built libraries will collide with liburl (they have +# the same version listed) + +-include ../tools.mk + +all: + mkdir $(TMPDIR)/other + $(RUSTC) foo.rs --crate-type=dylib + $(RUSTC) foo.rs --crate-type=dylib -o $(TMPDIR)/other/libfoo.so + $(RUSTC) bar.rs -L $(TMPDIR)/other 2>&1 | \ + grep "multiple dylib candidates" + rm -rf $(TMPDIR) + mkdir -p $(TMPDIR)/other + $(RUSTC) foo.rs --crate-type=rlib + $(RUSTC) foo.rs --crate-type=rlib -o $(TMPDIR)/other/libfoo.rlib + $(RUSTC) bar.rs -L $(TMPDIR)/other 2>&1 | \ + grep "multiple rlib candidates" diff --git a/src/test/auxiliary/issue-11908-2.rs b/src/test/run-make/issue-11908/bar.rs similarity index 86% rename from src/test/auxiliary/issue-11908-2.rs rename to src/test/run-make/issue-11908/bar.rs index 0deece53451..6316cfa3bba 100644 --- a/src/test/auxiliary/issue-11908-2.rs +++ b/src/test/run-make/issue-11908/bar.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// no-prefer-dynamic +extern crate foo; -#![crate_id = "url#0.11.0"] -#![crate_type = "rlib"] +fn main() {} diff --git a/src/test/compile-fail/use-meta.rc b/src/test/run-make/issue-11908/foo.rs similarity index 74% rename from src/test/compile-fail/use-meta.rc rename to src/test/run-make/issue-11908/foo.rs index 9cb84c5400a..0858d3c4e47 100644 --- a/src/test/compile-fail/use-meta.rc +++ b/src/test/run-make/issue-11908/foo.rs @@ -1,4 +1,4 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -8,6 +8,4 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// error-pattern:can't find crate for `std` - -extern crate std = "std#bogus"; +#![crate_name = "foo"] diff --git a/src/test/run-make/lto-smoke-c/Makefile b/src/test/run-make/lto-smoke-c/Makefile index 9b44c3e582a..6c7e9aa1d59 100644 --- a/src/test/run-make/lto-smoke-c/Makefile +++ b/src/test/run-make/lto-smoke-c/Makefile @@ -5,6 +5,5 @@ CC := $(CC:-g=) all: $(RUSTC) foo.rs -Z lto - ln -s $(call STATICLIB,foo-*) $(call STATICLIB,foo) $(CC) bar.c -lfoo -o $(call RUN_BINFILE,bar) $(EXTRACFLAGS) -lstdc++ $(call RUN,bar) diff --git a/src/test/run-make/lto-syntax-extension/lib.rs b/src/test/run-make/lto-syntax-extension/lib.rs index fbe967786e2..04d3ae67207 100644 --- a/src/test/run-make/lto-syntax-extension/lib.rs +++ b/src/test/run-make/lto-syntax-extension/lib.rs @@ -8,4 +8,4 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[crate_type = "rlib"]; +#![crate_type = "rlib"] diff --git a/src/test/run-make/metadata-flag-frobs-symbols/bar.rs b/src/test/run-make/metadata-flag-frobs-symbols/bar.rs index 1e6957a3694..44b9e2f874a 100644 --- a/src/test/run-make/metadata-flag-frobs-symbols/bar.rs +++ b/src/test/run-make/metadata-flag-frobs-symbols/bar.rs @@ -1,3 +1,13 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + extern crate foo1; extern crate foo2; diff --git a/src/test/run-make/metadata-flag-frobs-symbols/foo.rs b/src/test/run-make/metadata-flag-frobs-symbols/foo.rs index 1974f4bc562..ed04eed8cf7 100644 --- a/src/test/run-make/metadata-flag-frobs-symbols/foo.rs +++ b/src/test/run-make/metadata-flag-frobs-symbols/foo.rs @@ -1,3 +1,13 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + #![crate_name = "foo"] #![crate_type = "rlib"] diff --git a/src/test/run-make/multiple-versions/Makefile b/src/test/run-make/multiple-versions/Makefile new file mode 100644 index 00000000000..e60c16ae0f6 --- /dev/null +++ b/src/test/run-make/multiple-versions/Makefile @@ -0,0 +1,9 @@ +-include ../tools.mk + +all: + $(RUSTC) foo.rs -C metadata=a -C extra-filename=-1 --crate-type=rlib + $(RUSTC) foo.rs -C metadata=b -C extra-filename=-2 --crate-type=rlib + $(RUSTC) bar.rs \ + --extern foo1=$(TMPDIR)/libfoo-1.rlib \ + --extern foo2=$(TMPDIR)/libfoo-2.rlib \ + 2>&1 | grep "using multiple versions of crate .foo." diff --git a/src/test/auxiliary/issue-11908-1.rs b/src/test/run-make/multiple-versions/bar.rs similarity index 86% rename from src/test/auxiliary/issue-11908-1.rs rename to src/test/run-make/multiple-versions/bar.rs index 8a48e483029..262193a0810 100644 --- a/src/test/auxiliary/issue-11908-1.rs +++ b/src/test/run-make/multiple-versions/bar.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// no-prefer-dynamic +extern crate foo1; +extern crate foo2; -#![crate_id = "url#0.11.0"] -#![crate_type = "dylib"] +fn main() {} diff --git a/src/test/auxiliary/crateresolve2-3.rs b/src/test/run-make/multiple-versions/foo.rs similarity index 73% rename from src/test/auxiliary/crateresolve2-3.rs rename to src/test/run-make/multiple-versions/foo.rs index fe064b7e5e6..2661b1f4eb4 100644 --- a/src/test/auxiliary/crateresolve2-3.rs +++ b/src/test/run-make/multiple-versions/foo.rs @@ -1,4 +1,4 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -8,8 +8,4 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![crate_id="crateresolve2#0.3"] - -#![crate_type = "lib"] - -pub fn f() -> int { 30 } +pub fn foo() {} diff --git a/src/test/run-make/output-type-permutations/foo.rs b/src/test/run-make/output-type-permutations/foo.rs index 020fbc3299b..bb5796bd873 100644 --- a/src/test/run-make/output-type-permutations/foo.rs +++ b/src/test/run-make/output-type-permutations/foo.rs @@ -8,6 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![crate_id = "bar"] +#![crate_name = "bar"] fn main() {} diff --git a/src/test/run-make/weird-output-filenames/Makefile b/src/test/run-make/weird-output-filenames/Makefile index debd89d9929..37dcf9a6c4a 100644 --- a/src/test/run-make/weird-output-filenames/Makefile +++ b/src/test/run-make/weird-output-filenames/Makefile @@ -1,9 +1,9 @@ -include ../tools.mk all: - $(RUSTC) foo.rs -o $(TMPDIR)/.foo - rm $(TMPDIR)/.foo - $(RUSTC) foo.rs -o $(TMPDIR)/.foo.bar - rm $(TMPDIR)/.foo.bar - $(RUSTC) foo.rs -o $(TMPDIR)/+foo+bar - rm $(TMPDIR)/$(call BIN,+foo+bar) + $(RUSTC) foo.rs -o $(TMPDIR)/.foo 2>&1 \ + | grep "invalid character in crate name:" + $(RUSTC) foo.rs -o $(TMPDIR)/.foo.bar 2>&1 \ + | grep "invalid character in crate name:" + $(RUSTC) foo.rs -o $(TMPDIR)/+foo+bar 2>&1 \ + | grep "invalid character in crate name:" diff --git a/src/test/run-pass/crateresolve1.rs b/src/test/run-pass/crateresolve1.rs deleted file mode 100644 index 61e269bf9e3..00000000000 --- a/src/test/run-pass/crateresolve1.rs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// aux-build:crateresolve1-1.rs -// aux-build:crateresolve1-2.rs -// aux-build:crateresolve1-3.rs - -extern crate crateresolve1 = "crateresolve1#0.2"; - -pub fn main() { - assert_eq!(crateresolve1::f(), 20); -} diff --git a/src/test/run-pass/crateresolve2.rs b/src/test/run-pass/crateresolve2.rs deleted file mode 100644 index 5ed1f37c7b9..00000000000 --- a/src/test/run-pass/crateresolve2.rs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// aux-build:crateresolve2-1.rs -// aux-build:crateresolve2-2.rs -// aux-build:crateresolve2-3.rs - -mod a { - extern crate crateresolve2 = "crateresolve2#0.1"; - pub fn f() { assert!(crateresolve2::f() == 10); } -} - -mod b { - extern crate crateresolve2 = "crateresolve2#0.2"; - pub fn f() { assert!(crateresolve2::f() == 20); } -} - -mod c { - extern crate crateresolve2 = "crateresolve2#0.3"; - pub fn f() { assert!(crateresolve2::f() == 30); } -} - -pub fn main() { - a::f(); - b::f(); - c::f(); -} diff --git a/src/test/run-pass/crateresolve3.rs b/src/test/run-pass/crateresolve3.rs deleted file mode 100644 index cee9e6991c4..00000000000 --- a/src/test/run-pass/crateresolve3.rs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// aux-build:crateresolve3-1.rs -// aux-build:crateresolve3-2.rs - -// verify able to link with crates with same name but different versions -// as long as no name collision on invoked functions. - -mod a { - extern crate crateresolve3 = "crateresolve3#0.1"; - pub fn f() { assert!(crateresolve3::f() == 10); } -} - -mod b { - extern crate crateresolve3 = "crateresolve3#0.2"; - pub fn f() { assert!(crateresolve3::g() == 20); } -} - -pub fn main() { - a::f(); - b::f(); -} diff --git a/src/test/run-pass/crateresolve4.rs b/src/test/run-pass/crateresolve4.rs deleted file mode 100644 index c6896152226..00000000000 --- a/src/test/run-pass/crateresolve4.rs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// aux-build:crateresolve4a-1.rs -// aux-build:crateresolve4a-2.rs -// aux-build:crateresolve4b-1.rs -// aux-build:crateresolve4b-2.rs - -pub mod a { - extern crate crateresolve4b = "crateresolve4b#0.1"; - pub fn f() { assert!(crateresolve4b::f() == 20); } -} - -pub mod b { - extern crate crateresolve4b = "crateresolve4b#0.2"; - pub fn f() { assert!(crateresolve4b::g() == 10); } -} - -pub fn main() { - a::f(); - b::f(); -} diff --git a/src/test/run-pass/crateresolve5.rs b/src/test/run-pass/crateresolve5.rs deleted file mode 100644 index 3f74731090b..00000000000 --- a/src/test/run-pass/crateresolve5.rs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// aux-build:crateresolve5-1.rs -// aux-build:crateresolve5-2.rs - -extern crate cr5_1 = "crateresolve5#0.1"; -extern crate cr5_2 = "crateresolve5#0.2"; - -pub fn main() { - // Structural types can be used between two versions of the same crate - assert!(cr5_1::struct_nameval().name == cr5_2::struct_nameval().name); - assert!(cr5_1::struct_nameval().val == cr5_2::struct_nameval().val); - // Make sure these are actually two different crates - assert!(cr5_1::f() == 10 && cr5_2::f() == 20); -} diff --git a/src/test/run-pass/crateresolve8.rs b/src/test/run-pass/crateresolve8.rs deleted file mode 100644 index f04e383cb3d..00000000000 --- a/src/test/run-pass/crateresolve8.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// aux-build:crateresolve8-1.rs - -#![crate_id="crateresolve8#0.1"] - -extern crate crateresolve8 = "crateresolve8#0.1"; -//extern crate crateresolve8(vers = "0.1"); - -pub fn main() { - assert_eq!(crateresolve8::f(), 20); -} diff --git a/src/test/run-pass/extern-crosscrate.rs b/src/test/run-pass/extern-crosscrate.rs index 3faf5744199..5dc25c85325 100644 --- a/src/test/run-pass/extern-crosscrate.rs +++ b/src/test/run-pass/extern-crosscrate.rs @@ -10,7 +10,7 @@ //aux-build:extern-crosscrate-source.rs -extern crate externcallback = "externcallback#0.1"; +extern crate externcallback; fn fact(n: uint) -> uint { unsafe { diff --git a/src/test/run-pass/use.rs b/src/test/run-pass/use.rs index 3f152cc1061..dfed3916405 100644 --- a/src/test/run-pass/use.rs +++ b/src/test/run-pass/use.rs @@ -15,13 +15,11 @@ #![no_std] extern crate std; extern crate zed = "std"; -extern crate bar = "std#0.11.0"; use std::str; use x = zed::str; mod baz { - pub use bar::str; pub use x = std::str; } -- GitLab