1 proc sid_check_err {filename} {
8 set build_ltldpath [join [glob "../*"] ":"]
9 set install_ltldpath "$prefix/lib/sidcomp"
10 set ltldpath ":$build_ltldpath:$install_ltldpath:"
12 if {[string match "*static*" $TOOL_OPTIONS]} then {
13 set mksidconf [sid_find_file "mksidconf"]
14 system $mksidconf -static $file
15 regsub "(.*).conf" $file {./\1} sid
16 regsub "(.*).conf" $file {\1.sconf} file
18 set sid [sid_find_file "sid" "sid.exe"]
22 set last_timeout $timeout
24 set expfile [open "$srcdir/sidcomp.cfgroot/$filename.expect" r]
25 catch {exec env SID_LIBRARY_PATH=$ltldpath $sid "$srcdir/sidcomp.cfgroot/$filename.badconf"} result
27 set output [split $result \n]
28 for {set i 0} {$i < [llength $output] } {incr i} {
29 set line [lindex $output $i]
30 if {[string first $filename $line] != "-1"} {
31 set wholeline [split $line /]
32 set linelength [llength $wholeline]
33 set startindex [lsearch $wholeline $filename*]
34 set resultline [lindex $wholeline $startindex]
35 # set lastindex [expr $linelength - 1]
36 if {$startindex != [expr $linelength -1] } then {
37 for {set j [expr $startindex + 1]} {$j < $linelength } {incr j} {
38 append resultline /[lindex $wholeline $j]
41 # gets rid of the path
42 if { [gets $expfile expectline] >= 0 } then {
43 if {[string match $expectline $resultline] == "0"} then {
44 fail "$test - mismatch on line [expr $i + 1]\n expected $expectline\n result $resultline"
49 warning "can't get next line in expected file"
55 verbose "$test - matched $i lines"
56 if { $i == [llength $output] } then { pass $test }
57 set timeout $last_timeout
61 foreach file [glob -nocomplain "$srcdir/sidcomp.cfgroot/*.badconf"] {
62 set wholepath [split $file /]
63 set name [lindex $wholepath [expr [llength $wholepath] -1 ]]
64 set conffile [lindex [split $name .] 0]
65 set test "testing sid with bad config file $conffile.badconf"
66 set id [sid_check_err $conffile]