This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[commit] Enable macscp.exp tests


A toolchain I'm testing with (the SymbianOS SDK) defaults to -g3 for
debugging.  So it includes macro information and the tests in
macscp.exp start running.  There's a bug report and comments
explaining why some of the tests fail, and commented-out kfails...

So I've made the test always run for GCC and I've updated the kfails
so that everything passes and there are no spurious KPASSes.  Tested
on x86_64-linux, checked in.

-- 
Daniel Jacobowitz
CodeSourcery

2008-04-25  Daniel Jacobowitz  <dan@codesourcery.com>

	* gdb.base/macscp.exp: Enable kfails.  Compile with -g3 for GCC.
	(maybe_kfail): New.

Index: gdb.base/macscp.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/macscp.exp,v
retrieving revision 1.5
diff -u -p -r1.5 macscp.exp
--- gdb.base/macscp.exp	1 Jan 2008 22:53:19 -0000	1.5
+++ gdb.base/macscp.exp	25 Apr 2008 21:46:05 -0000
@@ -27,7 +27,14 @@ set bug_id 0
 set testfile "macscp"
 set binfile ${objdir}/${subdir}/${testfile}
 
-if  {[gdb_compile "${srcdir}/${subdir}/macscp1.c" "${binfile}" executable {debug}] != "" } {
+set options { debug }
+
+get_compiler_info ${binfile}
+if [test_compiler_info gcc*] {
+    lappend options additional_flags=-g3
+}
+
+if  {[gdb_compile "${srcdir}/${subdir}/macscp1.c" "${binfile}" executable $options] != "" } {
     untested macscp.exp
     return -1
 }
@@ -206,7 +213,7 @@ switch -exact -- [info_macro WHERE] {
         pass "info macro WHERE after `list macscp_4_2_from_macscp2'"
     }
     {macscp4.h macscp3.h macscp1.c {before macscp4_2_..., from macscp3.h}} {
-        # setup_kfail "gdb/555"
+        setup_kfail *-*-* "gdb/555"
         fail "info macro WHERE after `list macscp_4_2_from_macscp2' (gdb/555)"
     }
     timeout { 
@@ -221,7 +228,7 @@ switch -exact -- [info_macro WHERE] {
         pass "info macro WHERE after `list macscp_4_2_from_macscp3'"
     }
     {macscp4.h macscp2.h macscp1.c {before macscp4_2_..., from macscp2.h}} {
-        # setup_kfail "gdb/555"
+        setup_kfail *-*-* "gdb/555"
         fail "info macro WHERE after `list macscp_4_2_from_macscp3' (gdb/555)"
     }
     timeout {
@@ -295,6 +302,15 @@ set funcs {
     }
 }
 
+proc maybe_kfail { func test_name } {
+    # We can't get the right scope info when we're stopped in
+    # the macro4_ functions.
+    if {[string match macscp4_* $func]} {
+	kfail gdb/555 "$test_name"
+    } else {
+	fail "$test_name"
+    }
+}
 
 # Start the program running.
 if {! [runto_main]} {
@@ -324,7 +340,7 @@ for {set i 0} {$i < [llength $funcs]} {i
     if {[string compare $result $expected] == 0} {
         pass "info macro WHERE stopped in $func"
     } elseif {[string compare $result $kfail_expected] == 0} {
-        # setup_kfail "gdb/555"
+        setup_kfail *-*-* "gdb/555"
         fail "info macro WHERE stopped in $func (gdb/555)"
     } elseif {[string compare $result timeout] == 0} {
         fail "info macro WHERE stopped in $func (timeout)"
@@ -344,12 +360,6 @@ for {set i 0} {$i < [llength $funcs]} {i
                     "$before_macro defined/undefined when stopped at $func"
             set result [info_macro $before_macro]
 
-            # We can't get the right scope info when we're stopped in
-            # the macro4_ functions.
-            if {[string match macscp4_* $func]} {
-                # setup_kfail "gdb/555"
-                set test_name "$test_name (gdb/555)"
-            }
             if {$j < $i} {
                 if {[llength $result] >= 2 && \
                         [string compare [lindex $result end] {}] == 0} {
@@ -357,14 +367,14 @@ for {set i 0} {$i < [llength $funcs]} {i
                 } elseif {[string compare $result timeout] == 0} {
                     fail "$test_name (timeout)"
                 } else {
-                    fail "$test_name"
+                    maybe_kfail $func "$test_name"
                 }
             } elseif {$j > $i} {
                 switch -- [lindex $result end] {
                     undefined { pass $test_name }
                     timeout { fail "$test_name (timeout)" }
                     default { 
-                        fail "$test_name"
+                        maybe_kfail $func "$test_name"
                     }
                 }
             }
@@ -374,18 +384,12 @@ for {set i 0} {$i < [llength $funcs]} {i
                     "$until_macro defined/undefined when stopped at $func"
             set result [info_macro $until_macro]
 
-            # We can't get the right scope info when we're stopped in
-            # the macro4_ functions.
-            if {[string match macscp4_* $func]} {
-                # setup_kfail "gdb/555"
-                set test_name "$test_name (gdb/555)"
-            }
             if {$j <= $i} {
                 switch -- [lindex $result end] {
                     undefined { pass $test_name }
                     timeout { fail "$test_name (timeout)" }
                     default { 
-                        fail "$test_name"
+                        maybe_kfail $func "$test_name"
                     }
                 }
             } elseif {$j > $i} {
@@ -395,7 +399,7 @@ for {set i 0} {$i < [llength $funcs]} {i
                 } elseif {[string compare $result timeout] == 0} {
                     fail "$test_name (timeout)"
                 } else {
-                    fail "$test_name"
+                    maybe_kfail $func "$test_name"
                 }
             }
         }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]