114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
|
set fd [open [file join $WEBDIR index.html] w]
file copy -force -- {*}[glob kits/*] $WEBDIR
set totaltests_count [llength [glob tests/*.tcl]]
foreach file [lsort -dictionary [glob -directory $WEBDIR *]] {
if {[file isdirectory $file]} {
continue
}
switch -glob -- $file {
"*.log" - "*.ttml" - "*.html" - "*.desc" {
continue
}
}
# Derive what we can from the filename
set shortfile [file tail $file]
set buildfile "${shortfile}-build.log"
set failedtests [glob -nocomplain -tails -directory $WEBDIR "${shortfile}-\[0-9\]\[0-9\]-*.log"]
## Split the filename into parts and store each part
set kitbuildinfo [split $shortfile -]
set tclversion [lindex $kitbuildinfo 1]
set kitbuildinfo [lsort -dictionary [lrange $kitbuildinfo 2 end]]
## Determine Kit OS from random file names
|
|
>
>
<
>
>
>
>
>
>
>
|
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
|
set fd [open [file join $WEBDIR index.html] w]
file copy -force -- {*}[glob kits/*] $WEBDIR
set totaltests_count [llength [glob tests/*.tcl]]
foreach file [lsort -dictionary [glob -tails -directory $WEBDIR * failed/*]] {
set shortfile $file
set file [file join $WEBDIR $file]
if {[file isdirectory $file]} {
continue
}
switch -glob -- $file {
"*.log" - "*.ttml" - "*.html" - "*.desc" {
continue
}
}
# Derive what we can from the filename
set buildfile "${shortfile}-build.log"
set failedtests [glob -nocomplain -tails -directory $WEBDIR "${shortfile}-\[0-9\]\[0-9\]-*.log"]
# If this kit represents a failed build, set the failed tests to that
set kitbuilt 1
if {[file tail [file dirname $file]] == "failed"} {
set failedtests [list "${shortfile}-XX-build.log"]
set kitbuilt 0
}
## Split the filename into parts and store each part
set kitbuildinfo [split $shortfile -]
set tclversion [lindex $kitbuildinfo 1]
set kitbuildinfo [lsort -dictionary [lrange $kitbuildinfo 2 end]]
## Determine Kit OS from random file names
|
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
|
set kitcpu [string tolower $tcl_platform(machine)]
}
# Generate array to describe this kit
unset -nocomplain kitinfo
set kitinfo(version) $tclversion
set kitinfo(file) $shortfile
set kitinfo(buildfile) $buildfile
set kitinfo(failedtests) $failedtests
set kitinfo(buildflags) $kitbuildinfo
set kitinfo(os) $kitos
set kitinfo(cpu) $kitcpu
# Store kit information with all kits
set key [list $tclversion $kitos $kitcpu]
lappend allkitinfo($key) [array get kitinfo]
}
puts $fd "<html>"
|
>
>
|
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
|
set kitcpu [string tolower $tcl_platform(machine)]
}
# Generate array to describe this kit
unset -nocomplain kitinfo
set kitinfo(version) $tclversion
set kitinfo(file) $shortfile
set kitinfo(fullfile) $file
set kitinfo(buildfile) $buildfile
set kitinfo(failedtests) $failedtests
set kitinfo(buildflags) $kitbuildinfo
set kitinfo(os) $kitos
set kitinfo(cpu) $kitcpu
set kitinfo(built) $kitbuilt
# Store kit information with all kits
set key [list $tclversion $kitos $kitcpu]
lappend allkitinfo($key) [array get kitinfo]
}
puts $fd "<html>"
|
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
|
set failedtestshtml [list]
foreach test [lsort -dictionary $kitinfo(failedtests)] {
set testname [file rootname $test]
set testname [split $testname -]
for {set idx 0} {$idx < [llength $testname]} {incr idx} {
set val [lindex $testname $idx]
if {[string match {[0-9][0-9]} $val]} {
set testname [join [lrange $testname $idx end] -]
break
}
}
if {[lsearch -exact $noncriticaltests $testname] == -1} {
set bgcolor "red"
}
lappend failedtestshtml "<small><a href=\"$test\">$testname</a></small>"
}
puts $fd " <td><a href=\"$kitinfo(file)\">[pretty_print_buildinfo $kitinfo(buildflags)]</a></td>"
puts $fd " <td>[pretty_print_size [file size [file join $WEBDIR $kitinfo(file)]]]</td>"
puts $fd " <td bgcolor=\"$bgcolor\">$status</td>"
puts $fd " <td><small><a href=\"$kitinfo(buildfile)\">([pretty_print_size [file size [file join $WEBDIR $kitinfo(buildfile)]]])</a></small></td>"
puts $fd " <td>[join $failedtestshtml {, }]</td>"
puts $fd " </tr>"
}
}
puts $fd " </table>"
puts $fd " <p>Generated on [clock format [clock seconds]]</p>"
puts $fd " </body>"
puts $fd "</html>"
close $fd
|
|
>
>
>
>
>
>
>
|
>
>
>
>
>
|
>
>
>
|
|
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
|
set failedtestshtml [list]
foreach test [lsort -dictionary $kitinfo(failedtests)] {
set testname [file rootname $test]
set testname [split $testname -]
for {set idx 0} {$idx < [llength $testname]} {incr idx} {
set val [lindex $testname $idx]
if {[string match {[0-9X][0-9X]} $val]} {
set testname [join [lrange $testname $idx end] -]
set loglink 1
if {[lindex [split $testname -] 0] == "XX"} {
set testname [join [lrange [split $testname -] 1 end] -]
set loglink 0
}
break
}
}
if {[lsearch -exact $noncriticaltests $testname] == -1} {
set bgcolor "red"
}
if {$loglink} {
lappend failedtestshtml "<small><a href=\"$test\">$testname</a></small>"
} else {
lappend failedtestshtml "<small>$testname</small>"
}
}
set kitdesc [pretty_print_buildinfo $kitinfo(buildflags)]
if {$kitinfo(built)} {
puts $fd " <td><a href=\"$kitinfo(file)\">$kitdesc</a></td>"
} else {
puts $fd " <td>$kitdesc</td>"
}
puts $fd " <td>[pretty_print_size [file size [file join $WEBDIR $kitinfo(fullfile)]]]</td>"
puts $fd " <td bgcolor=\"$bgcolor\">$status</td>"
puts $fd " <td><small><a href=\"$kitinfo(buildfile)\">([pretty_print_size [file size [file join $WEBDIR $kitinfo(buildfile)]]])</a></small></td>"
puts $fd " <td>[join $failedtestshtml {, }]</td>"
puts $fd " </tr>"
}
}
puts $fd " </table>"
puts $fd " <p>Generated on [clock format [clock seconds]]</p>"
puts $fd " </body>"
puts $fd "</html>"
close $fd
|