about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/run-make/missing-crate-dependency/Makefile9
-rw-r--r--src/test/run-make/missing-crate-dependency/crateA.rs12
-rw-r--r--src/test/run-make/missing-crate-dependency/crateB.rs11
-rw-r--r--src/test/run-make/missing-crate-dependency/crateC.rs13
4 files changed, 45 insertions, 0 deletions
diff --git a/src/test/run-make/missing-crate-dependency/Makefile b/src/test/run-make/missing-crate-dependency/Makefile
new file mode 100644
index 00000000000..a470ee0a7c1
--- /dev/null
+++ b/src/test/run-make/missing-crate-dependency/Makefile
@@ -0,0 +1,9 @@
+-include ../tools.mk
+
+all: 
+	$(RUSTC) --crate-type=rlib crateA.rs
+	$(RUSTC) --crate-type=rlib crateB.rs
+	rm $(TMPDIR)/$(call RLIB_GLOB,crateA)
+	# Ensure crateC fails to compile since dependency crateA is missing
+	$(RUSTC) crateC.rs 2>&1 | \
+		grep "error: can't find crate for \`crateA\` which \`crateB\` depends on"
diff --git a/src/test/run-make/missing-crate-dependency/crateA.rs b/src/test/run-make/missing-crate-dependency/crateA.rs
new file mode 100644
index 00000000000..4e111f29e8a
--- /dev/null
+++ b/src/test/run-make/missing-crate-dependency/crateA.rs
@@ -0,0 +1,12 @@
+// 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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// Base crate
+pub fn func() {}
diff --git a/src/test/run-make/missing-crate-dependency/crateB.rs b/src/test/run-make/missing-crate-dependency/crateB.rs
new file mode 100644
index 00000000000..bf55017c646
--- /dev/null
+++ b/src/test/run-make/missing-crate-dependency/crateB.rs
@@ -0,0 +1,11 @@
+// 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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+extern crate crateA;
diff --git a/src/test/run-make/missing-crate-dependency/crateC.rs b/src/test/run-make/missing-crate-dependency/crateC.rs
new file mode 100644
index 00000000000..174d9382b76
--- /dev/null
+++ b/src/test/run-make/missing-crate-dependency/crateC.rs
@@ -0,0 +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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+extern crate crateB;
+
+fn main() {}