This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] Skip tests early if needed.
- From: Yao Qi <yao at codesourcery dot com>
- To: <gdb-patches at sourceware dot org>
- Date: Fri, 27 Apr 2012 21:55:36 +0800
- Subject: [PATCH] Skip tests early if needed.
Hi,
I happen to see some checking like this below is after test case
compilation.
if {![istarget "hppa*-hp-hpux*"] && ![istarget "*-linux*"]} then {
continue
}
It wasts time compiling test case that will be skipped later. This patch
is to move these kinds of checking at the beginning of *.exp file.
It is obvious, and I'll commit it in two or three days.
gdb/testsuite:
2012-04-27 Yao Qi <yao@codesourcery.com>
* gdb.base/catch-syscall.exp: Skip it before compilation if target
doesn't support.
* gdb.base/foll-exec.exp, gdb.base/foll-fork.exp: Likewise.
* gdb.base/foll-vfork.exp, gdb.multi/bkpt-multi-exec.exp: Likewise.
---
gdb/testsuite/gdb.base/catch-syscall.exp | 29 ++++++++++++-------------
gdb/testsuite/gdb.base/foll-exec.exp | 12 ++++------
gdb/testsuite/gdb.base/foll-fork.exp | 15 +++++--------
gdb/testsuite/gdb.base/foll-vfork.exp | 30 ++++++++++++--------------
gdb/testsuite/gdb.multi/bkpt-multi-exec.exp | 11 +++++----
5 files changed, 45 insertions(+), 52 deletions(-)
diff --git a/gdb/testsuite/gdb.base/catch-syscall.exp b/gdb/testsuite/gdb.base/catch-syscall.exp
index 1a7a605..9054cfe 100644
--- a/gdb/testsuite/gdb.base/catch-syscall.exp
+++ b/gdb/testsuite/gdb.base/catch-syscall.exp
@@ -24,6 +24,20 @@ if { [is_remote target] || ![isnative] } then {
continue
}
+# Until "catch syscall" is implemented on other targets...
+if {![istarget "hppa*-hp-hpux*"] && ![istarget "*-linux*"]} then {
+ continue
+}
+
+# This shall be updated whenever 'catch syscall' is implemented
+# on some architecture.
+#if { ![istarget "i\[34567\]86-*-linux*"]
+if { ![istarget "x86_64-*-linux*"] && ![istarget "i\[34567\]86-*-linux*"]
+ && ![istarget "powerpc-*-linux*"] && ![istarget "powerpc64-*-linux*"]
+ && ![istarget "sparc-*-linux*"] && ![istarget "sparc64-*-linux*"]
+ && ![istarget "mips*-linux*"] } {
+ continue
+}
global srcfile
set testfile "catch-syscall"
@@ -44,21 +58,6 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
return -1
}
-# Until "catch syscall" is implemented on other targets...
-if {![istarget "hppa*-hp-hpux*"] && ![istarget "*-linux*"]} then {
- continue
-}
-
-# This shall be updated whenever 'catch syscall' is implemented
-# on some architecture.
-#if { ![istarget "i\[34567\]86-*-linux*"]
-if { ![istarget "x86_64-*-linux*"] && ![istarget "i\[34567\]86-*-linux*"]
- && ![istarget "powerpc-*-linux*"] && ![istarget "powerpc64-*-linux*"]
- && ![istarget "sparc-*-linux*"] && ![istarget "sparc64-*-linux*"]
- && ![istarget "mips*-linux*"] } {
- continue
-}
-
# Internal procedure used to check if, after issuing a 'catch syscall'
# command (without arguments), the 'info breakpoints' command displays
# that '"any syscall"' is to be caught.
diff --git a/gdb/testsuite/gdb.base/foll-exec.exp b/gdb/testsuite/gdb.base/foll-exec.exp
index 41e5732..5ab3ebc 100644
--- a/gdb/testsuite/gdb.base/foll-exec.exp
+++ b/gdb/testsuite/gdb.base/foll-exec.exp
@@ -17,6 +17,11 @@ if { [is_remote target] || ![isnative] } then {
continue
}
+# Until "catch exec" is implemented on other targets...
+#
+if {![istarget "hppa*-hp-hpux*"] && ![istarget "*-linux*"]} then {
+ continue
+}
set testfile "foll-exec"
set testfile2 "execd-prog"
@@ -36,13 +41,6 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
return -1
}
-
-# Until "catch exec" is implemented on other targets...
-#
-if {![istarget "hppa*-hp-hpux*"] && ![istarget "*-linux*"]} then {
- continue
-}
-
proc zap_session {} {
global gdb_prompt
global binfile
diff --git a/gdb/testsuite/gdb.base/foll-fork.exp b/gdb/testsuite/gdb.base/foll-fork.exp
index 8299a79..c399c4d 100644
--- a/gdb/testsuite/gdb.base/foll-fork.exp
+++ b/gdb/testsuite/gdb.base/foll-fork.exp
@@ -17,6 +17,12 @@ if { [is_remote target] || ![isnative] } then {
continue
}
+# Until "set follow-fork-mode" and "catch fork" are implemented on
+# other targets...
+#
+if {![istarget "hppa*-hp-hpux*"] && ![istarget "*-linux*"]} then {
+ continue
+}
global srcfile
set testfile "foll-fork"
@@ -28,15 +34,6 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
return -1
}
-
-
-# Until "set follow-fork-mode" and "catch fork" are implemented on
-# other targets...
-#
-if {![istarget "hppa*-hp-hpux*"] && ![istarget "*-linux*"]} then {
- continue
-}
-
proc check_fork_catchpoints {} {
global gdb_prompt
diff --git a/gdb/testsuite/gdb.base/foll-vfork.exp b/gdb/testsuite/gdb.base/foll-vfork.exp
index e0c8950..7a3c04e 100644
--- a/gdb/testsuite/gdb.base/foll-vfork.exp
+++ b/gdb/testsuite/gdb.base/foll-vfork.exp
@@ -17,6 +17,20 @@ if { [is_remote target] || ![isnative] } then {
continue
}
+# Until "set follow-fork-mode" and "catch vfork" are implemented on
+# other targets...
+#
+if {![istarget "hppa*-hp-hpux*"] && ![istarget "*-linux*"]} then {
+ continue
+}
+
+# Test to see if we are on an HP-UX 10.20 and if so,
+# do not run these tests as catching vfork is disabled for
+# 10.20.
+
+if [istarget "hppa*-hp-hpux10.20"] then {
+ return 0
+}
# NOTE drow/2002-12-06: I don't know what the referenced kernel problem
# is, but it appears to be fixed in recent HP/UX versions.
@@ -44,22 +58,6 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile2}" "${binfile2}" executable {d
return -1
}
-
-# Until "set follow-fork-mode" and "catch vfork" are implemented on
-# other targets...
-#
-if {![istarget "hppa*-hp-hpux*"] && ![istarget "*-linux*"]} then {
- continue
-}
-
-# Test to see if we are on an HP-UX 10.20 and if so,
-# do not run these tests as catching vfork is disabled for
-# 10.20.
-
-if [istarget "hppa*-hp-hpux10.20"] then {
- return 0
-}
-
# A few of these tests require a little more time than the standard
# timeout allows.
set oldtimeout $timeout
diff --git a/gdb/testsuite/gdb.multi/bkpt-multi-exec.exp b/gdb/testsuite/gdb.multi/bkpt-multi-exec.exp
index 9705cc8..3893a79 100644
--- a/gdb/testsuite/gdb.multi/bkpt-multi-exec.exp
+++ b/gdb/testsuite/gdb.multi/bkpt-multi-exec.exp
@@ -17,6 +17,12 @@ if { [is_remote target] || ![isnative] } then {
continue
}
+# Until "catch exec" is implemented on other targets...
+#
+if {![istarget "hppa*-hp-hpux*"] && ![istarget "*-linux*"]} then {
+ continue
+}
+
set testfile "bkpt-multi-exec"
set exec1 "bkpt-multi-exec"
@@ -34,11 +40,6 @@ if { [prepare_for_testing ${testfile}.exp ${exec1} "${srcfile1}" {debug nowarnin
if { [prepare_for_testing ${testfile}.exp ${exec2} "${srcfile2}" {debug nowarnings}] } {
return -1
}
-# Until "catch exec" is implemented on other targets...
-#
-if {![istarget "hppa*-hp-hpux*"] && ![istarget "*-linux*"]} then {
- continue
-}
# Start with a fresh gdb
--
1.7.0.4