Fossil SCM
Syntax error in test rewrite script and a couple of parsing improvments.
Commit
2873af0b5c427a7c89619c65087f0453250dae3a77a1baafd2644961ec6c1618
Parent
9c23c50defa0559…
1 file changed
+16
-4
+16
-4
| --- test/rewrite-test-output.tcl | ||
| +++ test/rewrite-test-output.tcl | ||
| @@ -33,10 +33,14 @@ | ||
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | proc common_rewrites { line testname } { |
| 36 | 36 | # Normalise the fossil commands with path as just fossil |
| 37 | 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 | + } | |
| 38 | 42 | |
| 39 | 43 | # Accept 40 and 64 byte hashes as such |
| 40 | 44 | regsub -all {[[:<:]][0-9a-f]{40}[[:>:]]} $line HASH line |
| 41 | 45 | regsub -all {[[:<:]][0-9a-f]{64}[[:>:]]} $line HASH line |
| 42 | 46 | |
| @@ -485,10 +489,15 @@ | ||
| 485 | 489 | incr collecting_f3 |
| 486 | 490 | } |
| 487 | 491 | } |
| 488 | 492 | |
| 489 | 493 | if { $EXTRA } { |
| 494 | + if { $line eq "ERROR (0): " && $platform == $WINDOWS } { | |
| 495 | + if { [string match "fossil http --in *" $prev_line] } { | |
| 496 | + continue | |
| 497 | + } | |
| 498 | + } | |
| 490 | 499 | if { $testname eq "amend" } { |
| 491 | 500 | # The amend-comment-5.N tests are not run on Windows |
| 492 | 501 | if { $line eq "fossil amend {} -close" } { |
| 493 | 502 | if { $amend_ed_failed } { |
| 494 | 503 | foreach l $amend_ed_lines { |
| @@ -583,11 +592,11 @@ | ||
| 583 | 592 | set line "RESULT (0): " |
| 584 | 593 | } |
| 585 | 594 | } elseif { $testname eq "th1" } { |
| 586 | 595 | if { [regexp {^fossil test-th-eval --vfs ([^ ]+) \{globalState vfs\}$} $line match vfs] } { |
| 587 | 596 | if { ($platform == $UNIX && $vfs == "unix-dotfile") |
| 588 | - || ($platform == $WINDOWS && $vfs == "win32-longpath") } { | |
| 597 | + || ($platform == $WINDOWS && $vfs == "win32-longpath") | |
| 589 | 598 | || ($platform == $CYGWIN && $vfs == "win32-longpath") } { |
| 590 | 599 | regsub $vfs $line {EXEPECTED_VFS} line |
| 591 | 600 | } |
| 592 | 601 | } elseif { $prev_line eq "fossil test-th-eval --vfs EXEPECTED_VFS {globalState vfs}" } { |
| 593 | 602 | # Replace $vfs from previous line |
| @@ -598,13 +607,16 @@ | ||
| 598 | 607 | } elseif { $platform == $WINDOWS } { |
| 599 | 608 | regsub {^windows$} $line {EXPECTED_PLATFORM} line |
| 600 | 609 | } elseif { $platform == $CYGWIN } { |
| 601 | 610 | regsub {^unix$} $line {EXPECTED_PLATFORM} line |
| 602 | 611 | } |
| 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 | + } | |
| 606 | 618 | } |
| 607 | 619 | } elseif { $testname eq "th1-docs" } { |
| 608 | 620 | # In th1-docs, the fossil check-out is exposed in various states. |
| 609 | 621 | regsub {(^project-code:) CE59BB9F186226D80E49D1FA2DB29F935CCA0333} $line {\1 HASH} line |
| 610 | 622 | if { [regexp {^merged-from: HASH YYYY-mm-dd HH:MM:SS UTC$} $line] } { |
| 611 | 623 |
| --- 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 |