aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.threads
diff options
context:
space:
mode:
authorJim Blandy <jimb@codesourcery.com>2002-08-29 22:36:52 +0000
committerJim Blandy <jimb@codesourcery.com>2002-08-29 22:36:52 +0000
commitb6ff0e81ff1a74f6471c6a731334adca46e7d956 (patch)
treef2dcd08a4007a9f7e28ddefe2ee00f64d8d5fb7a /gdb/testsuite/gdb.threads
parent66609862575ac6e46dc1040bd9e58b3153a1355e (diff)
downloadgdb-b6ff0e81ff1a74f6471c6a731334adca46e7d956.zip
gdb-b6ff0e81ff1a74f6471c6a731334adca46e7d956.tar.gz
gdb-b6ff0e81ff1a74f6471c6a731334adca46e7d956.tar.bz2
* gdb.threads/pthreads.exp: Move the portable thread compilation
code into a function in lib/gdb.exp, and call that from here. * lib/gdb.exp (gdb_compile_pthreads): New function.
Diffstat (limited to 'gdb/testsuite/gdb.threads')
-rw-r--r--gdb/testsuite/gdb.threads/pthreads.exp32
1 files changed, 3 insertions, 29 deletions
diff --git a/gdb/testsuite/gdb.threads/pthreads.exp b/gdb/testsuite/gdb.threads/pthreads.exp
index 0703395..dc9b7a8 100644
--- a/gdb/testsuite/gdb.threads/pthreads.exp
+++ b/gdb/testsuite/gdb.threads/pthreads.exp
@@ -39,42 +39,16 @@ set binfile ${objdir}/${subdir}/${testfile}
# carriage return)
set horiz "\[^\n\r\]*"
-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.
# Start with a fresh gdb.