Jim Tcl
Check-in [c4f990b209]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:tcltest: Support 'needs package xxx'

Makes it easy to skip all tests if the package isn't available

Signed-off-by: Steve Bennett <steveb@workware.net.au>

Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:c4f990b209735a467bb3d9e5a23978173dcdbc0a
User & Date: steveb@workware.net.au 2017-09-21 06:31:00
Context
2017-09-21
06:31
prefix.test: Use the correct package name

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: 2db7fb9400 user: steveb@workware.net.au tags: trunk

06:31
tcltest: Support 'needs package xxx'

Makes it easy to skip all tests if the package isn't available

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: c4f990b209 user: steveb@workware.net.au tags: trunk

06:30
tcl::prefix: respect -message when no valid options

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: a181b7fe80 user: steveb@workware.net.au tags: trunk

Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to tcltest.tcl.

39
40
41
42
43
44
45






46
47
48
49
50
51
52
		foreach p $packages {
			catch {package require $p}
		}
		if {[info commands $what] ne ""} {
			return
		}
		skiptest " (command $what)"






	}
	error "Unknown needs type: $type"
}

proc skiptest {{msg {}}} {
	puts [format "%16s:   --- skipped$msg" $::argv0]
	exit 0







>
>
>
>
>
>







39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
		foreach p $packages {
			catch {package require $p}
		}
		if {[info commands $what] ne ""} {
			return
		}
		skiptest " (command $what)"
	}
	if {$type eq "package"} {
		if {[catch {package require $what}]} {
			skiptest " (package $what)"
		}
		return
	}
	error "Unknown needs type: $type"
}

proc skiptest {{msg {}}} {
	puts [format "%16s:   --- skipped$msg" $::argv0]
	exit 0