about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorThomas Jespersen <laumann.thomas@gmail.com>2015-04-14 15:40:10 +0200
committerThomas Jespersen <laumann.thomas@gmail.com>2015-04-14 15:40:10 +0200
commitbed2d33523be222195aff71bb813eb14a1faef97 (patch)
tree07c519c06b9e71c51ba8107e75f131d7252f1d93 /src
parentd14109ec7e90f42a7cb966415b96094b146d3706 (diff)
downloadrust-bed2d33523be222195aff71bb813eb14a1faef97.tar.gz
rust-bed2d33523be222195aff71bb813eb14a1faef97.zip
Add "run-make" test for trace-macros flag
Diffstat (limited to 'src')
-rw-r--r--src/test/run-make/trace-macros-flag/Makefile9
-rw-r--r--src/test/run-make/trace-macros-flag/hello.rs13
-rw-r--r--src/test/run-make/trace-macros-flag/hello.trace2
3 files changed, 24 insertions, 0 deletions
diff --git a/src/test/run-make/trace-macros-flag/Makefile b/src/test/run-make/trace-macros-flag/Makefile
new file mode 100644
index 00000000000..fc49c8c900c
--- /dev/null
+++ b/src/test/run-make/trace-macros-flag/Makefile
@@ -0,0 +1,9 @@
+# This test verifies that "-Z trace-macros"  works as it should. The traditional
+# "hello world" program provides a small example of this as not only println! is
+# listed, but also print! (since println! expands to this)
+
+-include ../tools.mk
+
+all:
+	$(RUSTC) -o $(TMPDIR)/hello -Z trace-macros hello.rs &> $(TMPDIR)/hello.trace
+	diff -u $(TMPDIR)/hello.trace hello.trace
diff --git a/src/test/run-make/trace-macros-flag/hello.rs b/src/test/run-make/trace-macros-flag/hello.rs
new file mode 100644
index 00000000000..42d3d4c799d
--- /dev/null
+++ b/src/test/run-make/trace-macros-flag/hello.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.
+
+fn main() {
+    println!("Hello, World!");
+}
diff --git a/src/test/run-make/trace-macros-flag/hello.trace b/src/test/run-make/trace-macros-flag/hello.trace
new file mode 100644
index 00000000000..cf733339ead
--- /dev/null
+++ b/src/test/run-make/trace-macros-flag/hello.trace
@@ -0,0 +1,2 @@
+println! { "Hello, World!" }
+print! { concat ! ( "Hello, World!" , "\n" ) }