You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
1.2 KiB
26 lines
1.2 KiB
#suite_smoke.tcl (G-102): smoke assertions run under a suite-built shell itself |
|
#(the shell being smoked executes this script). Formerly suite.tcl inline smokes. |
|
# |
|
#args: -mode static|zip -expect <patchlevel> |
|
# static: interpreter reports the expected patchlevel |
|
# zip: additionally proves the ATTACHED library works - tzdata reachable |
|
# (clock format with a named zone) and auto_load present |
|
|
|
proc fail {msg} {puts stderr "suite_smoke FAIL: $msg"; flush stderr; exit 1} |
|
|
|
array set opt {-mode static -expect {}} |
|
foreach {k v} $argv { |
|
if {![info exists opt($k)]} {fail "unknown option '$k'"} |
|
set opt($k) $v |
|
} |
|
if {$opt(-expect) eq ""} {fail "missing -expect <patchlevel>"} |
|
set pl [info patchlevel] |
|
if {$pl ne $opt(-expect)} {fail "patchlevel mismatch: got '$pl' want '$opt(-expect)' ([info nameofexecutable])"} |
|
if {$opt(-mode) eq "zip"} { |
|
if {[catch {clock format 0 -gmt 0 -format %Z} tz]} {fail "tzdata not reachable from attached library: $tz"} |
|
if {[llength [info procs auto_load]] != 1} {fail "auto_load missing - attached library init incomplete"} |
|
puts "suite_smoke OK: $pl (zip: tz=$tz auto=1) [info nameofexecutable]" |
|
} else { |
|
puts "suite_smoke OK: $pl [info nameofexecutable]" |
|
} |
|
exit 0
|
|
|