From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22105 invoked by alias); 31 Dec 2002 16:03:56 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 22098 invoked from network); 31 Dec 2002 16:03:55 -0000 Received: from unknown (HELO crack.them.org) (65.125.64.184) by 209.249.29.67 with SMTP; 31 Dec 2002 16:03:55 -0000 Received: from nevyn.them.org ([66.93.61.169] ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 18TQkS-00057F-00 for ; Tue, 31 Dec 2002 12:04:17 -0600 Received: from drow by nevyn.them.org with local (Exim 3.36 #1 (Debian)) id 18TOrp-0007dh-00 for ; Tue, 31 Dec 2002 11:03:45 -0500 Date: Tue, 31 Dec 2002 10:02:00 -0000 From: Daniel Jacobowitz To: gdb-patches@sources.redhat.com Subject: [RFA/testsuite] Suppress errors building thread tests Message-ID: <20021231160345.GA29311@nevyn.them.org> Mail-Followup-To: gdb-patches@sources.redhat.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.1i X-SW-Source: 2002-12/txt/msg00768.txt.bz2 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 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.*" {