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 *]] {
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 shortfile [file tail $file] 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
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>"