Check-in [e6735bc1dd]
Overview
Comment:Updated to format test results more pleasingly
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: e6735bc1dde8cb783bcce3b7d32a1700c312c1f5e64d76c064fac8fddddc4a27
User & Date: rkeene on 2019-09-17 20:38:01
Other Links: manifest | tags
Context
2019-09-17
20:43
Fixed issue where coverage files were not cleaned up and ignored check-in: 2f92a3a715 user: rkeene tags: trunk
20:38
Updated to format test results more pleasingly check-in: e6735bc1dd user: rkeene tags: trunk
20:26
Set dev/rdev to something unique to this filesystem check-in: f7a81bb10b user: rkeene tags: trunk
Changes

Modified example/main.tcl from [5be9e46f9a] to [44a6e7f4d1].

18
19
20
21
22
23
24


















25
26
27
28
29
30
31

	if {[llength $rv] != [llength $verify]} {
		error "VERIFY FAILED: glob ... $args ($rv versus $verify)"
	}

	return $rv
}



















tcltest::customMatch boolean [list apply {{expected actual} {
	if {!!$expected == !!$actual} {
		return true
	} else {
		return false
	}







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49

	if {[llength $rv] != [llength $verify]} {
		error "VERIFY FAILED: glob ... $args ($rv versus $verify)"
	}

	return $rv
}

proc test_summary {} {
	set format "| %7s | %7s | %7s | %7s |"
	set emptyRow [format $format "" "" "" ""]
	set emptyRowLength [string length $emptyRow]
	lappend output "/[string repeat - [expr {$emptyRowLength - 2}]]\\"
	lappend output [format $format "Passed" "Failed" "Skipped" "Total"]
	lappend output [regsub -all -- " " [regsub -all -- " \\| " $emptyRow " + "] "-"]
	lappend output [format $format \
		$::tcltest::numTests(Passed) \
		$::tcltest::numTests(Failed) \
		$::tcltest::numTests(Skipped) \
		$::tcltest::numTests(Total) \
	]
	lappend output "\\[string repeat - [expr {$emptyRowLength - 2}]]/"

	return [join $output "\n"]
}

tcltest::customMatch boolean [list apply {{expected actual} {
	if {!!$expected == !!$actual} {
		return true
	} else {
		return false
	}
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318

319
320
321
322
323
324
} -cleanup {
	set auto_path $startAutoPath
	unset startAutoPath
} -constraints knownBug -result ""

# Output results
if {$::tcltest::numTests(Failed) != 0} {
	set format "| %20s | %20s | %20s | %20s |"
	puts [string repeat - [string length [format $format - - - -]]]
	puts [format $format "Passed" "Failed" "Skipped" "Total"]
	puts [format $format \
		$::tcltest::numTests(Passed) \
		$::tcltest::numTests(Failed) \
		$::tcltest::numTests(Skipped) \
		$::tcltest::numTests(Total) \
	]
	puts [string repeat - [string length [format $format - - - -]]]

	if {[info exists ::env(XVFS_TEST_EXIT_ON_FAILURE)]} {
		exit $::env(XVFS_TEST_EXIT_ON_FAILURE)
	}
	exit 1
}


puts "ALL TESTS PASSED"

if {[info exists ::env(XVFS_TEST_EXIT_ON_SUCCESS)]} {
	exit $::env(XVFS_TEST_EXIT_ON_SUCCESS)
}
exit 0







<
<
<
<
<
<
<
<
<
<
|






>






313
314
315
316
317
318
319










320
321
322
323
324
325
326
327
328
329
330
331
332
333
} -cleanup {
	set auto_path $startAutoPath
	unset startAutoPath
} -constraints knownBug -result ""

# Output results
if {$::tcltest::numTests(Failed) != 0} {










	puts [test_summary]
	if {[info exists ::env(XVFS_TEST_EXIT_ON_FAILURE)]} {
		exit $::env(XVFS_TEST_EXIT_ON_FAILURE)
	}
	exit 1
}

puts [test_summary]
puts "ALL TESTS PASSED"

if {[info exists ::env(XVFS_TEST_EXIT_ON_SUCCESS)]} {
	exit $::env(XVFS_TEST_EXIT_ON_SUCCESS)
}
exit 0