about summary refs log tree commit diff
path: root/src/test/run-make
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-07-07 19:04:34 -0700
committerAlex Crichton <alex@alexcrichton.com>2014-07-08 06:27:37 -0700
commit2c26a00f91ab76a25316dc51befea03188b545d4 (patch)
treedc96b09f3eea4dc0fdc2f28bdbc0eeec080e783c /src/test/run-make
parentc175ed4425da809d6d28bc509b7dd5301a4a2b33 (diff)
downloadrust-2c26a00f91ab76a25316dc51befea03188b545d4.tar.gz
rust-2c26a00f91ab76a25316dc51befea03188b545d4.zip
rustc: Fix naming output files with --crate-name
The output file was only being renamed based off #[crate_name], not #[crate_id]
or --crate-name. Both of these behaviors have been restored now.
Diffstat (limited to 'src/test/run-make')
-rw-r--r--src/test/run-make/crate-name-priority/Makefile13
-rw-r--r--src/test/run-make/crate-name-priority/foo.rs11
-rw-r--r--src/test/run-make/crate-name-priority/foo1.rs14
3 files changed, 38 insertions, 0 deletions
diff --git a/src/test/run-make/crate-name-priority/Makefile b/src/test/run-make/crate-name-priority/Makefile
new file mode 100644
index 00000000000..250602710f5
--- /dev/null
+++ b/src/test/run-make/crate-name-priority/Makefile
@@ -0,0 +1,13 @@
+-include ../tools.mk
+
+all:
+	$(RUSTC) foo.rs
+	rm $(TMPDIR)/$(call BIN,foo)
+	$(RUSTC) foo.rs --crate-name bar
+	rm $(TMPDIR)/$(call BIN,bar)
+	$(RUSTC) foo1.rs
+	rm $(TMPDIR)/$(call BIN,foo)
+	$(RUSTC) foo1.rs --crate-name bar
+	rm $(TMPDIR)/$(call BIN,bar)
+	$(RUSTC) foo1.rs --crate-name bar -o $(TMPDIR)/bar1
+	rm $(TMPDIR)/$(call BIN,bar1)
diff --git a/src/test/run-make/crate-name-priority/foo.rs b/src/test/run-make/crate-name-priority/foo.rs
new file mode 100644
index 00000000000..8ae3d072362
--- /dev/null
+++ b/src/test/run-make/crate-name-priority/foo.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.
+
+fn main() {}
diff --git a/src/test/run-make/crate-name-priority/foo1.rs b/src/test/run-make/crate-name-priority/foo1.rs
new file mode 100644
index 00000000000..0f02f100572
--- /dev/null
+++ b/src/test/run-make/crate-name-priority/foo1.rs
@@ -0,0 +1,14 @@
+// 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.
+
+#![crate_name = "foo"]
+
+fn main() {}
+