Source-Changes-HG archive

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

[src/trunk]: src Add regression tests for some past gdb bugs.



details:   https://anonhg.NetBSD.org/src/rev/4a1616f6c1cd
branches:  trunk
changeset: 814762:4a1616f6c1cd
user:      gson <gson%NetBSD.org@localhost>
date:      Fri Apr 08 10:09:16 2016 +0000

description:
Add regression tests for some past gdb bugs.

diffstat:

 distrib/sets/lists/tests/mi    |   6 ++-
 etc/mtree/NetBSD.dist.tests    |   3 +-
 tests/usr.bin/Makefile         |   5 +-
 tests/usr.bin/gdb/Makefile     |   9 ++++
 tests/usr.bin/gdb/t_regress.sh |  77 ++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 96 insertions(+), 4 deletions(-)

diffs (150 lines):

diff -r a554dfa50547 -r 4a1616f6c1cd distrib/sets/lists/tests/mi
--- a/distrib/sets/lists/tests/mi       Thu Apr 07 23:29:59 2016 +0000
+++ b/distrib/sets/lists/tests/mi       Fri Apr 08 10:09:16 2016 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.670 2016/04/06 00:47:15 christos Exp $
+# $NetBSD: mi,v 1.671 2016/04/08 10:09:16 gson Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -3523,6 +3523,10 @@
 ./usr/tests/usr.bin/find/Atffile               tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/find/Kyuafile              tests-usr.bin-tests     compattestfile,atf,kyua
 ./usr/tests/usr.bin/find/t_find                        tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/gdb                                tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/gdb/Atffile                        tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/gdb/Kyuafile               tests-usr.bin-tests     compattestfile,atf,kyua
+./usr/tests/usr.bin/gdb/t_regress              tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/grep                       tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/grep/Atffile               tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/grep/Kyuafile              tests-usr.bin-tests     compattestfile,atf,kyua
diff -r a554dfa50547 -r 4a1616f6c1cd etc/mtree/NetBSD.dist.tests
--- a/etc/mtree/NetBSD.dist.tests       Thu Apr 07 23:29:59 2016 +0000
+++ b/etc/mtree/NetBSD.dist.tests       Fri Apr 08 10:09:16 2016 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: NetBSD.dist.tests,v 1.125 2016/03/04 02:44:45 ozaki-r Exp $
+#      $NetBSD: NetBSD.dist.tests,v 1.126 2016/04/08 10:09:16 gson Exp $
 
 ./usr/libdata/debug/usr/tests
 ./usr/libdata/debug/usr/tests/atf
@@ -375,6 +375,7 @@
 ./usr/tests/usr.bin/diff
 ./usr/tests/usr.bin/dirname
 ./usr/tests/usr.bin/find
+./usr/tests/usr.bin/gdb
 ./usr/tests/usr.bin/grep
 ./usr/tests/usr.bin/gzip
 ./usr/tests/usr.bin/id
diff -r a554dfa50547 -r 4a1616f6c1cd tests/usr.bin/Makefile
--- a/tests/usr.bin/Makefile    Thu Apr 07 23:29:59 2016 +0000
+++ b/tests/usr.bin/Makefile    Fri Apr 08 10:09:16 2016 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.20 2014/11/14 09:03:39 uebayasi Exp $
+#      $NetBSD: Makefile,v 1.21 2016/04/08 10:09:16 gson Exp $
 #
 
 .include <bsd.own.mk>
@@ -6,7 +6,8 @@
 TESTSDIR=       ${TESTSBASE}/usr.bin
 
 TESTS_SUBDIRS= awk basename bzip2 cc cmp config cut \
-               diff dirname find grep gzip id infocmp jot ld m4 make mkdep \
+               diff dirname find gdb grep gzip id \
+               infocmp jot ld m4 make mkdep \
                nbperf netpgpverify pr rump_server shmif_dumpbus sdiff \
                sed sort tmux tr unifdef vmstat xlint
 
diff -r a554dfa50547 -r 4a1616f6c1cd tests/usr.bin/gdb/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/usr.bin/gdb/Makefile        Fri Apr 08 10:09:16 2016 +0000
@@ -0,0 +1,9 @@
+# $NetBSD: Makefile,v 1.1 2016/04/08 10:09:16 gson Exp $
+
+.include <bsd.own.mk>
+
+TESTSDIR=      ${TESTSBASE}/usr.bin/gdb
+
+TESTS_SH=      t_regress
+
+.include <bsd.test.mk>
diff -r a554dfa50547 -r 4a1616f6c1cd tests/usr.bin/gdb/t_regress.sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/usr.bin/gdb/t_regress.sh    Fri Apr 08 10:09:16 2016 +0000
@@ -0,0 +1,77 @@
+# $NetBSD: t_regress.sh,v 1.1 2016/04/08 10:09:16 gson Exp $
+#
+# Copyright (c) 2016 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+# Regression tests for some GDB PRs
+
+# PR 47430
+
+atf_test_case threads
+threads_head() {
+       atf_set "descr" "Test that gdb works with threaded programs"
+       atf_set "require.progs" "gdb"
+}
+threads_body() {
+       # Dig at an unused IP address so that dig fails the
+       # same way on machines with Internet connectivity
+       # as on those without.
+       cat <<EOF >test.gdb
+run +time=1 +tries=1 @127.0.0.177
+cont
+cont
+cont
+cont
+cont
+EOF
+       gdb --batch -x test.gdb dig >gdb.out
+       atf_check -s exit:1 -o ignore -e ignore grep "Program received signal SIGTRAP" gdb.out
+}
+
+# PR 48250
+
+atf_test_case pie
+pie_head() {
+       atf_set "descr" "Test that gdb works with PIE executables"
+       atf_set "require.progs" "cc gdb"
+}
+pie_body() {
+       cat <<\EOF >test.c
+#include <stdio.h>
+int main(int argc, char **argv) { printf ("hello\n"); return 0; }
+EOF
+       cc -fpie -pie -g test.c -o test
+       cat <<EOF >test.gdb
+break main
+run
+EOF
+       gdb --batch -x test.gdb ./test >gdb.out 2>&1
+       atf_check -s exit:1 -o ignore -e ignore grep "annot access memory" gdb.out
+}
+
+atf_init_test_cases() {
+       atf_add_test_case threads
+       atf_add_test_case pie
+}



Home | Main Index | Thread Index | Old Index