Hex Artifact Content

Artifact 7bfac57b1d4ba5a73a5f2d9649ba1cdf7d94e623:


0000: 23 21 20 2f 75 73 72 2f 62 69 6e 2f 65 6e 76 20  #! /usr/bin/env 
0010: 74 63 6c 73 68 0a 0a 69 66 20 7b 5b 63 61 74 63  tclsh..if {[catc
0020: 68 20 7b 0a 09 73 65 74 20 62 75 69 6c 64 66 6c  h {..set buildfl
0030: 61 67 73 20 5b 73 70 6c 69 74 20 5b 6c 69 6e 64  ags [split [lind
0040: 65 78 20 24 61 72 67 76 20 31 5d 20 2d 5d 0a 0a  ex $argv 1] -]..
0050: 09 23 20 44 65 74 65 72 6d 69 6e 65 20 69 66 20  .# Determine if 
0060: 54 68 72 65 61 64 73 20 77 61 73 20 72 65 71 75  Threads was requ
0070: 65 73 74 65 64 20 28 6f 72 20 69 6e 20 38 2e 36  ested (or in 8.6
0080: 2b 2c 20 75 6e 72 65 71 75 65 73 74 65 64 29 0a  +, unrequested).
0090: 09 69 66 20 7b 24 74 63 6c 5f 76 65 72 73 69 6f  .if {$tcl_versio
00a0: 6e 20 3d 3d 20 22 38 2e 36 22 7d 20 7b 0a 09 09  n == "8.6"} {...
00b0: 69 66 20 7b 5b 6c 73 65 61 72 63 68 20 2d 65 78  if {[lsearch -ex
00c0: 61 63 74 20 24 62 75 69 6c 64 66 6c 61 67 73 20  act $buildflags 
00d0: 22 75 6e 74 68 72 65 61 64 65 64 22 5d 20 3d 3d  "unthreaded"] ==
00e0: 20 2d 31 7d 20 7b 0a 09 09 09 73 65 74 20 69 73   -1} {....set is
00f0: 74 68 72 65 61 64 65 64 20 31 0a 09 09 7d 20 65  threaded 1...} e
0100: 6c 73 65 20 7b 0a 09 09 09 73 65 74 20 69 73 74  lse {....set ist
0110: 68 72 65 61 64 65 64 20 30 0a 09 09 7d 0a 09 7d  hreaded 0...}..}
0120: 20 65 6c 73 65 20 7b 0a 09 09 69 66 20 7b 5b 6c   else {...if {[l
0130: 73 65 61 72 63 68 20 2d 65 78 61 63 74 20 24 62  search -exact $b
0140: 75 69 6c 64 66 6c 61 67 73 20 22 74 68 72 65 61  uildflags "threa
0150: 64 65 64 22 5d 20 3d 3d 20 2d 31 7d 20 7b 0a 09  ded"] == -1} {..
0160: 09 09 73 65 74 20 69 73 74 68 72 65 61 64 65 64  ..set isthreaded
0170: 20 30 0a 09 09 7d 20 65 6c 73 65 20 7b 0a 09 09   0...} else {...
0180: 09 73 65 74 20 69 73 74 68 72 65 61 64 65 64 20  .set isthreaded 
0190: 31 0a 09 09 7d 0a 09 7d 0a 0a 09 23 20 4d 69 6e  1...}..}...# Min
01a0: 69 6d 61 6c 20 62 75 69 6c 64 73 20 64 6f 6e 27  imal builds don'
01b0: 74 20 63 6f 6d 65 20 77 69 74 68 20 74 68 72 65  t come with thre
01c0: 61 64 73 2e 0a 09 69 66 20 7b 5b 6c 73 65 61 72  ads...if {[lsear
01d0: 63 68 20 2d 65 78 61 63 74 20 24 62 75 69 6c 64  ch -exact $build
01e0: 66 6c 61 67 73 20 22 6d 69 6e 22 5d 20 21 3d 20  flags "min"] != 
01f0: 2d 31 7d 20 7b 0a 09 09 73 65 74 20 69 73 74 68  -1} {...set isth
0200: 72 65 61 64 65 64 20 30 0a 09 7d 0a 0a 09 69 66  readed 0..}...if
0210: 20 7b 21 24 69 73 74 68 72 65 61 64 65 64 7d 20   {!$isthreaded} 
0220: 7b 0a 09 09 65 78 69 74 20 30 0a 09 7d 0a 0a 09  {...exit 0..}...
0230: 70 61 63 6b 61 67 65 20 72 65 71 75 69 72 65 20  package require 
0240: 54 68 72 65 61 64 0a 0a 09 65 78 69 74 20 30 0a  Thread...exit 0.
0250: 7d 5d 7d 20 7b 0a 09 70 75 74 73 20 22 45 72 72  }]} {..puts "Err
0260: 6f 72 20 69 6e 20 54 68 72 65 61 64 20 54 65 73  or in Thread Tes
0270: 74 3a 20 24 65 72 72 6f 72 49 6e 66 6f 22 0a 09  t: $errorInfo"..
0280: 65 78 69 74 20 31 0a 7d 0a                       exit 1.}.