Fossil SCM

fossil-scm / test / rewrite-test-output.tcl
Blame History Raw 646 lines
1
#!/usr/bin/env tclsh
2
3
# Script to anonymise test results for comparison.
4
# - Replaces hashes, pids and similar with fixed strings
5
# - Rewrites temporary paths to standardise them in output
6
7
# Pick up options
8
set EXTRA 0
9
set i [lsearch $argv -extra]
10
while { $i >= 0 } {
11
incr EXTRA
12
set argv [lreplace $argv $i $i]
13
set i [lsearch $argv -extra]
14
}
15
16
# With no arguments or "-", use stdin.
17
set fname "-"
18
if { [llength $argv] > 0 } {
19
set fname [lindex $argv 0]
20
}
21
22
# Any -options, or an empty first argument, is an error.
23
if { [llength $argv] > 1 || [regexp {^-.+} $fname] } {
24
puts stderr "Error: argument error"
25
puts stderr "usage: \[-extra\] [file tail $argv0] ?FILE"
26
puts stderr " Rewrite test output to ease comparison of outputs."
27
puts stderr " With -extra, more output is rewritten as is summaries"
28
puts stderr " to make diff(1) mor euseful across runs and platforms."
29
exit 1
30
} elseif { $fname ne "-" && ! [file exists $fname] } {
31
puts stderr "File does not exist: '$fname'"
32
exit 1
33
}
34
35
proc common_rewrites { line testname } {
36
# Normalise the fossil commands with path as just fossil
37
regsub {^(?:[A-Z]:)?/.*?/fossil(?:\.exe)? } $line {fossil } line
38
if {[string match "Usage: *" $line]} {
39
regsub {^(Usage: )/.*?/fossil(?:\.exe)? } $line {\1fossil } line
40
regsub {^(Usage: )[A-Z]:\\.*?\\fossil(?:\.exe)? } $line {\1fossil } line
41
}
42
43
# Accept 40 and 64 byte hashes as such
44
regsub -all {[[:<:]][0-9a-f]{40}[[:>:]]} $line HASH line
45
regsub -all {[[:<:]][0-9a-f]{64}[[:>:]]} $line HASH line
46
47
# Date and time
48
regsub -all {[[:<:]]\d{4}-\d\d-\d\d \d\d:\d\d:\d\d[[:>:]]} $line {YYYY-mm-dd HH:MM:SS} line
49
if { [lsearch -exact {"amend" "wiki"} $testname] >= 0 } {
50
# With embedded T and milliseconds
51
regsub { \d{4}-\d\d-\d\dT\d\d:\d\d:\d\d\.\d{3}$} $line { YYYY-mm-ddTHH:MM:SS.NNN} line
52
}
53
if { [lsearch -exact {"amend" "th1-hooks" "wiki"} $testname] >= 0 } {
54
regsub {[[:<:]]\d{4}-\d\d-\d\d[[:>:]]} $line {YYYY-mm-dd} line
55
}
56
57
# Timelines have HH:MM:SS [HASH], but don't mess with the zero'ed version.
58
regsub {^(?!00:00:00 \[0000000000\])\d\d:\d\d:\d\d \[[0-9a-f]{10}\] } $line {HH:MM:SS [HASH] } line
59
60
# Temporary directories
61
regsub -all {(?:[A-Z]:)?/.*?/repo_\d+/\d+_\d+} $line {/TMP/repo_PID/SEC_SEQ} line
62
# Home directories only seem present with .fossil or _fossil. Simplify to .fossil.
63
regsub -all {(?:[A-Z]:)?/.*?/home_\d+/[._]fossil[[:>:]]} $line {/TMP/home_PID/.fossil} line
64
65
# Users in output
66
regsub { (\(user: )[^\)]*\)$} $line { \1USER)} line
67
68
return $line
69
}
70
71
#
72
# tests/tests_unix/tests_windows contain tuples of
73
#
74
# 1. A regular expression to match current line
75
# 2. A substitution for the current line
76
#
77
# Some common patterns applicable to multiples tests are appended below.
78
#
79
# The common_rewrites procedure is run first, so use e.g. HASH as needed.
80
#
81
82
dict set tests "amend" {
83
{^(fossil artifact) [0-9a-f]{10}}
84
{\1 HASH}
85
{^U [^ ]+$}
86
{U USER}
87
{^Z [0-9a-f]{32}$}
88
{Z CHECKSUM}
89
{^(ed -s \./ci-comment-).*?(\.txt)$}
90
{\1UNIQ\2}
91
{^(fossil amend HASH -date \{?)\d\d/\d\d/\d{4}}
92
{\1dd/mm/YYYY}
93
{^(fossil amend HASH -date \{.* )\d{4}(\})$}
94
{\1YYYY\2}
95
{^(fossil amend HASH -date \{.* )\d\d:}
96
{\1HH:}
97
{^(fossil amend HASH -date \{)[A-Z][a-z]{2} [A-Z][a-z]{2} [ 0-9]\d }
98
{\1Day Mon dd }
99
{(\] Edit \[)[0-9a-f]{16}.[0-9a-f]{10}(\]: )}
100
{\1HASH1|HASH2\2}
101
{(\] Edit \[.*?&dp=)[0-9a-f]{16}}
102
{\1dp=HASH}
103
}
104
105
dict set tests "cmdline" {
106
{^(fossil test-echo --args) .*/}
107
{\1 /TMP/}
108
{^(g\.nameOfExe =) \[[^\]]+[/\\]fossil(?:\.exe)?\]$}
109
{\1 [/PATH/FOSSILCMD]}
110
{^(argv\[0\] =) \[[^\]]+[/\\]fossil(?:\.exe)?\]$}
111
{\1 [/PATH/FOSSILCMD]}
112
}
113
114
dict set tests "contains-selector" {
115
{^(fossil test-contains-selector) .*?/(compare-selector.css )}
116
{\1 /TMP/\2}
117
}
118
119
dict set tests "json" {
120
{^(Content-Length) \d+$}
121
{\1 LENGTH}
122
{^(Cookie: fossil-)[0-9a-f]{16}(\=HASH%2F)\d+\.\d+(%2Fanonymous)$}
123
{\1CODE\2NOW\3}
124
{^(GET /json/cap\?authToken\=HASH)/\d+\.\d+/(anonymous )}
125
{\1/NOW/\2}
126
{^(Cookie: fossil-)[0-9a-f]{16}\=[0-9A-F]{50}%2F[0-9a-f]{16}%2F(.*)$}
127
{\1CODE=SHA1%2FCODE%2F\2}
128
{("authToken":").+?(")}
129
{\1AUTHTOKEN\2}
130
{("averageArtifactSize":)\d+()}
131
{\1SIZE\2}
132
{("compiler":").+?(")}
133
{\1COMPILER\2}
134
{("loginCookieName":").+?(")}
135
{\1COOKIE\2}
136
{("manifestVersion":"\[)[0-9a-f]{10}(\]")}
137
{\1HASH\2}
138
{("manifestYear":")\d{4}(")}
139
{\1YYYY\2}
140
{("name":").+?(")}
141
{\1NAME\2}
142
{("password":")[0-9a-f]+(")}
143
{\1PASSWORD\2}
144
{("projectCode":")[0-9a-f]{40}(")}
145
{\1HASH\2}
146
{("procTimeMs":)\d+}
147
{\1MSEC}
148
{("procTimeUs":)\d+}
149
{\1USEC}
150
{("releaseVersion":")\d+\.\d+(")}
151
{\1VERSION\2}
152
{("releaseVersionNumber":")\d+(")}
153
{\1VERSION_NUMBER\2}
154
{("timestamp":)\d+}
155
{\1SEC}
156
{("seed":)\d+()}
157
{\1SEED\2}
158
{("uid":)\d+()}
159
{\1UID\2}
160
{("uncompressedArtifactSize":)\d+()}
161
{\1SIZE\2}
162
{("user":").+?(")}
163
{\1USER\2}
164
{("version":"YYYY-mm-dd HH:MM:SS )\[[0-9a-f]{10}\] \(\d+\.\d+\.\d+\)"}
165
{\1[HASH] (major.minor.patch)}
166
{^(Date:) [A-Z][a-z]{2}, \d\d? [A-Z][a-z]{2} \d{4} \d\d:\d\d:\d\d [-+]\d{4}$}
167
{\1 Day, dd Mon YYYY HH:MM:SS TZ}
168
}
169
170
dict set tests "merge_renames" {
171
{^(size: {7})\d+( bytes)$}
172
{\1N\2}
173
{^(type: {7}Check-in by ).+?( on YYYY-mm-dd HH:MM:SS)$}
174
{\1USER\2}
175
}
176
177
dict set tests "set-manifest" {
178
{^(project-code: )[0-9a-f]{40}$}
179
{\1HASH} line
180
}
181
182
dict set tests "stash" {
183
{^(---|\+\+\+) NUL$}
184
{\1 /dev/null}
185
{(^ 1: \[)[0-9a-f]{14}(\] on YYYY-mm-dd HH:MM:SS)$}
186
{\1HASH\2}
187
{(^ 1: \[)[0-9a-f]{14}(\] from YYYY-mm-dd HH:MM:SS)$}
188
{\1HASH\2}
189
}
190
191
dict set tests "th1" {
192
{^(fossil test-th-source) (?:[A-Z]:)?.*?/(th1-)\d+([.]th1)$}
193
{\1 /TMP/\2PID\3}
194
{^(?:[A-Z]:)?[/\\].*?[/\\]fossil(?:\.exe)?$}
195
{/PATH/FOSSILCMD}
196
{[[:<:]](Content-Security-Policy[[:>:]].*'nonce-)[0-9a-f]{48}(';)}
197
{\1NONCE\2}
198
{^(<link rel="stylesheet" href="/style.css\?id=)[0-9a-f]+(" type="text/css">)$}
199
{\1ID\2}
200
{^\d+\.\d{3}(s by)$}
201
{N.MMM\1}
202
{^(Fossil) \d+\.\d+ \[[0-9a-f]{10}\] (YYYY-mm-dd HH:MM:SS)$}
203
{\1 N.M [HASH] \2}
204
{^(<script nonce=")[0-9a-f]{48}(">/\* style\.c:)\d+}
205
{\1NONCE\2LINENO}
206
}
207
208
dict set tests "th1-docs" {
209
{^(check-ins: ).*}
210
{\1COUNT}
211
{^(local-root: ).*}
212
{\1/PATH/}
213
{^(repository: ).*}
214
{\1/PATH/REPO}
215
{^(comment: ).*}
216
{\1/COMMENT/}
217
{^(tags: ).*}
218
{\1/TAGS/}
219
{(--ipaddr 127\.0\.0\.1) .*? (--localauth)}
220
{\1 REPO \2}
221
}
222
223
dict set tests "th1-hooks" {
224
{^(?:/[^:]*/fossil|[A-Z]:\\[^:]*\\fossil\.exe): (unknown command:|use \"help\")}
225
{fossil: \1}
226
{^(project-code: )[0-9a-f]{40}$}
227
{\1HASH}
228
}
229
230
dict set tests "th1-tcl" {
231
{^(fossil test-th-render --open-config) \{?.*?[/\\]test[/\\]([^/\\]*?)\}?$}
232
{\1 /CHECKOUT/test/\2}
233
{^(fossil)(?:\.exe)?( 3 \{test-th-render --open-config )(?:\{[A-Z]:)?[/\\].*?[/\\]test[/\\](th1-tcl9.txt\})\}?$}
234
{\1\2/CHECKOUT/test/\3}
235
{^\d{10}$}
236
{SEC}
237
}
238
239
dict set tests "unversioned" {
240
{^(fossil user new uvtester.*) \d+$}
241
{\1 PASSWORD}
242
{^(fossil .*http://uvtester:)\d+(@localhost:)\d+}
243
{\1PASSWORD\2PORT}
244
{^(Pull from http://uvtester@localhost:)\d+}
245
{\1PORT}
246
{^(ERROR \(1\): Usage:) .*?[/\\]fossil(?:\.exe)? (unversioned)}
247
{\1 /PATH/fossil \2}
248
{^(Started Fossil server, pid \")\d+(\", port \")\d+}
249
{\1PID\2PORT}
250
{^(Now in client directory \")(?:[A-Z]:)?/.*?/uvtest_\d+_\d+\"}
251
{\1/TMP/uvtest_SEC_SEQ}
252
{^(Stopped Fossil server, pid \")\d+(\", using argument \")(?:\d+|[^\"]*\.stopper)(\")}
253
{\1PID\2PID_OR_SCRIPT\3}
254
{^(This is unversioned file #4\.) \d+ \d+}
255
{\1 PID SEC}
256
{^(This is unversioned file #4\. PID SEC) \d+ \d+}
257
{\1 PID SEC}
258
{^[0-9a-f]{12}( YYYY-mm-dd HH:MM:SS *)(\d+)( *)\2( unversioned4.txt)$}
259
{HASH \1SZ\3SZ\4}
260
{^[0-9a-f]{40}$}
261
{\1HASH}
262
{^((?:Clone|Pull)? done, wire bytes sent: )\d+( received: )\d+( remote: )(?:127\.0.0\.1|::1)$}
263
{\1SENT\2RECV\3LOCALIP}
264
{^(project-id: )[0-9a-f]{40}$}
265
{\1HASH}
266
{^(server-id: )[0-9a-f]{40}$}
267
{\1HASH}
268
{^(admin-user: uvtester \(password is ").*("\))$}
269
{\1PASSWORD\2}
270
{^(repository: ).*?/uvtest_\d+_\d+/(uvrepo.fossil)$}
271
{\1/TMP/uvtest_SEC_SEQ/\2}
272
{^(local-root: ).*?/uvtest_\d+_\d+/$}
273
{\1/TMP/uvtest_SEC_SEQ/}
274
{^(project-code: )[0-9a-f]{40}$}
275
{\1HASH}
276
}
277
278
dict set tests "utf" {
279
{^(fossil test-looks-like-utf) (?:[A-Z]:)?/.*?/([^/\\]*?)\}?$}
280
{\1 /TMP/test/\2}
281
{^(File ")(?:[A-Z]:)?/.*?/(utf-check-\d+-\d+-\d+-\d+.jnk" has \d+ bytes\.)$}
282
{\1/TMP/\2}
283
}
284
285
dict set tests "wiki" {
286
{^(fossil (?:attachment|wiki) .*--technote )[0-9a-f]{21}$}
287
{\1HASH}
288
{^(fossil (?:attachment|wiki) .* (?:a13|f15|fa) --technote )[0-9a-f]+$}
289
{\1ID}
290
{^[0-9a-f]{40}( YYYY-mm-dd HH:MM:SS)}
291
{HASH\1}
292
{(\] Add attachment \[/artifact/)[0-9a-f]{16}(|)}
293
{\1HASH\2}
294
{ (to tech note \[/technote/)[0-9a-f]{16}\|[0-9a-f]{10}(\] \(user:)}
295
{\1HASH1|HASH2\2}
296
{^(ambiguous tech note id: )[0-9a-f]+$}
297
{\1ID}
298
{^(Attached fa to tech note )[0-9a-f]{21}(?:[0-9a-f]{19})?\.$}
299
{\1HASH.}
300
{^(Date:) [A-Z][a-z]{2}, \d\d? [A-Z][a-z]{2} \d{4} \d\d:\d\d:\d\d [-+]\d{4}$}
301
{\1 Day, dd Mon YYYY HH:MM:SS TZ}
302
{(Content-Security-Policy.*'nonce-)[0-9a-f]{48}(';)}
303
{\1NONCE\2}
304
{^(<link rel="stylesheet" href="/style.css\?id=)[0-9a-f]+(" type="text/css">)$}
305
{\1ID\2}
306
{^(added by )[^ ]*( on)$}
307
{\1USER\2}
308
{^(<script nonce=['\"])[0-9a-f]{48}(['\"]>/\* [a-z]+\.c:)\d+}
309
{\1NONCE\2LINENO}
310
{^(<script nonce=['\"])[0-9a-f]{48}(['\"]>)$}
311
{\1NONCE\2}
312
{^(projectCode: ")[0-9a-f]{40}(",)$}
313
{\1HASH\2}
314
{^\d+\.\d+(s by)$}
315
{N.SUB\1}
316
{^(window\.fossil.version = ")\d+\.\d+ \[[0-9a-f]{10}\] (YYYY-mm-dd HH:MM:SS(?: UTC";)?)$}
317
{\1N.M [HASH] \2}
318
{^(Fossil) \d+\.\d+ \[[0-9a-f]{10}\]( YYYY-mm-dd HH:MM:SS)$}
319
{\1 N.M [HASH]\2}
320
{^(type: Wiki-edit by ).+?( on YYYY-mm-dd HH:MM:SS)$$}
321
{\1USER\2}
322
{^(size: )\d+( bytes)$}
323
{\1N\2}
324
{^U [^ ]+$}
325
{U USER}
326
{^Z [0-9a-f]{32}$}
327
{Z CHECKSUM}
328
}
329
330
#
331
# Some pattersn are used in multiple groups
332
#
333
334
set testnames {"th1" "th1-docs" "th1-hooks"}
335
set pat {^((?:ERROR \(1\): )?/[*]{5} Subprocess) \d+ (exit)}
336
set sub {\1 PID \2}
337
foreach testname $testnames {
338
dict lappend tests $testname $pat $sub
339
}
340
341
set testnames {"th1-docs" "th1-hooks"}
342
set pat {(?:[A-Z]:)?/.*?/(test-http-(?:in|out))-\d+-\d+-\d+(\.txt)}
343
set sub {/TMP/\1-PID-SEQ-SEC\2}
344
foreach testname $testnames {
345
dict lappend tests $testname $pat $sub
346
}
347
348
set testnames {"json" "th1" "wiki"}
349
set pat {^(Content-Length:) \d+$}
350
set sub {\1 LENGTH}
351
foreach testname $testnames {
352
dict lappend tests $testname $pat $sub
353
}
354
355
set testnames {"th1" "wiki"}
356
set pat {^\d+\.\d+(s by)$}
357
set sub {N.SUB\1}
358
foreach testname $testnames {
359
dict lappend tests $testname $pat $sub
360
}
361
362
#
363
# Main
364
#
365
366
if { $fname eq "-" } {
367
set fd stdin
368
} else {
369
set fd [open $fname r]
370
}
371
372
# Platforms we detect
373
set UNKOWN_PLATFORM 0
374
set UNIX 1
375
set WINDOWS 2
376
set CYGWIN 3
377
378
# One specific wiki test creates repetitive output of varying length
379
set wiki_f13_cmd1 "fossil wiki create {timestamp of 2399999} f13 --technote 2399999"
380
set wiki_f13_cmd2 "fossil wiki list --technote --show-technote-ids"
381
set wiki_f13_cmd3 "fossil wiki export a13 --technote ID"
382
set collecting_f3 0
383
set collecting_f3_verbose 0
384
385
# Collected lines for summaries in --extra mode
386
set amend_ed_lines [list]
387
set amend_ed_failed 0
388
set symlinks_lines [list]
389
set symlinks_failed 0
390
set test_simplify_name_lines [list]
391
set test_simplify_name_failed 0
392
393
# State information s we progress
394
set check_json_empty_line 0
395
set lineno 0
396
set platform $UNKOWN_PLATFORM
397
set prev_line ""
398
set testname ""
399
400
while { [gets $fd line] >= 0 } {
401
incr lineno
402
403
if { $lineno == 1 } {
404
if { [string index $line 0] in {"\UFFEF" "\UFEFF"} } {
405
set line [string range $line 1 end]
406
}
407
}
408
409
# Remove RESULT status while matching (inserted again in output).
410
# If collecting lines of output, include $result_prefix as needed.
411
regexp {^(RESULT \([01]\): )?(.*)} $line match result_prefix line
412
413
if { [regsub {^\*{5} ([^ ]+) \*{6}$} $line {\1} new_testname] } {
414
# Pick up test name for special handling below
415
set testname "$new_testname"
416
} elseif { [regexp {^\*{5} End of } $line] } {
417
# Test done. Handle --extra before resetting.
418
if { $EXTRA } {
419
if { $testname eq "symlinks" } {
420
if { $symlinks_failed } {
421
foreach l $symlinks_lines {
422
puts "$l"
423
}
424
} else {
425
puts "All symlinks tests OK (not run on Windows)"
426
}
427
}
428
regsub {(: )\d+( errors so far)} $line {\1N\2} line
429
}
430
set testname ""
431
} elseif { $testname ne "" } {
432
if { $platform == $UNKOWN_PLATFORM } {
433
if { [regexp {^[A-Z]:/.*?/fossil\.exe } $line] } {
434
set platform $WINDOWS
435
} elseif { [regexp {^/.*?/fossil\.exe } $line] } {
436
# No drive, but still .exe - must be CYGWIN
437
set platform $CYGWIN
438
} elseif { [regexp {^/.*?/fossil } $line] } {
439
set platform $UNIX
440
}
441
}
442
443
# Do common and per testname rewrites
444
set line [common_rewrites $line $testname]
445
if { [dict exists $tests $testname] } {
446
foreach {pat sub} [dict get $tests $testname] {
447
regsub $pat $line $sub line
448
}
449
}
450
451
# On Windows, HTTP headers may get printed with an extra newline
452
if { $testname eq "json" } {
453
if { $check_json_empty_line == 1 } {
454
if { "$result_prefix$line" eq "" } {
455
set check_json_empty_line 2
456
continue
457
}
458
set check_json_empty_line 0
459
} elseif { [regexp {^(?:$|GET |POST |[A-Z][A-Za-z]*(?:-[A-Z][A-Za-z]*)*: )} $line] } {
460
set check_json_empty_line 1
461
} else {
462
if { $check_json_empty_line == 2 } {
463
# The empty line we skipped was meant to be followed by a new
464
# HTTP header or empty line, but it was not.
465
puts ""
466
}
467
set check_json_empty_line 0
468
}
469
}
470
471
# Summarise repetitive output of varying length for f13 in wiki test
472
if { $testname eq "wiki" } {
473
if { $collecting_f3 == 2 } {
474
if { $collecting_f3_verbose == 1 && [regexp {^HASH } $line] } {
475
incr collecting_f3_verbose
476
} elseif { $line eq $wiki_f13_cmd3 } {
477
incr collecting_f3
478
puts "\[...\]"
479
} else {
480
continue
481
}
482
} elseif { $collecting_f3 == 1 } {
483
if { $line eq $wiki_f13_cmd2 } {
484
incr collecting_f3
485
} elseif { $collecting_f3_verbose == 0 } {
486
incr collecting_f3_verbose
487
}
488
} elseif { $line eq $wiki_f13_cmd1 } {
489
incr collecting_f3
490
}
491
}
492
493
if { $EXTRA } {
494
if { $line eq "ERROR (0): " && $platform == $WINDOWS } {
495
if { [string match "fossil http --in *" $prev_line] } {
496
continue
497
}
498
}
499
if { $testname eq "amend" } {
500
# The amend-comment-5.N tests are not run on Windows
501
if { $line eq "fossil amend {} -close" } {
502
if { $amend_ed_failed } {
503
foreach l $amend_ed_lines {
504
puts "$l"
505
}
506
} else {
507
puts "All amend tests based on ed -s OK (not run on Windows)"
508
}
509
set amend_ed_lines [list]
510
} elseif { [llength $amend_ed_lines] } {
511
if { [regexp {^test amend-comment-5\.\d+ (.*)} $line match status] } {
512
lappend amend_ed_lines "$result_prefix$line"
513
if { $status ne "OK" } {
514
incr amend_ed_failed
515
}
516
continue
517
} elseif { [string range $line 0 4] eq "test " } {
518
# Handle change in tests by simply emitting what we got
519
foreach l $amend_ed_lines {
520
puts "$l"
521
}
522
set amend_ed_lines [list]
523
} else {
524
lappend amend_ed_lines "$result_prefix$line"
525
continue
526
}
527
} elseif { $line eq "fossil settings editor {ed -s}" } {
528
lappend amend_ed_lines "$result_prefix$line"
529
continue
530
}
531
} elseif { $testname eq "cmdline" } {
532
if { [regexp {^(fossil test-echo) (.*)} $line match test args] } {
533
if { ($platform == $UNIX && $args in {"*" "*.*"})
534
|| ($platform == $WINDOWS && $args eq "--args /TMP/fossil-cmd-line-101.txt")
535
|| ($platform == $CYGWIN && $args in {"*" "*.*"}) } {
536
set line "$test ARG_FOR_PLATFORM"
537
}
538
}
539
} elseif { $testname eq "commit-warning" } {
540
if { [regexp {^(micro-smile|pale facepalm) .*} $line match desc] } {
541
set line "$desc PLATFORM_SPECIFIC_BYTES"
542
}
543
} elseif { $testname eq "file1" } {
544
# test-simplify-name with question marks is specific to Windows
545
# They all immediately preceed "fossil test-relative-name --chdir . ."
546
if { $line eq "fossil test-relative-name --chdir . ." } {
547
if { $test_simplify_name_failed } {
548
foreach l $test_simplify_name_lines {
549
puts "$l"
550
}
551
} else {
552
puts "ALL Windows specific test-relative-name tests OK (if on Windows)"
553
}
554
set test_simplify_name_lines [list]
555
} elseif { [regexp {^fossil test-simplify-name .*([/\\])\?\1} $line] } {
556
lappend test_simplify_name_lines $line
557
continue
558
} elseif { [llength $test_simplify_name_lines] } {
559
if { [regexp {^test simplify-name-\d+ (.*)} $line match status] } {
560
if { $status ne "OK" } {
561
incr test_simplify_name_failed
562
}
563
}
564
lappend test_simplify_name_lines "$result_prefix$line"
565
continue
566
}
567
} elseif { $testname eq "settings-repo" } {
568
if { [regexp {^fossil test-th-eval (?:--open-config )?\{setting case-sensitive\}$} $prev_line] } {
569
if { ($platform == $UNIX && $line eq "on")
570
|| ($platform == $WINDOWS && $line eq "off")
571
|| ($platform == $CYGWIN && $line eq "off")
572
} {
573
set line "EXPECTED_FOR_PLATFORM"
574
}
575
}
576
} elseif { $testname eq "symlinks" } {
577
# Collect all lines and post-process at the end
578
lappend symlinks_lines "$result_prefix$line"
579
if { [regexp {^test symlinks-[^ ]* (.*)} $line match status] } {
580
if { $status ne "OK" } {
581
#TODO: incr symlinks_failed
582
}
583
}
584
continue
585
} elseif { $testname in {"th1" "th1-docs" "th1-hooks"} } {
586
# Special case that spans a couple of tests
587
# "Subprocess PID exit(0)" is sent on stderr on Unix. On Windows, there is no output
588
if { [regexp {^(ERROR \(1\): )?/\*{5} Subprocess PID exit\(0\) \*{5}/$} $line match prefix] } {
589
if { $prefix eq "" } {
590
continue
591
} elseif { $prefix eq "ERROR (1): " } {
592
set line "RESULT (0): "
593
}
594
} elseif { $testname eq "th1" } {
595
if { [regexp {^fossil test-th-eval --vfs ([^ ]+) \{globalState vfs\}$} $line match vfs] } {
596
if { ($platform == $UNIX && $vfs == "unix-dotfile")
597
|| ($platform == $WINDOWS && $vfs == "win32-longpath")
598
|| ($platform == $CYGWIN && $vfs == "win32-longpath") } {
599
regsub $vfs $line {EXEPECTED_VFS} line
600
}
601
} elseif { $prev_line eq "fossil test-th-eval --vfs EXEPECTED_VFS {globalState vfs}" } {
602
# Replace $vfs from previous line
603
regsub "^$vfs\$" $line {EXEPECTED_VFS} line
604
} elseif { $prev_line eq "fossil test-th-eval {set tcl_platform(platform)}" } {
605
if { $platform == $UNIX } {
606
regsub {^unix$} $line {EXPECTED_PLATFORM} line
607
} elseif { $platform == $WINDOWS } {
608
regsub {^windows$} $line {EXPECTED_PLATFORM} line
609
} elseif { $platform == $CYGWIN } {
610
regsub {^unix$} $line {EXPECTED_PLATFORM} line
611
}
612
} elseif { [string match "fossil test-th-eval --th-trace *" $prev_line] } {
613
if { ($result_prefix eq "RESULT (1): " && $line eq "")
614
|| ($result_prefix eq "" && $line eq "ERROR (0): ") } {
615
set result_prefix ""
616
set line "RESULT (0): / ERROR (1): "
617
}
618
}
619
} elseif { $testname eq "th1-docs" } {
620
# In th1-docs, the fossil check-out is exposed in various states.
621
regsub {(^project-code:) CE59BB9F186226D80E49D1FA2DB29F935CCA0333} $line {\1 HASH} line
622
if { [regexp {^merged-from: HASH YYYY-mm-dd HH:MM:SS UTC$} $line] } {
623
continue
624
}
625
}
626
}
627
}
628
} elseif { $EXTRA } {
629
# Fix up summaries to be generic and easy to diff(1)
630
if { [regsub {(^\*{5} (Final|Ignored) results: )\d+} $line {\1N} line] } {
631
regsub {\d+} $line {N} line
632
} elseif { [regexp {^(\*{5} (?:Considered failure|Ignored failure|Skipped test))s: (.*)} $line match desc vals] } {
633
if { $vals ne ""} {
634
foreach val [split $vals " "] {
635
puts "$desc: $val"
636
}
637
continue
638
}
639
}
640
}
641
642
# Not exactly correct if we continue'd, but OK for the purpose
643
set prev_line "$result_prefix$line"
644
puts "$prev_line"
645
}
646

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button