source [file dirname [info script]]/testing.tcl needs constraint jim test jimsh-1.1 {jimsh --help} -body { exec [info nameofexecutable] --help } -match glob -result {jimsh version *Usage: *} test jimsh-1.2 {jimsh -} { exec [info nameofexecutable] - << {puts $(1 + 2)} } {3} test jimsh-1.3 {jimsh - arg list} jim { exec [info nameofexecutable] - arg list << {puts [join $argv]} } {arg list} test jimsh-1.4 {jimsh -e} { exec [info nameofexecutable] -e {expr {4 + 5}} } {9} test jimsh-1.4 {jimsh -e with args} { exec [info nameofexecutable] -e {set argv} arg1 arg2 } {arg1 arg2} test jimsh-1.5 {jimsh --version} { exec [info nameofexecutable] --version } [info version] test jimsh-1.6 {jimsh -e with error} -body { exec [info nameofexecutable] -e blah } -returnCodes error -match glob -result {invalid command name "blah"*} test jimsh-1.7 {jimsh exit code} -body { set script "set x 3\nincr x\nexit \$x\n" set rc [catch {exec [info nameofexecutable] << $script} msg opts] lassign [dict get $opts -errorcode] status pid exitcode list $rc $status $exitcode } -result {1 CHILDSTATUS 4} test jimsh-1.8 {jimsh error} -body { exec [info nameofexecutable] << "blah\n" } -returnCodes error -match glob -result {stdin:1: Error: invalid command name "blah"*} testreport