Fossil SCM

Syntax error in test rewrite script and a couple of parsing improvments.

preben 2024-01-10 17:08 testing-improvements
Commit 2873af0b5c427a7c89619c65087f0453250dae3a77a1baafd2644961ec6c1618
1 file changed +16 -4
--- test/rewrite-test-output.tcl
+++ test/rewrite-test-output.tcl
@@ -33,10 +33,14 @@
3333
}
3434
3535
proc common_rewrites { line testname } {
3636
# Normalise the fossil commands with path as just fossil
3737
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
+ }
3842
3943
# Accept 40 and 64 byte hashes as such
4044
regsub -all {[[:<:]][0-9a-f]{40}[[:>:]]} $line HASH line
4145
regsub -all {[[:<:]][0-9a-f]{64}[[:>:]]} $line HASH line
4246
@@ -485,10 +489,15 @@
485489
incr collecting_f3
486490
}
487491
}
488492
489493
if { $EXTRA } {
494
+ if { $line eq "ERROR (0): " && $platform == $WINDOWS } {
495
+ if { [string match "fossil http --in *" $prev_line] } {
496
+ continue
497
+ }
498
+ }
490499
if { $testname eq "amend" } {
491500
# The amend-comment-5.N tests are not run on Windows
492501
if { $line eq "fossil amend {} -close" } {
493502
if { $amend_ed_failed } {
494503
foreach l $amend_ed_lines {
@@ -583,11 +592,11 @@
583592
set line "RESULT (0): "
584593
}
585594
} elseif { $testname eq "th1" } {
586595
if { [regexp {^fossil test-th-eval --vfs ([^ ]+) \{globalState vfs\}$} $line match vfs] } {
587596
if { ($platform == $UNIX && $vfs == "unix-dotfile")
588
- || ($platform == $WINDOWS && $vfs == "win32-longpath") } {
597
+ || ($platform == $WINDOWS && $vfs == "win32-longpath")
589598
|| ($platform == $CYGWIN && $vfs == "win32-longpath") } {
590599
regsub $vfs $line {EXEPECTED_VFS} line
591600
}
592601
} elseif { $prev_line eq "fossil test-th-eval --vfs EXEPECTED_VFS {globalState vfs}" } {
593602
# Replace $vfs from previous line
@@ -598,13 +607,16 @@
598607
} elseif { $platform == $WINDOWS } {
599608
regsub {^windows$} $line {EXPECTED_PLATFORM} line
600609
} elseif { $platform == $CYGWIN } {
601610
regsub {^unix$} $line {EXPECTED_PLATFORM} line
602611
}
603
- } elseif { $line eq "ERROR (1): " } {
604
- # Some output goes to stderr on Unix but stdout on Windows
605
- set line "RESULT (0): "
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
+ }
606618
}
607619
} elseif { $testname eq "th1-docs" } {
608620
# In th1-docs, the fossil check-out is exposed in various states.
609621
regsub {(^project-code:) CE59BB9F186226D80E49D1FA2DB29F935CCA0333} $line {\1 HASH} line
610622
if { [regexp {^merged-from: HASH YYYY-mm-dd HH:MM:SS UTC$} $line] } {
611623
--- test/rewrite-test-output.tcl
+++ test/rewrite-test-output.tcl
@@ -33,10 +33,14 @@
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
39 # Accept 40 and 64 byte hashes as such
40 regsub -all {[[:<:]][0-9a-f]{40}[[:>:]]} $line HASH line
41 regsub -all {[[:<:]][0-9a-f]{64}[[:>:]]} $line HASH line
42
@@ -485,10 +489,15 @@
485 incr collecting_f3
486 }
487 }
488
489 if { $EXTRA } {
 
 
 
 
 
490 if { $testname eq "amend" } {
491 # The amend-comment-5.N tests are not run on Windows
492 if { $line eq "fossil amend {} -close" } {
493 if { $amend_ed_failed } {
494 foreach l $amend_ed_lines {
@@ -583,11 +592,11 @@
583 set line "RESULT (0): "
584 }
585 } elseif { $testname eq "th1" } {
586 if { [regexp {^fossil test-th-eval --vfs ([^ ]+) \{globalState vfs\}$} $line match vfs] } {
587 if { ($platform == $UNIX && $vfs == "unix-dotfile")
588 || ($platform == $WINDOWS && $vfs == "win32-longpath") } {
589 || ($platform == $CYGWIN && $vfs == "win32-longpath") } {
590 regsub $vfs $line {EXEPECTED_VFS} line
591 }
592 } elseif { $prev_line eq "fossil test-th-eval --vfs EXEPECTED_VFS {globalState vfs}" } {
593 # Replace $vfs from previous line
@@ -598,13 +607,16 @@
598 } elseif { $platform == $WINDOWS } {
599 regsub {^windows$} $line {EXPECTED_PLATFORM} line
600 } elseif { $platform == $CYGWIN } {
601 regsub {^unix$} $line {EXPECTED_PLATFORM} line
602 }
603 } elseif { $line eq "ERROR (1): " } {
604 # Some output goes to stderr on Unix but stdout on Windows
605 set line "RESULT (0): "
 
 
 
606 }
607 } elseif { $testname eq "th1-docs" } {
608 # In th1-docs, the fossil check-out is exposed in various states.
609 regsub {(^project-code:) CE59BB9F186226D80E49D1FA2DB29F935CCA0333} $line {\1 HASH} line
610 if { [regexp {^merged-from: HASH YYYY-mm-dd HH:MM:SS UTC$} $line] } {
611
--- test/rewrite-test-output.tcl
+++ test/rewrite-test-output.tcl
@@ -33,10 +33,14 @@
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
@@ -485,10 +489,15 @@
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 {
@@ -583,11 +592,11 @@
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
@@ -598,13 +607,16 @@
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

Keyboard Shortcuts

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