about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--tests/run-make/libtest-padding/Makefile14
-rw-r--r--tests/run-make/libtest-padding/bench.stdout9
-rw-r--r--tests/run-make/libtest-padding/test.stdout9
-rw-r--r--tests/run-make/libtest-padding/tests.rs18
4 files changed, 50 insertions, 0 deletions
diff --git a/tests/run-make/libtest-padding/Makefile b/tests/run-make/libtest-padding/Makefile
new file mode 100644
index 00000000000..063d0dc0a6c
--- /dev/null
+++ b/tests/run-make/libtest-padding/Makefile
@@ -0,0 +1,14 @@
+# ignore-cross-compile because we run the compiled code
+# needs-unwind because #[bench] and -Cpanic=abort requires -Zpanic-abort-tests
+include ../tools.mk
+
+NORMALIZE=sed 's%[0-9,]\+ ns/iter (+/- [0-9,]\+)%?? ns/iter (+/- ??)%' | sed 's%finished in [0-9\.]\+%finished in ??%'
+
+all:
+	$(RUSTC) --test tests.rs
+
+	$(call RUN,tests) --test-threads=1 | $(NORMALIZE) > "$(TMPDIR)"/test.stdout
+	$(RUSTC_TEST_OP) "$(TMPDIR)"/test.stdout test.stdout
+
+	$(call RUN,tests) --test-threads=1 --bench | $(NORMALIZE) > "$(TMPDIR)"/bench.stdout
+	$(RUSTC_TEST_OP) "$(TMPDIR)"/bench.stdout bench.stdout
diff --git a/tests/run-make/libtest-padding/bench.stdout b/tests/run-make/libtest-padding/bench.stdout
new file mode 100644
index 00000000000..3d55401c93a
--- /dev/null
+++ b/tests/run-make/libtest-padding/bench.stdout
@@ -0,0 +1,9 @@
+
+running 4 tests
+test short_test_name ... ignored
+test this_is_a_really_long_test_name ... ignored
+test short_bench_name                 ... bench:           ?? ns/iter (+/- ??)
+test this_is_a_really_long_bench_name ... bench:           ?? ns/iter (+/- ??)
+
+test result: ok. 0 passed; 0 failed; 2 ignored; 2 measured; 0 filtered out; finished in ??s
+
diff --git a/tests/run-make/libtest-padding/test.stdout b/tests/run-make/libtest-padding/test.stdout
new file mode 100644
index 00000000000..c655f034756
--- /dev/null
+++ b/tests/run-make/libtest-padding/test.stdout
@@ -0,0 +1,9 @@
+
+running 4 tests
+test short_bench_name                 ... ok
+test short_test_name ... ok
+test this_is_a_really_long_bench_name ... ok
+test this_is_a_really_long_test_name ... ok
+
+test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in ??s
+
diff --git a/tests/run-make/libtest-padding/tests.rs b/tests/run-make/libtest-padding/tests.rs
new file mode 100644
index 00000000000..cadf07237e9
--- /dev/null
+++ b/tests/run-make/libtest-padding/tests.rs
@@ -0,0 +1,18 @@
+#![feature(test)]
+extern crate test;
+
+#[test]
+fn short_test_name() {}
+
+#[test]
+fn this_is_a_really_long_test_name() {}
+
+#[bench]
+fn short_bench_name(b: &mut test::Bencher) {
+    b.iter(|| 1);
+}
+
+#[bench]
+fn this_is_a_really_long_bench_name(b: &mut test::Bencher) {
+    b.iter(|| 1);
+}