︙ | | |
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
-
+
-
-
+
+
|
proc readFileAsSubSpec { fileName } {
set data [readFile $fileName]
regsub -all -- {&} $data {\\\&} data
regsub -all -- {\\(\d+)} $data {\\\\\1} data
return $data
}
proc getFileHash { fileName } {
if {[catch {
exec fossil.exe sha1sum [file nativename $fileName]
} result] == 0} then {
return [string trim [lindex [split $result " "] 0]]
}
return ""
}
#
# HACK: Copy our local [fixed] copy of the MSDN documenter assembly into the
# installed location of NDoc3, if necessary. Actually copying the file
# will require elevated administrator privileges; otherwise, it will
# fail. Any errors encountered while copying the file are reported via
# the console; however, they will not halt further processing (i.e. the
# CHM file will probably still get built, but it may contain some links
# to built-in types that are blank).
#
proc copyMsdnDocumenter { sourceDirectory destinationDirectory } {
set fileNameOnly NDoc3.Documenter.Msdn.dll
set sourceFileName [file join $sourceDirectory bin $fileNameOnly]
set destinationFileName [file join $destinationDirectory bin $fileNameOnly]
set sourceFileHash [getFileHash $sourceFileName]
# puts stdout "Hashed \"$sourceFileName\" ==> \"$sourceFileHash\""
set destinationFileHash [getFileHash $destinationFileName]
# puts stdout "Hashed \"$destinationFileName\" ==> \"$destinationFileHash\""
if {[string length $sourceFileHash] > 0 && \
[string length $destinationFileHash] > 0 && \
$sourceFileHash ne $destinationFileHash} then {
if {[catch {
file copy -force $destinationFileName $destinationFileName.bak
file copy -force $sourceFileName $destinationFileName
} result] == 0} then {
puts stdout \
"finished copying \"$sourceFileName\" to \"$destinationFileName\""
} else {
puts stdout $result
}
} else {
puts stdout \
"skipped copying \"$sourceFileName\" to \"$destinationFileName\""
}
}
set path [file dirname [info script]]
set path [file normalize [file dirname [info script]]]
set nDocExtPath [file join [file dirname $path] Externals NDoc3]
set nDocPath [file join $env(ProgramFiles) NDoc3]
set nDocInstPath [file join $env(ProgramFiles) NDoc3]
if {![file isdirectory $nDocPath]} then {
puts stdout "NDoc3 must be installed to: $nDocPath"
if {![file isdirectory $nDocInstPath]} then {
puts stdout "NDoc3 must be installed to: $nDocInstPath"
exit 1
}
set hhcPath [file join $env(ProgramFiles) "HTML Help Workshop"]
if {![file isdirectory $hhcPath]} then {
puts stdout "HTML Help Workshop must be installed to: $hhcPath"
|
︙ | | |
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
|
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
|
-
+
+
+
+
+
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
|
puts stdout "*WARNING* File \"$xmlDocFile\" does not match: $pattern"
}
#
# TODO: If the NDoc version number ever changes, the next line of code will
# probably need to be updated.
#
set outputPath [file join Output ndoc3_msdn_temp]
set outputPath [file join Output]
set temporaryPath [file join $outputPath ndoc3_msdn_temp]
if {[file isdirectory $nDocExtPath]} then {
copyMsdnDocumenter $nDocExtPath $nDocInstPath
}
set code [catch {exec [file join $nDocPath bin NDoc3Console.exe] \
set code [catch {exec [file join $nDocInstPath bin NDoc3Console.exe] \
"-project=[file nativename $projectFile]"} result]
puts stdout $result; if {$code != 0} then {exit $code}
set fileNames [list SQLite.NET.hhp SQLite.NET.hhc]
foreach fileName [glob -nocomplain [file join $outputPath *.html]] {
foreach fileName [glob -nocomplain [file join $temporaryPath *.html]] {
lappend fileNames [file tail $fileName]
}
set patterns(.hhc,1) {<!--This document contains Table of Contents information\
for the HtmlHelp compiler\.--><UL>}
set patterns(.hhp,1) {Default topic=~System\.Data\.SQLite\.html}
set patterns(.hhp,2) \
{"~System\.Data\.SQLite\.html","~System\.Data\.SQLite\.html",,,,,}
set patterns(.html,1) \
{"http://msdn\.microsoft\.com/en-us/library/(System\.Data\.SQLite\.(?:.*?))\(VS\.\d+\)\.aspx"}
set patterns(.html,2) {System.Collections.Generic.IEnumerable`1}
set patterns(.html,3) {System.Collections.Generic.IEnumerator`1}
set patterns(.html,4) \
{"(System\.Data\.SQLite~System\.Data\.SQLite\.SQLiteFunction\.Dispose)\.html"}
set patterns(.html,5) \
{"(System\.Data\.SQLite~System\.Data\.SQLite\.SQLiteModule\.SetEstimatedCost)\.html"}
set patterns(.html,6) \
{"(System\.Data\.SQLite~System\.Data\.SQLite\.SQLiteModule\.SetTableError)\.html"}
set patterns(.html,7) \
{"(System\.Data\.SQLite~System\.Data\.SQLite\.SQLiteModule\.Dispose)\.html"}
set patterns(.html,8) \
{"(System\.Data\.SQLite~System\.Data\.SQLite\.SQLiteVirtualTableCursor\.Dispose)\.html"}
set subSpecs(.hhc,1) [readFileAsSubSpec [file join $path SQLite.NET.hhc]]
set subSpecs(.hhp,1) {Default topic=welcome.html}
set subSpecs(.hhp,2) {"welcome.html","welcome.html",,,,,}
set subSpecs(.html,1) {"System.Data.SQLite~\1.html"}
set subSpecs(.html,2) {9eekhta0}
set subSpecs(.html,3) {78dfe2yb}
set subSpecs(.html,4) {"\1~Overloads.html"}
set subSpecs(.html,5) {"\1~Overloads.html"}
set subSpecs(.html,6) {"\1~Overloads.html"}
set subSpecs(.html,7) {"\1~Overloads.html"}
set subSpecs(.html,8) {"\1~Overloads.html"}
foreach fileName $fileNames {
set fileName [file join $path $outputPath $fileName]
set fileName [file join $path $temporaryPath $fileName]
#
# NOTE: Make sure the file we need actually exists.
#
if {![file isfile $fileName]} then {
puts stdout "Cannot find file: $fileName"
exit 1
|
︙ | | |
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
|
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
|
+
+
+
+
-
+
-
+
-
+
|
}
set patternCount [regsub -all -- $pattern $data $subSpec data]
if {$patternCount > 0} then {
incr count $patternCount
} else {
#
# NOTE: This will emit multiple warnings for each file, making things
# a bit too noisy (by default).
#
puts stdout "*WARNING* File \"$fileName\" does not match: $pattern"
# puts stdout "*WARNING* File \"$fileName\" does not match: $pattern"
}
}
#
# NOTE: If we actually performed some replacements, rewrite the file.
#
if {$count > 0} then {
writeFile $fileName $data
}
}
set code [catch {exec [file join $hhcPath hhc.exe] \
[file nativename [file join $path $outputPath SQLite.NET.hhp]]} result]
[file nativename [file join $path $temporaryPath SQLite.NET.hhp]]} result]
#
# NOTE: For hhc.exe, zero means failure.
#
puts stdout $result; if {$code == 0} then {exit 1}
file copy -force [file join $path $outputPath SQLite.NET.chm] \
file copy -force [file join $path $temporaryPath SQLite.NET.chm] \
[file join $path SQLite.NET.chm]
puts stdout SUCCESS
exit 0
|
︙ | | |
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
[catch {tcl eval [tcl master] garuda packageid} packageId] == 0}]
} else {
return [expr {[catch {package present Garuda}] == 0 && \
[catch {garuda packageid} packageId] == 0}]
}
}
proc isTclThread { name } {
#
# NOTE: For now, this check only works in Eagle.
#
set result false
if {[isEagle]} then {
catch {
if {[llength [info commands tcl]] > 0 && [tcl ready] && \
[lsearch -exact -- [tcl threads] $name] != -1} then {
#
# NOTE: The name specified by the caller appears in the
# list of Tcl threads for this Eagle interpreter.
#
set result true
}
}
}
return $result
}
#
# NOTE: This is the procedure that detects whether or not we are
# running in Eagle on Mono (otherwise, we are running in Tcl
# or in Eagle on .NET). This procedure must function correctly
# in both Tcl and Eagle and must return non-zero only when
# running in Eagle on Mono.
#
|
︙ | | |
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
|
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
|
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
+
+
-
+
-
-
+
+
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
+
+
+
+
+
|
set command [list exec -- \
[file join $directory Hippogriff.exe] -delay 2000]
eval $command &; exit -force
}
#
# NOTE: This proc is used to check for new versions of the runtime
# when the user executes the interactive "#check" command. To
# disable that functionality, redefine this proc to do nothing.
#
proc checkForUpdate {} {
#
# NOTE: This should work properly in Eagle only.
#
set uri [appendArgs [info engine Uri] [info engine UpdateFile]]
set fileName [file tempname]; # unique local temp file name.
proc getUpdateData { uri } {
#
# NOTE: Temporarily start trusting ONLY our self-signed certificate
# which is used primarily for "software updates".
# NOTE: Temporarily start trusting ONLY our own self-signed
# certificate which is used primarily for updates.
#
uri softwareupdates true
try {
#
# NOTE: Download the tag file from the web site.
#
uri download $uri $fileName; # synchronous.
return [uri download -inline $uri]; # synchronous.
} finally {
#
# NOTE: Stop trusting ONLY our self-signed certificate which is
# used primarily for "software updates".
# NOTE: Stop trusting ONLY our own self-signed certificate
# which is used primarily for updates.
#
uri softwareupdates false
}
#
# NOTE: Read all the data out of the downloaded text file.
}
proc getUpdateScriptData { uri } {
#
# NOTE: Temporarily start trusting ONLY our own self-signed
# certificate which is used primarily for updates.
#
uri softwareupdates true
set data [readFile $fileName]
#
# NOTE: Remove the downloaded temporary file. We no longer need
# it because we just read all the data from it.
#
file delete $fileName
#
# NOTE: Normalize to Unix line-endings.
try {
#
# NOTE: Download the script file from the web site.
#
return [interp readorgetscriptfile $uri]; # synchronous.
} finally {
#
# NOTE: Stop trusting ONLY our own self-signed certificate
# which is used primarily for updates.
#
uri softwareupdates false
}
}
#
# NOTE: This proc is used to check for new versions -OR- new update
# scripts for the runtime when a user executes the interactive
# "#check" command. To disable this functionality, simply
# redefine this procedure to do nothing.
#
proc checkForUpdate { {wantScripts false} } {
#
# NOTE: This should work properly in Eagle only.
#
set updateUri [appendArgs [info engine Uri] [info engine UpdateFile]]
#
# NOTE: Fetch the master update data from the distribution site
# and normalize to Unix-style line-endings.
#
set data [string map [list \r\n \n] $data]; # Unix.
set updateData [string map [list \r\n \n] [getUpdateData $updateUri]]
#
# NOTE: Split the data into lines.
#
set lines [split $data \n]
set lines [split $updateData \n]
#
# NOTE: Keep track of how many update scripts are processed.
#
set scriptCount 0
#
# NOTE: Check each line to find the build information...
#
foreach line $lines {
#
# NOTE: Remove excess whitespace.
|
︙ | | |
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
|
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
|
-
+
-
-
-
+
+
+
+
|
#
# NOTE: Skip comment lines.
#
if {[string index $line 0] ne "#" && \
[string index $line 0] ne ";"} then {
#
# NOTE: Split the tab-delimited line into fields. The format
# of the lines must be as follows:
# of all lines in the data must be as follows:
#
# protocolId <tab> publicKeyToken <tab> name <tab> culture
# <tab> patchLevel <tab> timeStamp <tab> uri <tab> md5Hash
# <tab> sha1Hash <tab> sha512Hash <tab> notes <newLine>
# <startLine> protocolId <tab> publicKeyToken <tab> name
# <tab> culture <tab> patchLevel <tab> timeStamp <tab>
# baseUri <tab> md5Hash <tab> sha1Hash <tab> sha512Hash
# <tab> notes <newLine>
#
set fields [split $line \t]
#
# NOTE: Grab the protocol Id field.
#
set protocolId [lindex $fields 0]
|
︙ | | |
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
|
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
|
+
+
+
+
+
+
+
+
+
+
-
+
|
set name [lindex $fields 2]
#
# NOTE: Grab the culture field.
#
set culture [lindex $fields 3]
#
# NOTE: Figure out which protocol is in use for this line.
# The value "1" means this line specifies a build of
# the script engine. The value "2" means this line
# specifies an update script (via a URI) to evaluate.
# All other values are currently reserved and ignored.
#
set checkBuild [expr {!$wantScripts && $protocolId eq "1"}]
set checkScript [expr {$wantScripts && $protocolId eq "2"}]
#
# NOTE: We only want to find the first line that matches our
# engine. The public key token is being used here to
# make sure we get the same "flavor" of the engine.
# The lines are organized so that the "latest stable
# version" is on the first line (for a given public key
# token), followed by development builds, experimental
# builds, etc.
#
if {$protocolId eq "1" && \
if {($checkBuild || $checkScript) && \
[matchEnginePublicKeyToken $publicKeyToken] && \
[matchEngineName $name] && \
[matchEngineCulture $culture]} then {
#
# NOTE: Grab the patch level field.
#
set patchLevel [lindex $fields 4]
|
︙ | | |
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
|
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
|
-
+
+
-
+
|
#
# NOTE: Compare the patch level from the line to the one we
# are currently using.
#
set compare [package vcompare $patchLevel $enginePatchLevel]
if {$compare > 0} then {
if {($checkBuild && $compare > 0) || \
($checkScript && $compare == 0)} then {
#
# NOTE: Grab the time-stamp field.
#
set timeStamp [lindex $fields 5]
if {[string length $timeStamp] == 0} then {
set timeStamp 0; #never?
}
#
# NOTE: Grab the base URI field (i.e. it may be a mirror
# site).
#
set baseUri [lindex $fields 6]
if {[string length $baseUri] == 0} then {
if {$checkBuild && [string length $baseUri] == 0} then {
set baseUri [info engine Uri]; # primary site.
}
#
# NOTE: Grab the notes field (which may be empty).
#
set notes [lindex $fields 10]
|
︙ | | |
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
|
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
|
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
|
if {[string is integer -strict $timeStamp]} then {
set dateTime [clock format $timeStamp]
} else {
set dateTime [clock format [clock scan $timeStamp]]
}
#
# NOTE: The patch level from the line is greater, we are
# out-of-date.
# NOTE: The engine patch level from the line is greater,
# we are out-of-date. Return the result of our
# checking now.
#
if {$checkBuild} then {
return [list [appendArgs "newer build " $patchLevel \
" is available as of " $dateTime] [list $baseUri \
$patchLevel] [list $notes]]
}
#
# NOTE: The script patch level from the line matches the
# current engine patch level exactly, this script
# should be evaluated if it can be authenticated.
#
if {$checkScript} then {
#
# NOTE: First, set the default channel for update script
# status messages. If the test channel has been
# set (i.e. by the test suite), it will be used
# instead.
#
if {![info exists channel]} then {
set channel [expr {[info exists ::test_channel] ? \
$::test_channel : "stdout"}]
}
return [list [appendArgs "newer build " $patchLevel \
" is available as of " $dateTime] [list $baseUri \
$patchLevel] [list $notes]]
} elseif {$compare < 0} then {
#
# NOTE: Next, verify the script has a valid base URI.
# For update scripts, this must be the location
# where the update script data can be downloaded.
#
if {[string length $baseUri] == 0} then {
tqputs $channel [appendArgs \
"---- invalid baseUri value for update script line: " \
$line \"\n]
continue
}
#
# NOTE: Next, grab the md5 field and see if it looks valid.
# Below, the value of this field will be compared to
# that of the actual MD5 hash of the downloaded script
# data.
#
set lineMd5 [lindex $fields 7]
if {[string length $lineMd5] == 0} then {
tqputs $channel [appendArgs \
"---- invalid md5 value for update script line: " \
$line \"\n]
continue
}
#
# NOTE: Next, grab the sha1 field and see if it looks valid.
# Below, the value of this field will be compared to
# that of the actual SHA1 hash of the downloaded script
# data.
#
set lineSha1 [lindex $fields 8]
if {[string length $lineSha1] == 0} then {
tqputs $channel [appendArgs \
"---- invalid sha1 value for update script line: " \
$line \"\n]
continue
}
#
# NOTE: Next, grab the sha512 field and see if it looks
# valid. Below, the value of this field will be
# compared to that of the actual SHA512 hash of the
# downloaded script data.
#
set lineSha512 [lindex $fields 9]
if {[string length $lineSha512] == 0} then {
tqputs $channel [appendArgs \
"---- invalid sha512 value for update script line: " \
$line \"\n]
continue
}
#
# NOTE: Next, show the extra information associated with
# this update script, if any.
#
tqputs $channel [appendArgs \
"---- fetching update script from \"" $baseUri "\" (" \
$dateTime ") with notes:\n"]
set trimNotes [string trim $notes]
tqputs $channel [appendArgs \
[expr {[string length $trimNotes] > 0 ? $trimNotes : \
"<none>"}] "\n---- end of update script notes\n"]
#
# NOTE: Next, attempt to fetch the update script data.
#
set code [catch {getUpdateScriptData $baseUri} result]
if {$code == 0} then {
#
# NOTE: Success, set the script data from the result.
#
set scriptData $result
} else {
#
# NOTE: Failure, report the error message to the log.
#
tqputs $channel [appendArgs \
"---- failed to fetch update script: " $result \n]
continue
}
#
# NOTE: Next, verify that the md5, sha1, and sha512
# hashes of the raw script data match what was
# specified in the md5, sha1, and sha512 fields.
#
set scriptMd5 [hash normal md5 $scriptData]
if {![string equal -nocase $lineMd5 $scriptMd5]} then {
tqputs $channel [appendArgs \
"---- wrong md5 value \"" $scriptMd5 \
"\" for update script line: " $line \"\n]
continue
}
set scriptSha1 [hash normal sha1 $scriptData]
if {![string equal -nocase $lineSha1 $scriptSha1]} then {
tqputs $channel [appendArgs \
"---- wrong sha1 value \"" $scriptSha1 \
"\" for update script line: " $line \"\n]
continue
}
set scriptSha512 [hash normal sha512 $scriptData]
if {![string equal -nocase $lineSha512 $scriptSha512]} then {
tqputs $channel [appendArgs \
"---- wrong sha512 value \"" $scriptSha512 \
"\" for update script line: " $line \"\n]
continue
}
#
# NOTE: Finally, everything looks good. Therefore, just
# evaluate the update script and print the result.
#
tqputs $channel [appendArgs \
"---- evaluating update script from \"" $baseUri \
\"...\n]
#
# NOTE: Reset the variables that will be used to contain
# the result of the update script.
#
set code 0; set result ""
#
# NOTE: Manually override file name to be returned by
# [info script] to refer back to the originally
# read script base URI.
#
object invoke -flags +NonPublic Interpreter.GetActive \
PushScriptLocation $baseUri true
try {
#
# NOTE: Evaluate the update script in the context of
# the caller.
#
set code [catch {uplevel 1 $scriptData} result]
} finally {
#
# NOTE: Reset manual override of the script file name
# to be returned by [info script].
#
object invoke -flags +NonPublic Interpreter.GetActive \
PopScriptLocation true
}
host result $code $result; incr scriptCount
tqputs $channel "\n---- end of update script results\n"
}
} elseif {$checkBuild && $compare < 0} then {
#
# NOTE: The patch level from the line is less, we are more
# up-to-date than the latest version?
#
return [list [appendArgs "running build " $enginePatchLevel \
" is newer than the latest build " $patchLevel]]
} else {
} elseif {$checkBuild} then {
#
# NOTE: The patch levels are equal, we are up-to-date.
#
return [list "running build is the latest"]
}
}
}
}
}
#
# NOTE: Figure out what the final result should be. If we get
# to this point when checking for a new build, something
# must have gone awry. Otherwise, report the number of
# update scripts that were successfully processed.
#
if {$wantScripts} then {
if {$scriptCount > 0} then {
return [list [appendArgs \
"processed " $scriptCount " update scripts"]]
} else {
return [list "no update scripts were processed"]
}
} else {
return [list "cannot determine if running build is the latest"]
return [list "cannot determine if running build is the latest"]
}
}
proc getReturnType { object member } {
if {[string length $object] == 0 || [string length $member] == 0} then {
return ""
}
|
︙ | | |
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
|
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
|
-
+
+
+
+
+
+
+
+
+
+
+
+
|
}
proc getDefaultValue { typeName } {
if {[string length $typeName] == 0} then {
return ""
}
set type [object invoke -alias Type GetType $typeName]
set type [object invoke -create -alias Type GetType $typeName]
if {[string length $type] == 0} then {
return ""
}
return [expr {[$type IsValueType] ? 0 : "null"}]
}
proc getHostSize {} {
#
# NOTE: Attempt to query the size from the host; failing that,
# return a reasonable default value.
#
if {[catch {host size} result] == 0} then {
return $result
}
return [list 80 25]; # TODO: Good default?
}
proc parray { a args } {
if {[llength $args] > 2} then {
error "wrong # args: should be \"parray a ?pattern?\""
}
upvar 1 $a array
|
︙ | | |
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
|
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
|
-
+
|
if {$length > $maxLength} {
set maxLength $length
}
}
set maxLength [expr {$maxLength + [string length $a] + 2}]
set hostLength [lindex [host size] 0]
set hostLength [lindex [getHostSize] 0]
set valueLength [expr {$hostLength - $maxLength - 5}]; # " ... "
foreach name $names {
#
# NOTE: Format the array element name for display.
#
set nameString [appendArgs $a ( $name )]
|
︙ | | |
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
|
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
|
-
+
|
set length [string length $name]
if {$length > $maxLength} {
set maxLength $length
}
}
set hostLength [lindex [host size] 0]
set hostLength [lindex [getHostSize] 0]
set valueLength [expr {$hostLength - $maxLength - 5}]; # " ... "
foreach {name value} $d {
#
# NOTE: If the value by itself is too long to fit on one host line,
# just truncate and ellipsis it.
#
|
︙ | | |
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
|
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
|
+
+
+
+
+
+
+
+
+
+
+
|
}
}
}
return $result
}
proc loadWordTcl { directory } {
uplevel 1 [list source [file join $directory word.tcl]]
}
#
# NOTE: Add script library files borrowed from native Tcl.
#
if {![interp issafe]} then {
loadWordTcl [file dirname [info script]]
}
###########################################################################
############################# END Eagle ONLY ##############################
###########################################################################
} else {
###########################################################################
############################# BEGIN Tcl ONLY ##############################
###########################################################################
|
︙ | | |
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
|
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
|
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
|
}
#
# NOTE: Exports the necessary commands from this package and import them
# into the global namespace.
#
exportAndImportPackageCommands [namespace current] [list \
isEagle haveGaruda isMono getEnvironmentVariable combineFlags \
getCompileInfo getPlatformInfo getPluginPath appendArgs lappendArgs \
getDictionaryValue getColumnValue getRowColumnValue tqputs tqlog \
readFile readSharedFile writeFile appendFile appendLogFile \
appendSharedFile appendSharedLogFile readAsciiFile writeAsciiFile \
readUnicodeFile writeUnicodeFile getDirResultPath addToPath \
removeFromPath execShell lshuffle ldifference filter map reduce \
getLengthModifier debug findDirectories findFiles findFilesRecursive \
exportAndImportPackageCommands] false false
isEagle haveGaruda isTclThread isMono getEnvironmentVariable \
combineFlags getCompileInfo getPlatformInfo getPluginPath appendArgs \
lappendArgs getDictionaryValue getColumnValue getRowColumnValue \
tqputs tqlog readFile readSharedFile writeFile appendFile \
appendLogFile appendSharedFile appendSharedLogFile readAsciiFile \
writeAsciiFile readUnicodeFile writeUnicodeFile getDirResultPath \
addToPath removeFromPath execShell lshuffle ldifference filter map \
reduce getLengthModifier debug findDirectories findFiles \
findFilesRecursive exportAndImportPackageCommands] false false
###########################################################################
############################## END Tcl ONLY ###############################
###########################################################################
}
#
# NOTE: Provide the Eagle library package to the interpreter.
#
package provide Eagle.Library \
[expr {[isEagle] ? [info engine PatchLevel] : "1.0"}]
}
|
︙ | | |
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
|
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
|
-
-
+
+
-
-
+
+
-
-
+
+
-
+
|
if {[string length $string] > 0} then {
appendSharedLogFile $fileName $string
}
}
}
proc getSoftwareRegistryKey { wow64 } {
if {$wow64 && [info exists ::tcl_platform(machine)] && \
$::tcl_platform(machine) eq "amd64"} then {
if {$wow64 && [info exists ::tcl_platform(machine)] && [lsearch -exact \
[list ia64 amd64] $::tcl_platform(machine)] != -1} then {
#
# NOTE: Return the WoW64 registry key name because we are running on a
# 64-bit operating system and the caller specifically requested
# the WoW64 registry key name.
#
return Software\\Wow6432Node
} else {
#
# NOTE: Return the native registry key name because we are either not
# running on a 64-bit operating system or the caller wants the
# native registry key name (i.e. not the WoW64 registry key name).
#
return Software
}
}
proc haveConstraint { name } {
if {[isEagle]} then {
return [expr {
[info exists ::eagle_tests(constraints)] && \
[lsearch -exact $::eagle_tests(constraints) $name] != -1}]
[info exists ::eagle_tests(Constraints)] && \
[lsearch -exact $::eagle_tests(Constraints) $name] != -1}]
} else {
return [expr {
[info exists ::tcltest::testConstraints($name)] && \
$::tcltest::testConstraints($name)}]
}
}
proc addConstraint { name {value 1} } {
if {[isEagle]} then {
if {[info exists ::eagle_tests(constraints)] && \
[lsearch -exact $::eagle_tests(constraints) $name] == -1 && \
if {[info exists ::eagle_tests(Constraints)] && \
[lsearch -exact $::eagle_tests(Constraints) $name] == -1 && \
$value} then {
lappend ::eagle_tests(constraints) $name
lappend ::eagle_tests(Constraints) $name
}
} else {
::tcltest::testConstraint $name $value
}
return ""
}
|
︙ | | |
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
|
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
|
-
+
-
-
+
+
-
-
+
+
|
}
}
proc getConstraints {} {
set result [list]
if {[isEagle]} then {
if {[catch {set ::eagle_tests(constraints)} constraints] == 0} then {
if {[catch {set ::eagle_tests(Constraints)} constraints] == 0} then {
eval lappend result $constraints
}
} else {
foreach name [array names ::tcltest::testConstraints] {
if {$::tcltest::testConstraints($name)} then {
lappend result $name
}
}
}
return $result
}
proc removeConstraint { name } {
if {[isEagle]} then {
if {[info exists ::eagle_tests(constraints)]} then {
set index [lsearch -exact $::eagle_tests(constraints) $name]
if {[info exists ::eagle_tests(Constraints)]} then {
set index [lsearch -exact $::eagle_tests(Constraints) $name]
if {$index != -1} then {
set ::eagle_tests(constraints) [lreplace \
$::eagle_tests(constraints) $index $index]
set ::eagle_tests(Constraints) [lreplace \
$::eagle_tests(Constraints) $index $index]
}
}
} else {
if {[info exists ::tcltest::testConstraints($name)]} then {
unset ::tcltest::testConstraints($name)
}
}
|
︙ | | |
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
|
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
set result [join [split $result] " && "]
}
}
}
return $result
}
proc testArrayGet { varName {integer false} } {
#
# NOTE: Returns the results of [array get] in a well-defined order.
#
upvar 1 $varName array
#
# NOTE: Build the command that will sort the array names into order.
#
set command [list lsort]
if {$integer} then {lappend command -integer}
lappend command [array names array]
set result [list]
foreach name [eval $command] {
lappend result $name $array($name)
}
return $result
}
proc calculateBogoCops { {milliseconds 2000} {legacy false} } {
#
# NOTE: Verify that the number of milliseconds requested is greater than
# zero.
#
if {$milliseconds <= 0} then {
unset -nocomplain ::test_suite_running
error "number of milliseconds must be greater than zero"
}
#
# HACK: Different techniques are used here to calculate the performance of
# the machine for Tcl and Eagle.
#
|
︙ | | |
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
|
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
}
}
}
}
return $value
}
proc formatTimeStamp { seconds {gmt false} } {
if {[isEagle]} then {
return [clock format $seconds -gmt $gmt -iso -isotimezone]
} else {
return [clock format $seconds -gmt $gmt -format "%Y-%m-%dT%H:%M:%S %Z"]
}
}
proc formatElapsedTime { seconds } {
if {[isEagle]} then {
#
# NOTE: Create a TimeSpan instance based on the number of whole
# seconds.
#
set timeSpan [object invoke -create -alias TimeSpan FromSeconds \
$seconds]
#
# NOTE: Return the number of seconds and a human readable string
# representing the TimeSpan instance created based on that
# same number of seconds.
#
return [appendArgs $seconds " seconds (" [$timeSpan ToString] \
" elapsed time)"]
} else {
#
# NOTE: Unfortunately, there is no built-in native Tcl command
# that can correctly format an elapsed time; therefore,
# just return the number of whole seconds.
#
return [appendArgs $seconds " seconds"]
}
}
proc sourceIfValid { type fileName } {
if {[string length $fileName] > 0} then {
if {[file exists $fileName]} then {
tputs $::test_channel [appendArgs \
"---- evaluating $type file: \"" $fileName \"\n]
if {[catch {uplevel 1 [list source $fileName]} error]} then {
tputs $::test_channel [appendArgs \
"---- error during $type file: " $error \n]
#
# NOTE: The error has been logged, now re-throw it.
#
unset -nocomplain ::test_suite_running
error $error $::errorInfo $::errorCode
}
} else {
tputs $::test_channel [appendArgs \
"---- skipped $type file: \"" $fileName \
"\", it does not exist\n"]
}
|
︙ | | |
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
|
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
|
+
+
+
+
+
+
-
+
-
+
+
|
if {[llength $options] > 0} then {eval lappend command $options}
lappend command -- $commandName
if {[llength $args] > 0} then {eval lappend command $args}
if {[info exists ::no(exec)]} then {
tputs $::test_channel [appendArgs "---- skipping command: " $command \n]
set procName [lindex [info level [info level]] 0]
error "test use of \[$procName\] has been disabled"
} else {
tputs $::test_channel [appendArgs "---- running command: " $command \n]
tputs $::test_channel [appendArgs "---- running command: " $command \n]
return [uplevel 1 $command]
return [uplevel 1 $command]
}
}
proc testClrExec { commandName options args } {
set command [list exec]
if {[llength $options] > 0} then {eval lappend command $options}
|
︙ | | |
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
|
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
|
+
+
+
+
+
+
-
+
-
+
+
+
-
-
+
+
+
+
+
+
+
+
+
-
-
+
-
+
+
|
[appendArgs \" [file nativename $commandName] \"]
} else {
lappend command $commandName
}
if {[llength $args] > 0} then {eval lappend command $args}
if {[info exists ::no(exec)]} then {
tputs $::test_channel [appendArgs "---- skipping command: " $command \n]
set procName [lindex [info level [info level]] 0]
error "test use of \[$procName\] has been disabled"
} else {
tputs $::test_channel [appendArgs "---- running command: " $command \n]
tputs $::test_channel [appendArgs "---- running command: " $command \n]
return [uplevel 1 $command]
return [uplevel 1 $command]
}
}
proc execTestShell { options args } {
if {[info exists ::no(exec)]} then {
tputs $::test_channel [appendArgs \
"---- running nested shell: exec " \
tputs $::test_channel [appendArgs \
"---- skipping nested shell: exec " [string trim [appendArgs \
$options " " -- " \"" [info nameofexecutable] "\" " $args]] \n]
set procName [lindex [info level [info level]] 0]
error "test use of \[$procName\] has been disabled"
} else {
tputs $::test_channel [appendArgs \
"---- running nested shell: exec " [string trim [appendArgs \
[string trim [appendArgs $options " " -- " \"" \
[info nameofexecutable] "\" " $args]] \n]
$options " " -- " \"" [info nameofexecutable] "\" " $args]] \n]
return [uplevel 1 execShell [list $options] $args]
return [uplevel 1 execShell [list $options] $args]
}
}
proc isRandomOrder {} {
return [expr {[info exists ::test_random_order] && \
[string is boolean -strict $::test_random_order] && \
$::test_random_order}]
}
|
︙ | | |
972
973
974
975
976
977
978
979
980
981
982
983
984
985
|
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
|
+
|
# raise an error now. If we are being run from inside
# runAllTests, this will also serve to signal it to stop
# processing further test files.
#
if {$code != 0 && [isStopOnFailure]} then {
tresult Error "OVERALL RESULT: STOP-ON-FAILURE\n"
unset -nocomplain ::test_suite_running
error ""; # no message
}
} else {
if {$error} then {
tputs $::test_channel [appendArgs "ERROR (runTest): " $result \n]
}
|
︙ | | |
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
|
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
|
+
|
}
#
# NOTE: If the test raised an error, re-raise it now; otherwise,
# just return the result.
#
if {$error} then {
unset -nocomplain ::test_suite_running
error $result
} else {
return $result
}
}
proc recordTestStatistics { varName index } {
|
︙ | | |
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
|
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
|
-
-
+
+
+
-
-
-
-
-
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
+
+
-
-
-
-
-
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
|
if {$count > 0 && \
[lsearch -exact $fileNames [file tail $fileName]] == -1} then {
lappend fileNames [file tail $fileName]
}
}
proc formatList { list {default ""} {columns 1} } {
set count 1
set result ""
if {[catch {
set result ""
set count 1
foreach item $list {
if {[incr count -1] == 0} then {
set count $columns
append result \n
}
foreach item $list {
if {[incr count -1] == 0} then {
set count $columns
append result \n
}
append result \t
append result \t
if {[string length $item] > 0} then {
append result $item
} else {
append result <noItem>
}
}
return [expr {[string length $result] > 0 ? $result : $default}]
if {[string length $item] > 0} then {
append result $item
} else {
append result <noItem>
}
}
}] == 0} then {
return [expr {[string length $result] > 0 ? $result : $default}]
} else {
return ""
}
}
proc formatListAsDict { list {default ""} } {
if {[catch {
set result ""
set result ""
foreach {name value} $list {
append result \n\t
foreach {name value} $list {
append result \n\t
if {[string length $name] > 0} then {
append result $name
} else {
append result <noName>
}
if {[string length $name] > 0} then {
append result $name
} else {
append result <noName>
}
append result ": "
append result ": "
if {[string length $value] > 0} then {
append result $value
} else {
append result <noValue>
}
}
return [expr {[string length $result] > 0 ? $result : $default}]
if {[string length $value] > 0} then {
append result $value
} else {
append result <noValue>
}
}
}] == 0} then {
return [expr {[string length $result] > 0 ? $result : $default}]
} else {
return ""
}
}
proc pathToRegexp { path {list false} } {
#
# NOTE: This procedure needs to escape all characters that
# have any special meaning to the regular expression
# engine. Typically, the only characters we need to
|
︙ | | |
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
|
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
|
-
+
-
-
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
lappend result $fileName
}
}
return $result
}
proc formatDecimal { value {places 4} } {
proc formatDecimal { value {places 4} {zeros false} } {
if {[isEagle] && [llength [info commands object]] > 0} then {
#
# HACK: This works; however, in order to do this kind of thing cleanly,
# we really need the Tcl [format] command.
#
set result [object invoke String Format [appendArgs "{0:0." \
[string repeat # $places] "}"] [set object [object invoke \
-create Double Parse $value]]]
[string repeat [expr {$zeros ? "0" : "#"}] $places] "}"] \
[set object [object invoke -create Double Parse $value]]]
unset object; # dispose
} else {
#
# NOTE: See, nice and clean when done in Tcl?
#
set result [format [appendArgs %. $places f] $value]
}
return $result
}
proc clearTestPercent { channel } {
if {[isEagle]} then {
host title ""
}
}
proc reportTestPercent { channel percent failed leaked } {
set status [appendArgs "---- test suite running, about " $percent \
"% complete (" $failed " failed, " $leaked " leaked)..."]
proc reportTestPercent {
channel percent totalFiles failedFiles leakedFiles } {
if {[isEagle]} then {
set totalTests $::eagle_tests(Total)
set failedTests $::eagle_tests(Failed)
} else {
set totalTests $::tcltest::numTests(Total)
set failedTests $::tcltest::numTests(Failed)
}
set status [appendArgs \
"---- test suite running, about " $percent "% complete (" \
$totalTests " tests total, " $failedTests " tests failed, " \
$totalFiles " files total, " $failedFiles " files failed, " \
$leakedFiles " files leaked)..."]
tputs $channel [appendArgs $status \n]
if {[isEagle]} then {
host title $status
}
}
|
︙ | | |
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
|
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
|
-
+
|
# NOTE: In terms of files, not tests, what percent done are we now?
#
set percent [formatDecimal \
[expr {$total != 0 ? 100.0 * ($count / double($total)) : 100}]]
if {$percent != $lastPercent} then {
reportTestPercent $channel $percent \
[llength $failed] [llength $leaked]
$total [llength $failed] [llength $leaked]
set lastPercent $percent
}
#
# NOTE: Skipping over any file name that matches a pattern in the
# list of file names to skip.
|
︙ | | |
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
|
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
|
-
+
|
#
set ::test_file $fileName
#
# NOTE: Record failed test count before this file.
#
if {[isEagle]} then {
set before $::eagle_tests(failed)
set before $::eagle_tests(Failed)
} else {
set before $::tcltest::numTests(Failed)
}
#
# NOTE: Evaluate the file in the context of the caller,
# catching any errors. If an error is raised and the
|
︙ | | |
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
|
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
|
#
if {[isStopOnFailure]} then {
#
# NOTE: This will terminate the loop right after the test
# file cleanup code (i.e. at the bottom of the loop).
#
set stop true
#
# BUGFIX: If there are no actual test failures recorded yet,
# make sure there is one now. This is necessary to
# handle the case where an error occurs in a test
# file that does not directly cause at least one of
# its contained tests to fail. Otherwise, the test
# suite will still be stopped; however, an overall
# result of success will be returned by the process.
#
if {[isEagle]} then {
if {$::eagle_tests(Failed) == 0} then {
incr ::eagle_tests(Total)
incr ::eagle_tests(Failed)
}
} else {
if {$::tcltest::numTests(Failed) == 0} then {
incr ::tcltest::numTests(Total)
incr ::tcltest::numTests(Failed)
}
}
}
}
#
# NOTE: We evaluated another test file.
#
incr count
#
# NOTE: Record failed test count after this file.
#
if {[isEagle]} then {
set after $::eagle_tests(failed)
set after $::eagle_tests(Failed)
} else {
set after $::tcltest::numTests(Failed)
}
#
# NOTE: Did this file have any failing tests?
#
if {$after > $before} then {
lappend failed [file tail $fileName]
}
#
# NOTE: In terms of files, not tests, what percent done are we now?
#
set percent [formatDecimal \
[expr {$total != 0 ? 100.0 * ($count / double($total)) : 100}]]
if {$percent != $lastPercent} then {
reportTestPercent $channel $percent \
[llength $failed] [llength $leaked]
$total [llength $failed] [llength $leaked]
set lastPercent $percent
}
#
# NOTE: Unset the current test file name, it is no longer
# needed.
|
︙ | | |
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
|
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
|
-
+
|
# NOTE: In terms of files, not tests, what percent done are we now?
#
set percent [formatDecimal \
[expr {$total != 0 ? 100.0 * ($count / double($total)) : 100}]]
if {$percent != $lastPercent} then {
reportTestPercent $channel $percent \
[llength $failed] [llength $leaked]
$total [llength $failed] [llength $leaked]
set lastPercent $percent
}
#
# NOTE: If the test file raised an error (i.e. to indicate a
# test failure with the stop-on-failure flag enabled),
|
︙ | | |
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
|
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
|
-
+
|
# NOTE: In terms of files, not tests, what percent done are we now?
#
set percent [formatDecimal \
[expr {$total != 0 ? 100.0 * ($count / double($total)) : 100}]]
if {$percent != $lastPercent} then {
reportTestPercent $channel $percent \
[llength $failed] [llength $leaked]
$total [llength $failed] [llength $leaked]
set lastPercent $percent
}
}
#
# NOTE: Reset the host title because we may have changed it in the for
|
︙ | | |
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
|
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
|
+
+
+
+
+
+
+
+
-
+
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
|
if {[llength $leaked] > 0} then {
tputs $channel [appendArgs "---- files with leaking tests: " \
[formatList $leaked] \n]
}
reportTestStatisticCounts $channel leaks
}
proc isTestSuiteRunning {} {
#
# NOTE: Return non-zero if the test suite appears to be running.
#
return [expr {[info exists ::test_suite_running] && \
$::test_suite_running}]
}
proc configureTcltest { constraints imports force } {
if {[isEagle]} then {
#
# HACK: Flag the "test" and "runTest" script library procedures so
# that they use the script location of their caller and not
# their own.
#
# BUGBUG: Even this does not yet fix the script location issues in
# the test suite:
#
# debug procedureflags test +ScriptLocation
# debug procedureflags runTest +ScriptLocation
#
# HACK: Compatibility shim(s) for use with various tests in the Tcl
# NOTE: Setup the necessary compatibility shims for the test suite.
# test suite. Make sure these commands do not already exist
# prior to attempt to adding them.
#
if {[llength [info commands testConstraint]] == 0} then {
interp alias {} testConstraint {} haveOrAddConstraint
}
setupTestShims true [expr {![isTestSuiteRunning]}]
if {[llength [info commands ::tcltest::testConstraint]] == 0} then {
interp alias {} ::tcltest::testConstraint {} haveOrAddConstraint
}
#
# NOTE: This is needed by most tests in the Tcl test suite. Make
# sure this command does not already exist prior to adding it.
#
if {[llength [info commands ::tcltest::cleanupTests]] == 0} then {
proc ::tcltest::cleanupTests { args } {}
}
#
# NOTE: Fake having the tcltest package.
#
package provide tcltest 2.2.10; # Tcl 8.4
} else {
#
|
︙ | | |
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
|
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
|
-
-
-
-
+
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
-
+
+
+
-
+
-
-
+
+
|
proc initializeTests {} {
uplevel #0 {
#
# NOTE: Reset the information in the global "tests" array, which is
# used to interface with the internal test tracking information
# in the interpreter via a variable trace.
#
set eagle_tests(total) 0
set eagle_tests(skipped) 0
set eagle_tests(passed) 0
set eagle_tests(failed) 0
set eagle_tests(Total) 0
set eagle_tests(Skipped) 0
set eagle_tests(Passed) 0
set eagle_tests(Failed) 0
#
# NOTE: Setup the lists of patterns to match test names against. In
# Eagle, these originate from the command line arguments and are
# passed to the interpreter via this virtual array.
#
if {[info exists test_flags(-match)]} then {
set eagle_tests(matchNames) $test_flags(-match); # run these tests.
set eagle_tests(MatchNames) $test_flags(-match); # run these tests.
} else {
set eagle_tests(matchNames) [list *]; # default to running all tests.
set eagle_tests(MatchNames) [list *]; # default to running all tests.
}
if {[info exists test_flags(-skip)]} then {
set eagle_tests(skipNames) $test_flags(-skip); # skip these tests.
set eagle_tests(SkipNames) $test_flags(-skip); # skip these tests.
} else {
set eagle_tests(skipNames) [list]; # default to skipping no tests.
set eagle_tests(SkipNames) [list]; # default to skipping no tests.
}
#
# NOTE: What tests have been skipped, if any?
#
set eagle_tests(skippedNames) [list]
set eagle_tests(SkippedNames) [list]
#
# NOTE: What tests have failed, if any?
#
set eagle_tests(failedNames) [list]
set eagle_tests(FailedNames) [list]
#
# NOTE: Initialize the list of active test constraints from the
# environment variable and/or the test flags.
#
set eagle_tests(constraints) [getEnvironmentVariable testConstraints]
set eagle_tests(Constraints) [getEnvironmentVariable testConstraints]
if {[info exists test_flags(-constraints)]} then {
eval lappend eagle_tests(constraints) $test_flags(-constraints)
eval lappend eagle_tests(Constraints) $test_flags(-constraints)
}
}
}
proc getTestChannelOrDefault {} {
if {[info exists ::test_channel]} then {
return $::test_channel
}
return stdout; # TODO: Good default?
}
proc setupTestShims { setup {quiet false} } {
if {$setup} then {
#
# HACK: Compatibility shim(s) for use with various tests in the Tcl
# test suite. Make sure these commands do not already exist
# prior to attempt to adding them.
#
if {[llength [info commands testConstraint]] == 0} then {
interp alias {} testConstraint {} haveOrAddConstraint
if {!$quiet} then {
tqputs [getTestChannelOrDefault] [appendArgs \
"---- added \"testConstraint\" alias\n"]
}
}
if {[llength [info commands ::tcltest::testConstraint]] == 0} then {
interp alias {} ::tcltest::testConstraint {} haveOrAddConstraint
if {!$quiet} then {
tqputs [getTestChannelOrDefault] [appendArgs \
"---- added \"::tcltest::testConstraint\" alias\n"]
}
}
#
# NOTE: This is needed by most tests in the Tcl test suite. Make
# sure this command does not already exist prior to adding it.
#
if {[llength [info commands ::tcltest::cleanupTests]] == 0} then {
proc ::tcltest::cleanupTests { args } {}
if {!$quiet} then {
tqputs [getTestChannelOrDefault] [appendArgs \
"---- added \"::tcltest::cleanupTests\" procedure\n"]
}
}
} else {
#
# NOTE: Remove the compatibility shim command aliases that we setup
# earlier.
#
if {[lsearch -exact [info commands] \
::tcltest::cleanupTests] != -1} then {
rename ::tcltest::cleanupTests ""
if {!$quiet} then {
tqputs $::test_channel [appendArgs \
"---- removed \"::tcltest::cleanupTests\" procedure\n"]
}
}
if {[lsearch -exact [interp aliases] \
::tcltest::testConstraint] != -1} then {
interp alias {} ::tcltest::testConstraint {} {}
if {!$quiet} then {
tqputs $::test_channel [appendArgs \
"---- removed \"::tcltest::testConstraint\" alias\n"]
}
}
if {[lsearch -exact [interp aliases] testConstraint] != -1} then {
interp alias {} testConstraint {} {}
if {!$quiet} then {
tqputs $::test_channel [appendArgs \
"---- removed \"testConstraint\" alias\n"]
}
}
}
}
proc tresult { code result } {
host result $code $result; tlog $result
}
proc getPassPercentage {} {
if {$::eagle_tests(total) > 0} then {
if {$::eagle_tests(Total) > 0} then {
return [expr \
{100.0 * (($::eagle_tests(passed) + \
$::eagle_tests(skipped)) / \
double($::eagle_tests(total)))}]
{100.0 * (($::eagle_tests(Passed) + \
$::eagle_tests(Skipped)) / \
double($::eagle_tests(Total)))}]
}
return 0; # no tests were run, etc.
}
proc getSkipPercentage {} {
if {$::eagle_tests(total) > 0} then {
if {$::eagle_tests(Total) > 0} then {
return [expr \
{100.0 * ($::eagle_tests(skipped) / \
double($::eagle_tests(total)))}]
{100.0 * ($::eagle_tests(Skipped) / \
double($::eagle_tests(Total)))}]
}
return 0; # no tests were run, etc.
}
proc cleanupThread { thread {timeout 2000} } {
if {[$thread IsAlive]} then {
|
︙ | | |
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
|
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
|
+
+
+
+
+
+
+
+
+
+
+
+
|
}
} else {
return true; # already dead?
}
return false; # still alive (or error).
}
proc purgeAndCleanup { channel name } {
catch {uplevel 1 [list debug purge]} result
tputs $channel [appendArgs \
"---- purge \"" $name "\" results: " $result \n]
catch {uplevel 1 [list debug cleanup]} result
tputs $channel [appendArgs \
"---- cleanup \"" $name "\" results: " $result \n]
}
proc evalWithTimeout { script {milliseconds 2000} {resultVarName ""} } {
#
# NOTE: Verify that the number of milliseconds requested is greater than
# zero.
#
if {$milliseconds <= 0} then {
|
︙ | | |
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
|
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
|
+
+
+
+
+
+
-
+
|
# NOTE: Delete the temporary file we used to query the machine
# type for the native Tcl shell.
#
catch {file delete $fileName}
}
}
}
proc getTclVersionForTclShell {} {
return [testExecTclScript {
puts -nonewline stdout [info tclversion]
}]
}
proc getCommandsForTclShell {} {
return [testExecTclScript {
puts -nonewline stdout [info commands]
}]
}
proc getMachineForTclShell {} {
return [testExecTclScript {
puts -nonewline stdout $tcl_platform(machine)
}]
}
proc getTkVersion {} {
proc getTkVersionForTclShell {} {
return [testExecTclScript {
puts -nonewline stdout [package require Tk]; exit
}]
}
proc getGarudaDll {} {
#
|
︙ | | |
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
|
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
|
+
+
+
+
+
+
+
-
+
|
# NOTE: If there is no effective test configuration available, we
# cannot continue.
#
if {[string length $configuration] == 0} then {
return ""
}
#
# NOTE: Get the effective test suffix. This is allowed to be an
# empty string.
#
set suffix [getTestSuffix]
#
# NOTE: Build the full path and file name of the Garuda DLL, using
# the Eagle base path. Currently, this will only work
# correctly if the test suite is being run from inside the
# source tree.
#
return [file join $::base_path bin \
[machineToPlatform [getMachineForTclShell]] [appendArgs \
$configuration Dll $suffix] [appendArgs Garuda [info \
$configuration Dll] [appendArgs Garuda [info sharedlibextension]]]
sharedlibextension]]]
} else {
#
# NOTE: We are missing the base path, return nothing.
#
return ""
}
}
|
︙ | | |
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
|
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
-
+
-
+
+
+
+
-
+
+
+
+
+
+
+
-
+
+
+
-
+
+
+
+
-
+
-
+
+
+
+
|
object unimport -importpattern System.Windows.Forms.Design
object unimport -importpattern System.Windows.Forms.Layout
object unimport -importpattern System.Windows.Forms.PropertyGridInternal
object unimport -importpattern System.Windows.Forms.VisualStyles
}
proc getTestLibraryDirectory {} {
#
# NOTE: First, query the location of the script library.
#
set result [info library]
#
# NOTE: Next, If the script library is embedded within the core
# library itself (i.e. the script library location refers
# to a file, not a directory), strip off the file name.
#
if {[file exists $result] && [file isfile $result]} then {
set result [file dirname $result]
}
#
# NOTE: Finally, return the resulting script library directory.
#
return $result
}
#
# NOTE: Setup the test path relative to the library path.
#
if {![interp issafe] && ![info exists ::test_path]} then {
#
# NOTE: Try the source release directory structure.
# NOTE: Try the source release directory structure. For this case,
# the final test path would be:
#
# $library/../../Library/Tests
#
set ::test_path [file join [file normalize [file dirname \
[file dirname [info library]]]] Library Tests]
[file dirname [getTestLibraryDirectory]]]] Library Tests]
if {![file exists $::test_path] || \
![file isdirectory $::test_path]} then {
#
# NOTE: Try the source release directory structure again; this time,
# assume only the embedded script library was used.
# assume only the embedded script library was used. For this
# case, the final test path would be:
#
# $base/Library/Tests
#
set ::test_path [file join [info base] Library Tests]
}
if {![file exists $::test_path] || \
![file isdirectory $::test_path]} then {
#
# NOTE: Try for the test package directory.
# NOTE: Try for the test package directory. For this case, the final
# test path would be:
#
# $script/../Test1.0
#
set ::test_path [file join [file normalize [file dirname \
[file dirname [info script]]]] [appendArgs Test \
[info engine Version]]]
}
if {![file exists $::test_path] || \
![file isdirectory $::test_path]} then {
#
# NOTE: Try for the test package directory again; this time, use the
# base path and assume the source release directory structure.
# For this case, the final test path would be:
#
# $base/lib/Test1.0
#
set ::test_path [file join [info base] lib [appendArgs Test \
[info engine Version]]]
}
if {![file exists $::test_path] || \
![file isdirectory $::test_path]} then {
#
# NOTE: Try for the test package directory again; this time, use the
# base path.
# base path. For this case, the final test path would be:
#
# $base/Test1.0
#
set ::test_path [file join [info base] [appendArgs Test \
[info engine Version]]]
}
if {![file exists $::test_path] || \
![file isdirectory $::test_path]} then {
#
# NOTE: This must be a binary release, no "Library" directory then.
# Also, binary releases have an upper-case "Tests" directory
# name that originates from the "update.bat" tool. This must
# match the casing used in "update.bat".
# match the casing used in "update.bat". For this case, the
# final test path would be:
#
# $library/../../Tests
#
set ::test_path [file join [file normalize [file dirname \
[file dirname [info library]]]] Tests]
[file dirname [getTestLibraryDirectory]]]] Tests]
}
if {![file exists $::test_path] || \
![file isdirectory $::test_path]} then {
#
# NOTE: Fallback to using the base directory and checking for a
# "Tests" directory beneath it.
# "Tests" directory beneath it. For this case, the final
# test path would be:
#
# $base/Tests
#
set ::test_path [file join [info base] Tests]
}
}
#
# NOTE: Fake having the tcltest package unless we are prevented.
|
︙ | | |
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
|
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
|
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
|
#
# NOTE: We need several of our test related commands in the global
# namespace as well.
#
exportAndImportPackageCommands [namespace current] [list \
tputs tlog getSoftwareRegistryKey haveConstraint addConstraint \
haveOrAddConstraint getConstraints removeConstraint fixConstraints \
calculateBogoCops calculateRelativePerformance sourceIfValid \
processTestArguments getTclShellFileName getTemporaryPath getFiles \
getTestFiles getTestRunId getTestLogId getTestLog getTestSuite \
getTestMachine getTestPlatform getTestConfiguration getTestSuffix \
testExec testClrExec execTestShell isRandomOrder isStopOnFailure \
calculateBogoCops calculateRelativePerformance formatTimeStamp \
formatElapsedTime sourceIfValid processTestArguments \
getTclShellFileName getTemporaryPath getFiles getTestFiles \
getTestRunId getTestLogId getTestLog getTestSuite getTestMachine \
getTestPlatform getTestConfiguration getTestSuffix testExec \
testClrExec execTestShell isRandomOrder isStopOnFailure \
isExitOnComplete returnInfoScript runTestPrologue runTestEpilogue \
hookPuts unhookPuts runTest testShim tsource recordTestStatistics \
reportTestStatistics formatList formatListAsDict pathToRegexp \
inverseLsearchGlob removePathFromFileNames formatDecimal \
clearTestPercent reportTestPercent runAllTests configureTcltest \
machineToPlatform getPassPercentage getSkipPercentage] false false
hookPuts unhookPuts runTest testArrayGet testShim tsource \
recordTestStatistics reportTestStatistics formatList formatListAsDict \
pathToRegexp inverseLsearchGlob removePathFromFileNames formatDecimal \
clearTestPercent reportTestPercent runAllTests isTestSuiteRunning \
configureTcltest machineToPlatform getPassPercentage \
getSkipPercentage] false false
###########################################################################
############################## END Tcl ONLY ###############################
###########################################################################
}
#
# NOTE: Provide the Eagle test package to the interpreter.
#
package provide Eagle.Test \
[expr {[isEagle] ? [info engine PatchLevel] : "1.0"}]
}
|