modified input/output, and checked for empty variables
authorbemis <bemis>
Wed, 13 Nov 2002 18:16:53 +0000 (18:16 +0000)
committerbemis <bemis>
Wed, 13 Nov 2002 18:16:53 +0000 (18:16 +0000)
lib/framework.exp

index e6c9989..5b245c2 100644 (file)
@@ -48,12 +48,13 @@ proc insertdtd { } {
     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 @@ proc record_test { type message args } {
         if [info exists errorInfo] {
            set error $errorInfo
         }
-        global expect_out
+        global expect_out 
+       set l_input0_output1 { 0, 0 }
+       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>"