Check-in [e1afa41765]
Overview
Comment:Updated tests results page: Added legend Added header row for entire set Added new results "USABLE" and "NO TESTS"
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: e1afa417650057ac313ff3400e2bfcba0190ad47
User & Date: rkeene on 2010-09-26 04:48:15
Other Links: manifest | tags
Context
2010-09-26
04:48
Minor cleanup of diff check-in: 6992d94246 user: rkeene tags: trunk
04:48
Updated tests results page: Added legend Added header row for entire set Added new results "USABLE" and "NO TESTS" check-in: e1afa41765 user: rkeene tags: trunk
04:48
Updated to emit error message and abort if tests are unable to be run check-in: ede5eb67b8 user: rkeene tags: trunk
Changes

Modified build/test/publish-tests from [cd043e5464] to [ebc8777c64].

22
23
24
25
26
27
28

29
30






31
32
33
34
35
36
37
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44







+


+
+
+
+
+
+








if {![file isdir "kits"]} {
	puts stderr "Could not find kits/ directory, aborting."

        exit 1
}

# Define non-critical tests
set noncriticaltests [list "05-locale"]

# Define legend
set statusdata(ok)            [list OK          green   "Software built successfully and passed all tests"]
set statusdata(untested)      [list "NO TESTS"  yellow  "Software built successfully but no tests were run"]
set statusdata(non-critical)  [list "USABLE"    orange  "Software built successfully and all tests were run, but some non-critical tests failed"]
set statusdata(failed)        [list "FAILED"    red     "Some critical tests failed or the software did not build"]

##########################################################################
## PROCEDURES ############################################################
##########################################################################
proc pretty_print_key {key} {
	set version [lindex $key 0]
	set os [lindex $key 1]
	set cpu [lindex $key 2]
175
176
177
178
179
180
181
182




183
184
185
186
187
188
189
190
191
192
193
194
195
196
197





198
199


200

201
202
203

204
205
206
207
208
209
210
182
183
184
185
186
187
188

189
190
191
192
193
194
195
196
197
198
199
200
201
202
203




204
205
206
207
208

209
210
211

212



213
214
215
216
217
218
219
220







-
+
+
+
+











-
-
-
-
+
+
+
+
+
-

+
+
-
+
-
-
-
+







puts $fd "  </head>"
puts $fd "  <body>"
puts $fd "    <h1>KitCreator Build and Test Status</h1>"
puts $fd "    <p>The following table represents the status of the test results from the KitCreator test suite.</p>"
puts $fd "    <table cellpadding=\"2\" border=\"1\">"
foreach key [lsort -dictionary [array names allkitinfo]] {
	puts $fd "      <tr>"
	puts $fd "        <th><u>Tclkit for [pretty_print_key $key]</u></th>"
	puts $fd "        <th colspan=\"5\"><u>Tclkit for [pretty_print_key $key]</u></th>"
	puts $fd "      </tr>"
	puts $fd "      <tr>"
	puts $fd "        <th>Kit Features</th>"
	puts $fd "        <th>Kit Size</th>"
	puts $fd "        <th>Status</th>"
	puts $fd "        <th>Log</th>"
	puts $fd "        <th>Failed Tests</th>"
	puts $fd "      </tr>"
	foreach kitinfo_list $allkitinfo($key) {
		puts $fd "      <tr>"
		unset -nocomplain kitinfo
		array set kitinfo $kitinfo_list

		if {[llength $kitinfo(failedtests)] == 0} {
			set status "OK"
			set bgcolor "green"
		} else {
			set status "FAILED"
			set status ok

			# If we are cross-compiled, note that no tests were run
			if {[lsearch -exact $kitinfo(buildflags) xcompile] != -1} {
				set status untested
			set bgcolor "yellow"
		}
		} else {
			set status non-critical

		}
		if {[lsearch -exact $kitinfo(buildflags) xcompile] != -1} {
			set bgcolor "yellow"
		}


		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} {
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
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
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285







-
+









+
+
+
+







-
+





+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+







					}

					break
				}
			}

			if {[lsearch -exact $noncriticaltests $testname] == -1} {
				set bgcolor "red"
				set status failed
			}

			if {$loglink} {
				lappend failedtestshtml "<small><a href=\"$test\">$testname</a></small>"
			} else {
				lappend failedtestshtml "<small>$testname</small>"
			}
		}

		set statusinfo $statusdata($status)
		set statustext [lindex $statusinfo 0]
		set bgcolor    [lindex $statusinfo 1]

		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 bgcolor=\"$bgcolor\">$statustext</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 "    <table cellpadding=\"2\" border=\"1\">"
puts $fd "      <tr>"
puts $fd "        <th colspan=\"2\"><small>Legend</small></th>"
puts $fd "      </tr>"
foreach status [list ok untested non-critical failed] {
	set statusinfo $statusdata($status)
	set statustext    [lindex $statusinfo 0]
	set bgcolor       [lindex $statusinfo 1]
	set statusdetail  [lindex $statusinfo 2]

	puts $fd "      <tr>"
	puts $fd "        <td bgcolor=\"$bgcolor\"><small>$statustext</small></td>"
	puts $fd "        <td><small>$statusdetail</small></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