* [RFA/testsuite] Suppress errors building thread tests
@ 2002-12-31 10:02 Daniel Jacobowitz
0 siblings, 0 replies; 4+ messages in thread
From: Daniel Jacobowitz @ 2002-12-31 10:02 UTC (permalink / raw)
To: gdb-patches
This patch suppresses the compiler/linker's error messages when we're
probing for a threads library, by adding a "quiet" option to gdb_compile.
Tested i386-linux, no surprises, and no noise. I also convert the other
copies of gdb_compile_pthreads into users of the copy in gdb.exp.
Note the use of gdb_suppress_entire_file. I'm just doing that because it's
what the other tests do; I really dislike gdb_suppress_entire_file, so I
think I may send along a followup patch to change it to a "return -1".
gdb_compile_pthreads already does an "unsupported" if compilation fails. If
we can't build the threads tests, there's no point in FAILing them, in my
opinion; this clutters up results when I run simulator testing. Thoughts?
Is this OK?
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
2002-12-31 Daniel Jacobowitz <drow@mvista.com>
Fix PR gdb/844
* lib/gdb.exp (gdb_compile): Handle "quiet" option.
(gdb_compile_pthreads): Pass "quiet" to gdb_compile.
* gdb.threads/gcore-thread.exp: Use gdb_compile_pthreads.
* gdb.threads/print-threads.exp: Likewise.
* gdb.threads/schedlock.exp: Likewise.
Index: testsuite/gdb.threads/gcore-thread.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.threads/gcore-thread.exp,v
retrieving revision 1.1
diff -u -p -r1.1 gcore-thread.exp
--- testsuite/gdb.threads/gcore-thread.exp 9 Jan 2002 00:37:41 -0000 1.1
+++ testsuite/gdb.threads/gcore-thread.exp 31 Dec 2002 15:56:06 -0000
@@ -32,39 +32,14 @@ set testfile "pthreads"
set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
-set built_binfile 0
if [istarget "*-*-linux"] then {
set target_cflags "-D_MIT_POSIX_THREADS"
} else {
set target_cflags ""
}
-set why_msg "unrecognized error"
-foreach lib {-lpthreads -lpthread -lthread} {
- set options "debug"
- lappend options "incdir=${objdir}/${subdir}"
- lappend options "libs=$lib"
- set ccout [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable $options]
- switch -regexp -- $ccout {
- ".*no posix threads support.*" {
- set why_msg "missing threads include file"
- break
- }
- ".*cannot open -lpthread.*" {
- set why_msg "missing runtime threads library"
- }
- ".*Can't find library for -lpthread.*" {
- set why_msg "missing runtime threads library"
- }
- {^$} {
- pass "successfully compiled posix threads test case"
- set built_binfile 1
- break
- }
- }
-}
-if {$built_binfile == "0"} {
- unsupported "Couldn't compile ${srcfile}, ${why_msg}"
- return -1
+
+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "incdir=${objdir}/${subdir}"]] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
# Now we can proceed with the real testing.
Index: testsuite/gdb.threads/print-threads.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.threads/print-threads.exp,v
retrieving revision 1.1
diff -u -p -r1.1 print-threads.exp
--- testsuite/gdb.threads/print-threads.exp 23 Aug 2002 20:32:02 -0000 1.1
+++ testsuite/gdb.threads/print-threads.exp 31 Dec 2002 15:56:06 -0000
@@ -38,42 +38,8 @@ set binfile ${objdir}/${subdir}/${testfi
# carriage return)
set horiz "\[^\n\r\]*"
-set built_binfile 0
-
-# Default to the usual (only?) -lpthread on GNU/Linux to quiet noise
-if [istarget "*-*-linux*"] then {
- set possible_libs "-lpthread -lpthreads -lthread"
-} else {
- set possible_libs "-lpthreads -lpthread -lthread"
-}
-
-set why_msg "unrecognized error"
-foreach lib $possible_libs {
- set options "debug"
- lappend options "incdir=${objdir}/${subdir}"
- lappend options "libs=$lib"
- set ccout [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable $options]
- switch -regexp -- $ccout {
- ".*no posix threads support.*" {
- set why_msg "missing threads include file"
- break
- }
- ".*cannot open -lpthread.*" {
- set why_msg "missing runtime threads library"
- }
- ".*Can't find library for -lpthread.*" {
- set why_msg "missing runtime threads library"
- }
- {^$} {
- pass "successfully compiled posix threads test case"
- set built_binfile 1
- break
- }
- }
-}
-if {$built_binfile == "0"} {
- unsupported "Couldn't compile ${srcfile}, ${why_msg}"
- return -1
+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "incdir=${objdir}/${subdir}"]] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
# Now we can proceed with the real testing.
Index: testsuite/gdb.threads/schedlock.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.threads/schedlock.exp,v
retrieving revision 1.1
diff -u -p -r1.1 schedlock.exp
--- testsuite/gdb.threads/schedlock.exp 23 Aug 2002 20:32:02 -0000 1.1
+++ testsuite/gdb.threads/schedlock.exp 31 Dec 2002 15:56:06 -0000
@@ -33,42 +33,8 @@ set testfile "schedlock"
set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
-set built_binfile 0
-
-# Default to the usual (only?) -lpthread on GNU/Linux to quiet noise
-if [istarget "*-*-linux*"] then {
- set possible_libs "-lpthread -lpthreads -lthread"
-} else {
- set possible_libs "-lpthreads -lpthread -lthread"
-}
-
-set why_msg "unrecognized error"
-foreach lib $possible_libs {
- set options "debug"
- lappend options "incdir=${objdir}/${subdir}"
- lappend options "libs=$lib"
- set ccout [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable $options]
- switch -regexp -- $ccout {
- ".*no posix threads support.*" {
- set why_msg "missing threads include file"
- break
- }
- ".*cannot open -lpthread.*" {
- set why_msg "missing runtime threads library"
- }
- ".*Can't find library for -lpthread.*" {
- set why_msg "missing runtime threads library"
- }
- {^$} {
- pass "successfully compiled posix threads test case"
- set built_binfile 1
- break
- }
- }
-}
-if {$built_binfile == "0"} {
- unsupported "Couldn't compile ${srcfile}, ${why_msg}"
- return -1
+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "incdir=${objdir}/${subdir}"]] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
# Now we can proceed with the real testing.
Index: testsuite/lib/gdb.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/lib/gdb.exp,v
retrieving revision 1.30
diff -u -p -r1.30 gdb.exp
--- testsuite/lib/gdb.exp 16 Dec 2002 19:33:54 -0000 1.30
+++ testsuite/lib/gdb.exp 31 Dec 2002 15:56:06 -0000
@@ -1134,7 +1134,7 @@ proc gdb_compile {source dest type optio
set result [target_compile $source $dest $type $options];
regsub "\[\r\n\]*$" "$result" "" result;
regsub "^\[\r\n\]*" "$result" "" result;
- if { $result != "" } {
+ if { $result != "" && [lsearch $options quiet] == -1} {
clone_output "gdb compile failed, $result"
}
return $result;
@@ -1150,7 +1150,7 @@ proc gdb_compile_pthreads {source dest t
foreach lib {-lpthreads -lpthread -lthread} {
# This kind of wipes out whatever libs the caller may have
# set. Or maybe theirs will override ours. How infelicitous.
- set options_with_lib [concat $options [list libs=$lib]]
+ set options_with_lib [concat $options [list libs=$lib quiet]]
set ccout [gdb_compile $source $dest $type $options_with_lib]
switch -regexp -- $ccout {
".*no posix threads support.*" {
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [RFA/testsuite] Suppress errors building thread tests
@ 2002-12-31 13:31 Michael Elizabeth Chastain
2003-01-02 19:58 ` Michael Snyder
0 siblings, 1 reply; 4+ messages in thread
From: Michael Elizabeth Chastain @ 2002-12-31 13:31 UTC (permalink / raw)
To: drow, gdb-patches
Recommended for self-approval by Daniel J.
Proofread and tested. All the pthreads library noise is gone
from gdb.sum. The results for gcore-thread.exp, print-threads.exp,
and schedlock.exp are fine.
> Note the use of gdb_suppress_entire_file. I'm just doing that because it's
> what the other tests do; I really dislike gdb_suppress_entire_file, so I
> think I may send along a followup patch to change it to a "return -1".
> gdb_compile_pthreads already does an "unsupported" if compilation fails. If
> we can't build the threads tests, there's no point in FAILing them, in my
> opinion; this clutters up results when I run simulator testing. Thoughts?
I'm with you. If compilation+linking fails, I am fine with one
UNSUPPORTED per test script. It would be even better if the UNSUPPORTED's
come from a known unsupported list rather than dynamic conditions.
Michael C
===
2002-12-31 Daniel Jacobowitz <drow@mvista.com>
Fix PR gdb/844
* lib/gdb.exp (gdb_compile): Handle "quiet" option.
(gdb_compile_pthreads): Pass "quiet" to gdb_compile.
* gdb.threads/gcore-thread.exp: Use gdb_compile_pthreads.
* gdb.threads/print-threads.exp: Likewise.
* gdb.threads/schedlock.exp: Likewise.
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [RFA/testsuite] Suppress errors building thread tests 2002-12-31 13:31 Michael Elizabeth Chastain @ 2003-01-02 19:58 ` Michael Snyder 2003-01-04 23:06 ` Daniel Jacobowitz 0 siblings, 1 reply; 4+ messages in thread From: Michael Snyder @ 2003-01-02 19:58 UTC (permalink / raw) To: Michael Elizabeth Chastain; +Cc: drow, gdb-patches Michael Elizabeth Chastain wrote: > > Recommended for self-approval by Daniel J. > > Proofread and tested. All the pthreads library noise is gone > from gdb.sum. The results for gcore-thread.exp, print-threads.exp, > and schedlock.exp are fine. > > > Note the use of gdb_suppress_entire_file. I'm just doing that because it's > > what the other tests do; I really dislike gdb_suppress_entire_file, so I > > think I may send along a followup patch to change it to a "return -1". > > gdb_compile_pthreads already does an "unsupported" if compilation fails. If > > we can't build the threads tests, there's no point in FAILing them, in my > > opinion; this clutters up results when I run simulator testing. Thoughts? > > I'm with you. If compilation+linking fails, I am fine with one > UNSUPPORTED per test script. It would be even better if the UNSUPPORTED's > come from a known unsupported list rather than dynamic conditions. > > Michael C Ditto. Michael S. ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [RFA/testsuite] Suppress errors building thread tests 2003-01-02 19:58 ` Michael Snyder @ 2003-01-04 23:06 ` Daniel Jacobowitz 0 siblings, 0 replies; 4+ messages in thread From: Daniel Jacobowitz @ 2003-01-04 23:06 UTC (permalink / raw) To: gdb-patches On Thu, Jan 02, 2003 at 11:58:14AM -0800, Michael Snyder wrote: > Michael Elizabeth Chastain wrote: > > > > Recommended for self-approval by Daniel J. > > > > Proofread and tested. All the pthreads library noise is gone > > from gdb.sum. The results for gcore-thread.exp, print-threads.exp, > > and schedlock.exp are fine. > > > > > Note the use of gdb_suppress_entire_file. I'm just doing that because it's > > > what the other tests do; I really dislike gdb_suppress_entire_file, so I > > > think I may send along a followup patch to change it to a "return -1". > > > gdb_compile_pthreads already does an "unsupported" if compilation fails. If > > > we can't build the threads tests, there's no point in FAILing them, in my > > > opinion; this clutters up results when I run simulator testing. Thoughts? > > > > I'm with you. If compilation+linking fails, I am fine with one > > UNSUPPORTED per test script. It would be even better if the UNSUPPORTED's > > come from a known unsupported list rather than dynamic conditions. > > > > Michael C > > Ditto. OK. I've committed this instead; works like a charm, tested with and without threads support. -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer 2003-01-04 Daniel Jacobowitz <drow@mvista.com> Fix PR gdb/844 * lib/gdb.exp (gdb_compile): Handle "quiet" option. (gdb_compile_pthreads): Pass "quiet" to gdb_compile. * gdb.threads/gcore-thread.exp: Use gdb_compile_pthreads. Return instead of calling gdb_suppress_entire_file. * gdb.threads/print-threads.exp: Likewise. * gdb.threads/schedlock.exp: Likewise. * gdb.threads/killed.exp: Return instead of calling gdb_suppress_entire_file. * gdb.threads/linux-dp.exp: Likewise. * gdb.threads/pthreads.exp: Likewise. Index: gdb.threads/gcore-thread.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.threads/gcore-thread.exp,v retrieving revision 1.2 diff -u -p -r1.2 gcore-thread.exp --- gdb.threads/gcore-thread.exp 4 Jan 2003 15:37:40 -0000 1.2 +++ gdb.threads/gcore-thread.exp 4 Jan 2003 23:03:01 -0000 @@ -1,4 +1,4 @@ -# Copyright 2002 Free Software Foundation, Inc. +# Copyright 2002, 2003 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -32,38 +32,13 @@ set testfile "pthreads" set srcfile ${testfile}.c set binfile ${objdir}/${subdir}/${testfile} -set built_binfile 0 if [istarget "*-*-linux"] then { set target_cflags "-D_MIT_POSIX_THREADS" } else { set target_cflags "" } -set why_msg "unrecognized error" -foreach lib {-lpthreads -lpthread -lthread} { - set options "debug" - lappend options "incdir=${objdir}" - lappend options "libs=$lib" - set ccout [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable $options] - switch -regexp -- $ccout { - ".*no posix threads support.*" { - set why_msg "missing threads include file" - break - } - ".*cannot open -lpthread.*" { - set why_msg "missing runtime threads library" - } - ".*Can't find library for -lpthread.*" { - set why_msg "missing runtime threads library" - } - {^$} { - pass "successfully compiled posix threads test case" - set built_binfile 1 - break - } - } -} -if {$built_binfile == "0"} { - unsupported "Couldn't compile ${srcfile}, ${why_msg}" + +if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "incdir=${objdir}"]] != "" } { return -1 } Index: gdb.threads/killed.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.threads/killed.exp,v retrieving revision 1.3 diff -u -p -r1.3 killed.exp --- gdb.threads/killed.exp 4 Jan 2003 15:37:40 -0000 1.3 +++ gdb.threads/killed.exp 4 Jan 2003 23:03:01 -0000 @@ -67,7 +67,7 @@ set srcfile ${testfile}.c set binfile ${objdir}/${subdir}/${testfile} if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "incdir=${objdir}"]] != "" } { - gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." + return -1 } Index: gdb.threads/linux-dp.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.threads/linux-dp.exp,v retrieving revision 1.7 diff -u -p -r1.7 linux-dp.exp --- gdb.threads/linux-dp.exp 24 Apr 2002 22:11:28 -0000 1.7 +++ gdb.threads/linux-dp.exp 4 Jan 2003 23:03:01 -0000 @@ -1,4 +1,4 @@ -# Copyright 1999, 2001, 2002 Free Software Foundation, Inc. +# Copyright 1999, 2001, 2002, 2003 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -50,7 +50,7 @@ set testfile "linux-dp" set srcfile ${testfile}.c set binfile ${objdir}/${subdir}/${testfile} if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug libs=-lpthread}] != ""} { - gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." + return -1 } gdb_start Index: gdb.threads/print-threads.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.threads/print-threads.exp,v retrieving revision 1.2 diff -u -p -r1.2 print-threads.exp --- gdb.threads/print-threads.exp 4 Jan 2003 15:37:40 -0000 1.2 +++ gdb.threads/print-threads.exp 4 Jan 2003 23:03:01 -0000 @@ -38,41 +38,7 @@ set binfile ${objdir}/${subdir}/${testfi # carriage return) set horiz "\[^\n\r\]*" -set built_binfile 0 - -# Default to the usual (only?) -lpthread on GNU/Linux to quiet noise -if [istarget "*-*-linux*"] then { - set possible_libs "-lpthread -lpthreads -lthread" -} else { - set possible_libs "-lpthreads -lpthread -lthread" -} - -set why_msg "unrecognized error" -foreach lib $possible_libs { - set options "debug" - lappend options "incdir=${objdir}" - lappend options "libs=$lib" - set ccout [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable $options] - switch -regexp -- $ccout { - ".*no posix threads support.*" { - set why_msg "missing threads include file" - break - } - ".*cannot open -lpthread.*" { - set why_msg "missing runtime threads library" - } - ".*Can't find library for -lpthread.*" { - set why_msg "missing runtime threads library" - } - {^$} { - pass "successfully compiled posix threads test case" - set built_binfile 1 - break - } - } -} -if {$built_binfile == "0"} { - unsupported "Couldn't compile ${srcfile}, ${why_msg}" +if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "incdir=${objdir}"]] != "" } { return -1 } Index: gdb.threads/pthreads.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.threads/pthreads.exp,v retrieving revision 1.9 diff -u -p -r1.9 pthreads.exp --- gdb.threads/pthreads.exp 4 Jan 2003 15:37:40 -0000 1.9 +++ gdb.threads/pthreads.exp 4 Jan 2003 23:03:01 -0000 @@ -46,7 +46,7 @@ if [istarget "*-*-linux"] then { } if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "incdir=${objdir}"]] != "" } { - gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." + return -1 } Index: gdb.threads/schedlock.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.threads/schedlock.exp,v retrieving revision 1.2 diff -u -p -r1.2 schedlock.exp --- gdb.threads/schedlock.exp 4 Jan 2003 15:37:40 -0000 1.2 +++ gdb.threads/schedlock.exp 4 Jan 2003 23:03:01 -0000 @@ -33,41 +33,7 @@ set testfile "schedlock" set srcfile ${testfile}.c set binfile ${objdir}/${subdir}/${testfile} -set built_binfile 0 - -# Default to the usual (only?) -lpthread on GNU/Linux to quiet noise -if [istarget "*-*-linux*"] then { - set possible_libs "-lpthread -lpthreads -lthread" -} else { - set possible_libs "-lpthreads -lpthread -lthread" -} - -set why_msg "unrecognized error" -foreach lib $possible_libs { - set options "debug" - lappend options "incdir=${objdir}" - lappend options "libs=$lib" - set ccout [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable $options] - switch -regexp -- $ccout { - ".*no posix threads support.*" { - set why_msg "missing threads include file" - break - } - ".*cannot open -lpthread.*" { - set why_msg "missing runtime threads library" - } - ".*Can't find library for -lpthread.*" { - set why_msg "missing runtime threads library" - } - {^$} { - pass "successfully compiled posix threads test case" - set built_binfile 1 - break - } - } -} -if {$built_binfile == "0"} { - unsupported "Couldn't compile ${srcfile}, ${why_msg}" +if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "incdir=${objdir}"]] != "" } { return -1 } Index: lib/gdb.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/lib/gdb.exp,v retrieving revision 1.30 diff -u -p -r1.30 gdb.exp --- lib/gdb.exp 16 Dec 2002 19:33:54 -0000 1.30 +++ lib/gdb.exp 4 Jan 2003 23:03:01 -0000 @@ -1,4 +1,5 @@ -# Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 +# Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, +# 2002, 2003 # Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify @@ -1134,7 +1135,7 @@ proc gdb_compile {source dest type optio set result [target_compile $source $dest $type $options]; regsub "\[\r\n\]*$" "$result" "" result; regsub "^\[\r\n\]*" "$result" "" result; - if { $result != "" } { + if { $result != "" && [lsearch $options quiet] == -1} { clone_output "gdb compile failed, $result" } return $result; @@ -1150,7 +1151,7 @@ proc gdb_compile_pthreads {source dest t foreach lib {-lpthreads -lpthread -lthread} { # This kind of wipes out whatever libs the caller may have # set. Or maybe theirs will override ours. How infelicitous. - set options_with_lib [concat $options [list libs=$lib]] + set options_with_lib [concat $options [list libs=$lib quiet]] set ccout [gdb_compile $source $dest $type $options_with_lib] switch -regexp -- $ccout { ".*no posix threads support.*" { ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2003-01-04 23:06 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2002-12-31 10:02 [RFA/testsuite] Suppress errors building thread tests Daniel Jacobowitz 2002-12-31 13:31 Michael Elizabeth Chastain 2003-01-02 19:58 ` Michael Snyder 2003-01-04 23:06 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox