"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "lib/framework.exp" between
dejagnu-1.6.tar.gz and dejagnu-1.6.1.tar.gz

About: DejaGnu is a framework for testing other programs.

framework.exp  (dejagnu-1.6):framework.exp  (dejagnu-1.6.1)
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, # Copyright (C) 1992-2016 Free Software Foundation, Inc.
# 2001 2002, 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2016 Free
# Software Foundation, Inc.
# #
# This file is part of DejaGnu. # This file is part of DejaGnu.
# #
# DejaGnu is free software; you can redistribute it and/or modify it # DejaGnu is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by # under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or # the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version. # (at your option) any later version.
# #
# DejaGnu is distributed in the hope that it will be useful, but # DejaGnu is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of # WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 60 skipping to change at line 58
\]>" \]>"
} }
# Open the output logs. # Open the output logs.
# #
proc open_logs { } { proc open_logs { } {
global outdir global outdir
global tool global tool
global sum_file global sum_file
global xml_file global xml_file
global xml_file_name
global xml global xml
if { ${tool} == "" } { if { ${tool} == "" } {
set tool testrun set tool testrun
} }
catch "file delete -force -- $outdir/$tool.sum" catch "file delete -force -- $outdir/$tool.sum"
set sum_file [open [file join $outdir $tool.sum] w] set sum_file [open [file join $outdir $tool.sum] w]
if { $xml } { if { $xml } {
catch "file delete -force -- $outdir/$tool.xml" catch "file delete -force -- $outdir/$tool.xml"
if { ![string compare $xml_file_name ""] } { set xml_file [open [file join $outdir $tool.xml] w]
set xml_file_name $tool.xml xml_output "<?xml version=\"1.1\"?>"
}
set xml_file [open [file join $outdir $xml_file_name] w]
xml_output "<?xml version=\"1.0\"?>"
insertdtd insertdtd
xml_output "<testsuite>" xml_output "<testsuite>"
} }
catch "file delete -force -- $outdir/$tool.log" catch "file delete -force -- $outdir/$tool.log"
log_file -a "$outdir/$tool.log" log_file -a "$outdir/$tool.log"
verbose "Opening log files in $outdir" verbose "Opening log files in $outdir"
if { ${tool} == "testrun" } { if { ${tool} == "testrun" } {
set tool "" set tool ""
} }
fconfigure $sum_file -buffering line fconfigure $sum_file -buffering line
skipping to change at line 231 skipping to change at line 225
if {[string match "" $args]} { if {[string match "" $args]} {
if {[info exists target_triplet]} { if {[info exists target_triplet]} {
return $target_triplet return $target_triplet
} else { } else {
perror "No target configuration names found." perror "No target configuration names found."
} }
} }
set triplet [lindex $args 0] set triplet [lindex $args 0]
# now check against the cannonical name # now check against the canonical name
if {[info exists target_triplet]} { if {[info exists target_triplet]} {
verbose "Checking \"$triplet\" against \"$target_triplet\"" 2 verbose "Checking \"$triplet\" against \"$target_triplet\"" 2
if {[string match $triplet $target_triplet]} { if {[string match $triplet $target_triplet]} {
return 1 return 1
} }
} }
# nope, no match # nope, no match
return 0 return 0
} }
skipping to change at line 372 skipping to change at line 366
if { ${tool} == "" } { if { ${tool} == "" } {
set tool testrun set tool testrun
} }
mail_file $outdir/$tool.sum $mailing_list "Dejagnu Summary Log" mail_file $outdir/$tool.sum $mailing_list "Dejagnu Summary Log"
} }
remote_close host remote_close host
remote_close target remote_close target
exit $exit_status exit $exit_status
} }
# Emit an XML tag, but escape XML special characters in the body.
proc xml_tag { tag body } {
set escapes { < &lt; > &gt; & &amp; \" &quot; ' &apos; }
for {set i 1} {$i < 32} {incr i} {
if {[lsearch [list 9 10 13] $i] >= 0} {
# skip valid XML whitespace chars
continue
}
# Append non-printable character
lappend escapes [format %c $i]
# .. and then the corresponding XML escape
lappend escapes &#x[format %x $i]\;
}
return <$tag>[string map $escapes $body]</$tag>
}
proc xml_output { message } { proc xml_output { message } {
global xml_file global xml_file
if { $xml_file != "" } { if { $xml_file != "" } {
puts $xml_file "$message" puts $xml_file $message
} }
} }
# Print summary of all pass/fail counts. # Print summary of all pass/fail counts.
# #
proc log_summary { args } { proc log_summary { args } {
global tool global tool
global sum_file global sum_file
global xml_file global xml_file
global xml global xml
skipping to change at line 444 skipping to change at line 454
clone_output "### ERROR: # of testcases $mismatch\n" clone_output "### ERROR: # of testcases $mismatch\n"
} }
} }
} }
foreach x { PASS FAIL XPASS XFAIL KPASS KFAIL UNRESOLVED UNTESTED UNSUPPORTE D } { foreach x { PASS FAIL XPASS XFAIL KPASS KFAIL UNRESOLVED UNTESTED UNSUPPORTE D } {
set val $test_counts($x,$which) set val $test_counts($x,$which)
if { $val > 0 } { if { $val > 0 } {
set mess "# of $test_counts($x,name)" set mess "# of $test_counts($x,name)"
if { $xml } { if { $xml } {
xml_output " <summary>" xml_output " <summary>"
xml_output " <result>$x</result>" xml_output " [xml_tag result $x]"
xml_output " <description>$mess</description>" xml_output " [xml_tag description $mess]"
xml_output " <total>$val</total>" xml_output " [xml_tag total $val]"
xml_output " </summary>" xml_output " </summary>"
} }
if { [string length $mess] < 24 } { if { [string length $mess] < 24 } {
append mess "\t" append mess "\t"
} }
clone_output "$mess\t$val" clone_output "$mess\t$val"
} }
} }
} }
skipping to change at line 704 skipping to change at line 714
} }
global expect_out global expect_out
set rio { "" "" } set rio { "" "" }
if { [catch { set rio [split $expect_out(buffer) "\n"] } result]} { if { [catch { set rio [split $expect_out(buffer) "\n"] } result]} {
#do nothing - leave as { "" "" } #do nothing - leave as { "" "" }
} }
set output "" set output ""
set output "expect_out(buffer)" set output "expect_out(buffer)"
xml_output " <test>" xml_output " <test>"
xml_output " <input>[string trimright [lindex $rio 0]]</input>" xml_output " [xml_tag input [string trimright [lindex $rio 0]]]"
xml_output " <output>[string trimright [lindex $rio 1]]</output>" xml_output " [xml_tag output [string trimright [lindex $rio 1]]]"
xml_output " <result>$type</result>" xml_output " [xml_tag result $type]"
xml_output " <name>$message</name>" xml_output " [xml_tag name $message]"
xml_output " <prms_id>$prms_id</prms_id>" xml_output " [xml_tag prms_id $prms_id]"
xml_output " </test>" xml_output " </test>"
} }
switch -- $type { switch -- $type {
PASS { PASS {
if {$prms_id} { if {$prms_id} {
set message [concat $message "\t(PRMS $prms_id)"] set message [concat $message "\t(PRMS $prms_id)"]
} }
} }
FAIL { FAIL {
 End of changes. 8 change blocks. 
19 lines changed or deleted 29 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)