Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFC][testsuite] Add option to link testcases with pthreads when using 'prepare_for_testing'
@ 2013-03-24 12:02 Siva Chandra
  2013-04-15  9:22 ` Tom Tromey
  0 siblings, 1 reply; 7+ messages in thread
From: Siva Chandra @ 2013-03-24 12:02 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 740 bytes --]

Hello,

The attached patch allows one to specify an option 'with_pthreads'
when using 'prepare_for_testing' in tests.  One could call
gdb_compile_pthreads directly for such a purpose, but I think using
'prepare_for_testing' is the suggested approach.  If my understanding
or approach is wrong here, then what is the best way to make testcases
to link with pthreads for c++ testcases?

2013-03-23  Siva Chandra Reddy  <sivachandra@google.com>

        Add option to link testcases with Pthreads library when
        using 'prepare_for_testing' in tests.

        testsuite/
        * lib/gdb.exp (build_executable_from_specs): Use
        gdb_compile_pthreads to compile if option "with_pthreads" is
        specified.

Thanks,
Siva Chandra

[-- Attachment #2: pthreads_option_patch.txt --]
[-- Type: text/plain, Size: 863 bytes --]

diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index ee9fdec..ab91cc5 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -3997,10 +3997,17 @@ proc build_executable_from_specs {testname executable options args} {
         lappend objects "${binfile}${i}.o"
 	incr i
     }
-    
-    if  { [gdb_compile $objects "${binfile}" executable $options] != "" } {
-        untested $testname
-        return -1
+
+    if { [lsearch -exact $options "with_pthreads"] >= 0 } {    
+        if  { [gdb_compile_pthreads $objects "${binfile}" executable $options] != "" } {
+            untested $testname
+            return -1
+        }
+    } else {
+        if  { [gdb_compile $objects "${binfile}" executable $options] != "" } {
+            untested $testname
+            return -1
+        }
     }
 
     set info_options ""

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-04-15 20:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-24 12:02 [RFC][testsuite] Add option to link testcases with pthreads when using 'prepare_for_testing' Siva Chandra
2013-04-15  9:22 ` Tom Tromey
2013-04-15 18:12   ` Siva Chandra
2013-04-15 18:51     ` Pedro Alves
2013-04-16  5:39       ` Siva Chandra
2013-04-16  5:47         ` Tom Tromey
2013-04-16  7:52           ` Siva Chandra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox