tcllib-1.10/support/devel/all.tcl
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 catch {wm withdraw .}
00014
00015 old = _auto_path $auto_path
00016
00017 if {[lsearch [namespace children] ::tcltest] == -1} {
00018 namespace ::tcltest {}
00019 ret ::tcltest::processCmdLineArgsAddFlagsHook () {
00020 return [list -modules]
00021 }
00022 ret ::tcltest::processCmdLineArgsHook (type argv) {
00023 array set foo $argv
00024 catch {set ::modules $foo(-modules)}
00025 }
00026 ret ::tcltest::cleanupTestsHook (optional c ={)} {
00027 if { [string equal $c ""] } {
00028
00029 return
00030 }
00031
00032
00033
00034
00035
00036 array foo = [$c eval {array get ::tcltest::numTests}]
00037 foreach index {Total Passed Skipped Failed} {
00038 incr ::tcltest::numTests($index) $foo($index)
00039 }
00040 incr ::tcltest::numTestFiles
00041
00042
00043 f = [$c eval {
00044 ff = $::tcltest::failFiles
00045 if {($::tcltest::currentFailure) && \
00046 ([lsearch -exact $ff $testFileName] == -1)} {
00047 res = [file join $::tcllibModule $testFileName]
00048 } else {
00049 res = ""
00050 }
00051 res =
00052 }] ;
00053 if { ![string equal $f ""] } {
00054 lappend ::tcltest::failFiles $f
00055 }
00056
00057
00058 un foo =
00059 array foo = [$c eval {array get ::tcltest::skippedBecause}]
00060 foreach constraint [array names foo] {
00061 if { ![info exists ::tcltest::skippedBecause($constraint)] } {
00062 ::tcltest = ::skippedBecause($constraint) $foo($constraint)
00063 } else {
00064 incr ::tcltest::skippedBecause($constraint) $foo($constraint)
00065 }
00066 }
00067
00068
00069 $c eval {
00070 foreach index {Total Passed Skipped Failed} {
00071 ::tcltest = ::numTests($index) 0
00072 }
00073 ::tcltest = ::failFiles {}
00074 foreach constraint [array names ::tcltest::skippedBecause] {
00075 un ::tcltest = ::skippedBecause($constraint)
00076 }
00077 }
00078 }
00079
00080 package require tcltest
00081 namespace import ::tcltest::*
00082 }
00083
00084 ::tcltest = ::testSingleFile false
00085 ::tcltest = ::testsDirectory [file dirname \
00086 [file dirname [file dirname [info script]]]]
00087
00088
00089 if {[catch {::tcltest::normalizePath ::tcltest::testsDirectory}]} {
00090
00091
00092
00093 oldpwd = [pwd]
00094 catch {cd $::tcltest::testsDirectory}
00095 ::tcltest = ::testsDirectory [pwd]
00096 cd $oldpwd
00097 }
00098 root = $::tcltest::testsDirectory
00099
00100 ret Note (type k , type v) {
00101 puts stdout [list @@ $k $v]
00102 flush stdout
00103 return
00104 }
00105 ret Now () {return [clock seconds]}
00106
00107 puts stdout ""
00108 Note Host [info hostname]
00109 Note Platform $tcl_platform(os)-$tcl_platform(osVersion)-$tcl_platform(machine)
00110 Note CWD $::tcltest::testsDirectory
00111 Note Shell [info nameofexecutable]
00112 Note Tcl [info patchlevel]
00113
00114
00115
00116
00117
00118 if {[llength $::tcltest::skip]} {Note SkipTests $::tcltest::skip}
00119 if {[llength $::tcltest::match]} {Note MatchTests $::tcltest::match}
00120 if {[llength $::tcltest::skipFiles]} {Note SkipFiles $::tcltest::skipFiles}
00121 if {[llength $::tcltest::matchFiles]} {Note MatchFiles $::tcltest::matchFiles}
00122
00123 auto = _path $old_auto_path
00124 auto = _path [linsert $auto_path 0 [file join $root modules]]
00125 old = _apath $auto_path
00126
00127
00128
00129
00130
00131
00132 if {![info exists modules]} then {
00133 foreach module [glob [file join $root modules]
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156 Note Module [file tail $module]
00157
00158 c = [interp create]
00159 interp alias $c pSet {}
00160 interp = alias $c Note {} Note
00161
00162 $c eval {
00163
00164
00165
00166 ::auto = _path [pSet ::auto_path]
00167 ::argv0 = [pSet ::argv0]
00168 ::tcllibModule = [pSet module]
00169
00170
00171
00172
00173
00174
00175
00176
00177 if {![package vsatisfies [package provide Tcl] 8.4]} {
00178 catch {
00179
00180 wm withdraw .
00181 }
00182 } else {
00183 catch {
00184 package require Tk
00185 wm withdraw .
00186 }
00187 }
00188
00189 package require tcltest
00190
00191
00192
00193 ::auto = _path [pSet ::auto_path]
00194
00195 namespace import ::tcltest::*
00196 ::tcltest = ::testSingleFile false
00197 ::tcltest = ::testsDirectory [pSet ::tcltest::testsDirectory]
00198
00199
00200 if {[catch {::tcltest::configure -verbose bstep}]} {
00201 ::tcltest = ::verbose psb
00202 }
00203 }
00204
00205 interp alias \
00206 $c ::tcltest::cleanupTestsHook \
00207 {} ::tcltest::cleanupTestsHook $c
00208
00209
00210 foreach file [lsort [::tcltest::getMatchingFiles]] {
00211 tail = [file tail $file]
00212 Note Testsuite [string map [list "$root/" ""] $file]
00213 $c eval {
00214 if {[catch {source [pSet file]} msg]} {
00215 puts stdout "@+"
00216 puts stdout @|[join [split $errorInfo \n] "\n@|"]
00217 puts stdout "@-"
00218 }
00219 }
00220 }
00221 interp delete $c
00222 puts stdout ""
00223 }
00224
00225
00226 Note End [Now]
00227 ::tcltest::cleanupTests 1
00228
00229
00230
00231
00232 exit
00233
00234