Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/usr.bin Add (currently failing) test cases for profile...



details:   https://anonhg.NetBSD.org/src/rev/eb76a2eb521d
branches:  trunk
changeset: 823998:eb76a2eb521d
user:      martin <martin%NetBSD.org@localhost>
date:      Thu May 18 10:29:47 2017 +0000

description:
Add (currently failing) test cases for profiled programs.

diffstat:

 tests/usr.bin/c++/t_hello.sh |  19 ++++++++++++++++++-
 tests/usr.bin/cc/t_hello.sh  |  19 ++++++++++++++++++-
 2 files changed, 36 insertions(+), 2 deletions(-)

diffs (94 lines):

diff -r 7e27faf6f34e -r eb76a2eb521d tests/usr.bin/c++/t_hello.sh
--- a/tests/usr.bin/c++/t_hello.sh      Thu May 18 08:27:19 2017 +0000
+++ b/tests/usr.bin/c++/t_hello.sh      Thu May 18 10:29:47 2017 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: t_hello.sh,v 1.1 2017/05/14 00:07:07 kamil Exp $
+#      $NetBSD: t_hello.sh,v 1.2 2017/05/18 10:29:47 martin Exp $
 #
 # Copyright (c) 2011 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -31,6 +31,12 @@
        atf_set "require.progs" "c++"
 }
 
+atf_test_case hello_profile
+hello_head() {
+       atf_set "descr" "compile and run \"hello world\" with profiling option"
+       atf_set "require.progs" "c++"
+}
+
 atf_test_case hello_pic
 hello_pic_head() {
        atf_set "descr" "compile and run PIC \"hello world\""
@@ -59,6 +65,16 @@
        atf_check -s exit:0 -o inline:"hello world\n" ./hello
 }
 
+hello_profile_body() {
+       cat > test.cpp << EOF
+#include <stdio.h>
+#include <stdlib.h>
+int main(void) {printf("hello world\n");exit(0);}
+EOF
+       atf_check -s exit:0 -o ignore -e ignore c++ -pg -o hello test.cpp
+       atf_check -s exit:0 -o inline:"hello world\n" ./hello
+}
+
 hello_pic_body() {
        cat > test.cpp << EOF
 #include <stdlib.h>
@@ -139,6 +155,7 @@
 {
 
        atf_add_test_case hello
+       atf_add_test_case hello_profile
        atf_add_test_case hello_pic
        atf_add_test_case hello_pie
        atf_add_test_case hello32
diff -r 7e27faf6f34e -r eb76a2eb521d tests/usr.bin/cc/t_hello.sh
--- a/tests/usr.bin/cc/t_hello.sh       Thu May 18 08:27:19 2017 +0000
+++ b/tests/usr.bin/cc/t_hello.sh       Thu May 18 10:29:47 2017 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: t_hello.sh,v 1.4 2017/05/13 23:51:39 kamil Exp $
+#      $NetBSD: t_hello.sh,v 1.5 2017/05/18 10:29:47 martin Exp $
 #
 # Copyright (c) 2011 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -31,6 +31,12 @@
        atf_set "require.progs" "cc"
 }
 
+atf_test_case hello_profile
+hello_head() {
+       atf_set "descr" "compile and run \"hello world\" with profiling option"
+       atf_set "require.progs" "cc"
+}
+
 atf_test_case hello_pic
 hello_pic_head() {
        atf_set "descr" "compile and run PIC \"hello world\""
@@ -59,6 +65,16 @@
        atf_check -s exit:0 -o inline:"hello world\n" ./hello
 }
 
+hello_profile_body() {
+       cat > test.c << EOF
+#include <stdio.h>
+#include <stdlib.h>
+int main(void) {printf("hello world\n");exit(0);}
+EOF
+       atf_check -s exit:0 -o ignore -e ignore cc -o hello -pg test.c
+       atf_check -s exit:0 -o inline:"hello world\n" ./hello
+}
+
 hello_pic_body() {
        cat > test.c << EOF
 #include <stdlib.h>
@@ -139,6 +155,7 @@
 {
 
        atf_add_test_case hello
+       atf_add_test_case hello_profile
        atf_add_test_case hello_pic
        atf_add_test_case hello_pie
        atf_add_test_case hello32



Home | Main Index | Thread Index | Old Index