Artifact
9f7e7ea7cc6c75df78c5efb761d10a4e8e354401:
- File
test/th1-tcl2.txt
— part of check-in
[49c63f8c78]
at
2012-10-07 13:55:39
on branch trunk
— Enhance Tcl integration with support for notifications before and after Tcl scripts are evaluated.
(user:
mistachkin
size: 603)
[more...]
0000: 3c 74 68 31 3e 0a 20 20 23 0a 20 20 23 20 54 68 <th1>. #. # Th
0010: 69 73 20 69 73 20 61 20 22 54 48 31 20 66 72 61 is is a "TH1 fra
0020: 67 6d 65 6e 74 22 20 75 73 65 64 20 74 6f 20 74 gment" used to t
0030: 65 73 74 20 74 68 65 20 54 63 6c 20 69 6e 74 65 est the Tcl inte
0040: 67 72 61 74 69 6f 6e 20 66 65 61 74 75 72 65 73 gration features
0050: 20 6f 66 20 54 48 31 2e 0a 20 20 23 20 54 68 65 of TH1.. # The
0060: 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67 20 74 corresponding t
0070: 65 73 74 20 66 69 6c 65 20 65 78 65 63 75 74 65 est file execute
0080: 73 20 74 68 69 73 20 66 69 6c 65 20 75 73 69 6e s this file usin
0090: 67 20 74 68 65 20 74 65 73 74 2d 74 68 2d 72 65 g the test-th-re
00a0: 6e 64 65 72 0a 20 20 23 20 46 6f 73 73 69 6c 20 nder. # Fossil
00b0: 63 6f 6d 6d 61 6e 64 2e 0a 20 20 23 0a 20 20 23 command.. #. #
00c0: 20 4e 4f 54 45 3a 20 54 68 69 73 20 74 65 73 74 NOTE: This test
00d0: 20 72 65 71 75 69 72 65 73 20 74 68 61 74 20 74 requires that t
00e0: 68 65 20 53 51 4c 69 74 65 20 70 61 63 6b 61 67 he SQLite packag
00f0: 65 20 62 65 20 61 76 61 69 6c 61 62 6c 65 20 66 e be available f
0100: 6f 72 20 74 68 65 20 54 63 6c 0a 20 20 23 20 20 or the Tcl. #
0110: 20 20 20 20 20 69 6e 74 65 72 70 72 65 74 65 72 interpreter
0120: 20 74 68 61 74 20 69 73 20 6c 69 6e 6b 65 64 20 that is linked
0130: 74 6f 20 74 68 65 20 46 6f 73 73 69 6c 20 65 78 to the Fossil ex
0140: 65 63 75 74 61 62 6c 65 2e 0a 20 20 23 0a 20 20 ecutable.. #.
0150: 74 63 6c 49 6e 76 6f 6b 65 20 73 65 74 20 72 65 tclInvoke set re
0160: 70 6f 73 69 74 6f 72 79 5f 6e 61 6d 65 20 5b 72 pository_name [r
0170: 65 70 6f 73 69 74 6f 72 79 20 31 5d 0a 20 20 70 epository 1]. p
0180: 72 6f 63 20 64 6f 4f 75 74 20 7b 6d 73 67 7d 20 roc doOut {msg}
0190: 7b 70 75 74 73 20 24 6d 73 67 3b 20 70 75 74 73 {puts $msg; puts
01a0: 20 5c 6e 7d 0a 20 20 64 6f 4f 75 74 20 5b 74 63 \n}. doOut [tc
01b0: 6c 45 76 61 6c 20 7b 0a 20 20 20 20 70 61 63 6b lEval {. pack
01c0: 61 67 65 20 72 65 71 75 69 72 65 20 73 71 6c 69 age require sqli
01d0: 74 65 33 0a 20 20 20 20 73 71 6c 69 74 65 33 20 te3. sqlite3
01e0: 64 62 20 24 72 65 70 6f 73 69 74 6f 72 79 5f 6e db $repository_n
01f0: 61 6d 65 20 2d 72 65 61 64 6f 6e 6c 79 20 74 72 ame -readonly tr
0200: 75 65 0a 20 20 20 20 73 65 74 20 78 20 5b 64 62 ue. set x [db
0210: 20 65 76 61 6c 20 7b 53 45 4c 45 43 54 20 43 4f eval {SELECT CO
0220: 55 4e 54 28 2a 29 20 46 52 4f 4d 20 75 73 65 72 UNT(*) FROM user
0230: 3b 7d 5d 0a 20 20 20 20 64 62 20 63 6c 6f 73 65 ;}]. db close
0240: 0a 20 20 20 20 72 65 74 75 72 6e 20 24 78 0a 20 . return $x.
0250: 20 7d 5d 0a 3c 2f 74 68 31 3e 0a }].</th1>.