This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
dejagnu patch for XML output
- From: bemis <bemis at iol dot unh dot edu>
- To: "dejagnu at gnu dot org" <dejagnu at gnu dot org>, gdb at sources dot redhat dot com, Rob Savoye <rob at welcomehome dot org>
- Date: Tue, 22 Oct 2002 18:05:14 -0400
- Subject: dejagnu patch for XML output
- Organization: University of New Hampshire
this is a patch for runtest -x
I have attached the patch and a the calc.xml generated from runtest -x
Matt Bemis
<?xml version="1.0"?>
<!DOCTYPE testsuite [
<!-- testsuite.dtd -->
<!ELEMENT testsuite (test | summary)+>
<!ELEMENT test (input, output, result, name, prms_id )>
<!ELEMENT input (#PCDATA)>
<!ELEMENT output (#PCDATA)>
<!ELEMENT result (#PCDATA)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT prms_id (#PCDATA)>
<!ELEMENT summary (result, description, total)>
<!ELEMENT description (#PCDATA)>
<!ELEMENT total (#PCDATA)>
]>
<testsuite>
<test>
<input>version</input>
<output>Version: 1.1</output>
<result>PASS</result>
<name>version</name>
<prms_id>0</prms_id>
</test>
<test>
<input>add 3 4</input>
<output>7</output>
<result>PASS</result>
<name>add1</name>
<prms_id>0</prms_id>
</test>
<test>
<input>add 1 2 3</input>
<output>Usage: add #1 #2</output>
<result>PASS</result>
<name>add2</name>
<prms_id>0</prms_id>
</test>
<test>
<input>multiply 3 4</input>
<output>12</output>
<result>PASS</result>
<name>multiply1</name>
<prms_id>0</prms_id>
</test>
<test>
<input>multiply 2 4</input>
<output>12</output>
<result>FAIL</result>
<name>multiply2 (bad match)</name>
<prms_id>0</prms_id>
</test>
<test>
<input>multiply 1 2 3</input>
<output>Usage: multiply #1 #2</output>
<result>PASS</result>
<name>multiply3</name>
<prms_id>0</prms_id>
</test>
<summary>
<result>PASS</result>
<description># of expected passes</description>
<total>5</total>
</summary>
<summary>
<result>FAIL</result>
<description># of unexpected failures</description>
<total>1</total>
</summary>
</testsuite>
diff -urN dejagnu-1.4.3-orig/ChangeLog dejagnu-1.4.3-dev-fresh/ChangeLog
--- dejagnu-1.4.3-orig/ChangeLog Wed Sep 4 19:24:20 2002
+++ dejagnu-1.4.3-dev-fresh/ChangeLog Tue Oct 22 16:18:26 2002
@@ -1,3 +1,7 @@
+2002-10-21 Matt Bemis <bemis@iol.unh.edu>
+ * added input/output to xml_output in lib/framework.exp
+ * removed the log feature replaced by input/output_xml
+
2002-09-04 Rob Savoye <rob@welcomehome.org>
* Clean.tcl (cleanfiles): Add more patterns to remove.
@@ -5959,4 +5963,4 @@
Wed Jun 5 14:52:15 PDT 2002 Joey Ekstrom <joey@ekstrom.org>
* dejagnu.h: modfied C functions to behave like printf.
-
\ No newline at end of file
+
diff -urN dejagnu-1.4.3-orig/lib/framework.exp dejagnu-1.4.3-dev-fresh/lib/framework.exp
--- dejagnu-1.4.3-orig/lib/framework.exp Sat Aug 31 01:46:16 2002
+++ dejagnu-1.4.3-dev-fresh/lib/framework.exp Tue Oct 22 17:45:09 2002
@@ -48,12 +48,13 @@
xml_output "<!DOCTYPE testsuite \[
<!-- testsuite.dtd -->
<!ELEMENT testsuite (test | summary)+>
-<!ELEMENT test (log, result, name, prms_id )>
- <!ELEMENT log (#PCDATA)>
+<!ELEMENT test (input, output, result, name, prms_id )>
+ <!ELEMENT input (#PCDATA)>
+ <!ELEMENT output (#PCDATA)>
<!ELEMENT result (#PCDATA)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT prms_id (#PCDATA)>
- <!ELEMENT summary (result, description, total)>
+ <!ELEMENT summary (result, description, total)>
<!ELEMENT description (#PCDATA)>
<!ELEMENT total (#PCDATA)>
\]>"
@@ -717,12 +718,17 @@
if [info exists errorInfo] {
set error $errorInfo
}
- global expect_out
+ global expect_out
+ set l_input0_output1 { "", "" }
+ if { [catch { set l_input0_output1 [split $expect_out(buffer) "\n"] } result]} {
+ puts stderr "Warning: no input or ouput for test $message!"
+ }
set output ""
set output "expect_out(buffer)"
xml_output " <test>"
- xml_output " <log>$output</log>"
+ xml_output " <input>[string trimright [lindex $l_input0_output1 0]]</input>"
+ xml_output " <output>[string trimright [lindex $l_input0_output1 1]]</output>"
xml_output " <result>$type</result>"
xml_output " <name>$message</name>"
xml_output " <prms_id>$prms_id</prms_id>"