Fossil SCM
Add test for Cygwin in rewrite-test-output.tcl. Best results are achieved if testing using fossil.exe instead of just fossil.
Commit
c86335802d99d7ee99cc20abcbf05d4d8f15c4027d0bcc6edf25bb1fc3f69792
Parent
7da44faa22f02ec…
1 file changed
+13
-2
+13
-2
| --- test/rewrite-test-output.tcl | ||
| +++ test/rewrite-test-output.tcl | ||
| @@ -367,10 +367,11 @@ | ||
| 367 | 367 | |
| 368 | 368 | # Platforms we detect |
| 369 | 369 | set UNKOWN_PLATFORM 0 |
| 370 | 370 | set UNIX 1 |
| 371 | 371 | set WINDOWS 2 |
| 372 | +set CYGWIN 3 | |
| 372 | 373 | |
| 373 | 374 | # One specific wiki test creates repetitive output of varying length |
| 374 | 375 | set wiki_f13_cmd1 "fossil wiki create {timestamp of 2399999} f13 --technote 2399999" |
| 375 | 376 | set wiki_f13_cmd2 "fossil wiki list --technote --show-technote-ids" |
| 376 | 377 | set wiki_f13_cmd3 "fossil wiki export a13 --technote ID" |
| @@ -425,10 +426,13 @@ | ||
| 425 | 426 | set testname "" |
| 426 | 427 | } elseif { $testname ne "" } { |
| 427 | 428 | if { $platform == $UNKOWN_PLATFORM } { |
| 428 | 429 | if { [regexp {^[A-Z]:/.*?/fossil\.exe } $line] } { |
| 429 | 430 | set platform $WINDOWS |
| 431 | + } elseif { [regexp {^/.*?/fossil\.exe } $line] } { | |
| 432 | + # No drive, but still .exe - must be CYGWIN | |
| 433 | + set platform $CYGWIN | |
| 430 | 434 | } elseif { [regexp {^/.*?/fossil } $line] } { |
| 431 | 435 | set platform $UNIX |
| 432 | 436 | } |
| 433 | 437 | } |
| 434 | 438 | |
| @@ -516,11 +520,12 @@ | ||
| 516 | 520 | continue |
| 517 | 521 | } |
| 518 | 522 | } elseif { $testname eq "cmdline" } { |
| 519 | 523 | if { [regexp {^(fossil test-echo) (.*)} $line match test args] } { |
| 520 | 524 | if { ($platform == $UNIX && $args in {"*" "*.*"}) |
| 521 | - || ($platform == $WINDOWS && $args eq "--args /TMP/fossil-cmd-line-101.txt") } { | |
| 525 | + || ($platform == $WINDOWS && $args eq "--args /TMP/fossil-cmd-line-101.txt") | |
| 526 | + || ($platform == $CYGWIN && $args in {"*" "*.*"}) } { | |
| 522 | 527 | set line "$test ARG_FOR_PLATFORM" |
| 523 | 528 | } |
| 524 | 529 | } |
| 525 | 530 | } elseif { $testname eq "commit-warning" } { |
| 526 | 531 | if { [regexp {^(micro-smile|pale facepalm) .*} $line match desc] } { |
| @@ -550,11 +555,14 @@ | ||
| 550 | 555 | lappend test_simplify_name_lines "$result_prefix$line" |
| 551 | 556 | continue |
| 552 | 557 | } |
| 553 | 558 | } elseif { $testname eq "settings-repo" } { |
| 554 | 559 | if { [regexp {^fossil test-th-eval (?:--open-config )?\{setting case-sensitive\}$} $prev_line] } { |
| 555 | - if { ($platform == $UNIX && $line eq "on") || ($platform == $WINDOWS && $line eq "off") } { | |
| 560 | + if { ($platform == $UNIX && $line eq "on") | |
| 561 | + || ($platform == $WINDOWS && $line eq "off") | |
| 562 | + || ($platform == $CYGWIN && $line eq "off") | |
| 563 | + } { | |
| 556 | 564 | set line "EXPECTED_FOR_PLATFORM" |
| 557 | 565 | } |
| 558 | 566 | } |
| 559 | 567 | } elseif { $testname eq "symlinks" } { |
| 560 | 568 | # Collect all lines and post-process at the end |
| @@ -576,10 +584,11 @@ | ||
| 576 | 584 | } |
| 577 | 585 | } elseif { $testname eq "th1" } { |
| 578 | 586 | if { [regexp {^fossil test-th-eval --vfs ([^ ]+) \{globalState vfs\}$} $line match vfs] } { |
| 579 | 587 | if { ($platform == $UNIX && $vfs == "unix-dotfile") |
| 580 | 588 | || ($platform == $WINDOWS && $vfs == "win32-longpath") } { |
| 589 | + || ($platform == $CYGWIN && $vfs == "win32-longpath") } { | |
| 581 | 590 | regsub $vfs $line {EXEPECTED_VFS} line |
| 582 | 591 | } |
| 583 | 592 | } elseif { $prev_line eq "fossil test-th-eval --vfs EXEPECTED_VFS {globalState vfs}" } { |
| 584 | 593 | # Replace $vfs from previous line |
| 585 | 594 | regsub "^$vfs\$" $line {EXEPECTED_VFS} line |
| @@ -586,10 +595,12 @@ | ||
| 586 | 595 | } elseif { $prev_line eq "fossil test-th-eval {set tcl_platform(platform)}" } { |
| 587 | 596 | if { $platform == $UNIX } { |
| 588 | 597 | regsub {^unix$} $line {EXPECTED_PLATFORM} line |
| 589 | 598 | } elseif { $platform == $WINDOWS } { |
| 590 | 599 | regsub {^windows$} $line {EXPECTED_PLATFORM} line |
| 600 | + } elseif { $platform == $CYGWIN } { | |
| 601 | + regsub {^unix$} $line {EXPECTED_PLATFORM} line | |
| 591 | 602 | } |
| 592 | 603 | } elseif { $line eq "ERROR (1): " } { |
| 593 | 604 | # Some output goes to stderr on Unix but stdout on Windows |
| 594 | 605 | set line "RESULT (0): " |
| 595 | 606 | } |
| 596 | 607 |
| --- test/rewrite-test-output.tcl | |
| +++ test/rewrite-test-output.tcl | |
| @@ -367,10 +367,11 @@ | |
| 367 | |
| 368 | # Platforms we detect |
| 369 | set UNKOWN_PLATFORM 0 |
| 370 | set UNIX 1 |
| 371 | set WINDOWS 2 |
| 372 | |
| 373 | # One specific wiki test creates repetitive output of varying length |
| 374 | set wiki_f13_cmd1 "fossil wiki create {timestamp of 2399999} f13 --technote 2399999" |
| 375 | set wiki_f13_cmd2 "fossil wiki list --technote --show-technote-ids" |
| 376 | set wiki_f13_cmd3 "fossil wiki export a13 --technote ID" |
| @@ -425,10 +426,13 @@ | |
| 425 | set testname "" |
| 426 | } elseif { $testname ne "" } { |
| 427 | if { $platform == $UNKOWN_PLATFORM } { |
| 428 | if { [regexp {^[A-Z]:/.*?/fossil\.exe } $line] } { |
| 429 | set platform $WINDOWS |
| 430 | } elseif { [regexp {^/.*?/fossil } $line] } { |
| 431 | set platform $UNIX |
| 432 | } |
| 433 | } |
| 434 | |
| @@ -516,11 +520,12 @@ | |
| 516 | continue |
| 517 | } |
| 518 | } elseif { $testname eq "cmdline" } { |
| 519 | if { [regexp {^(fossil test-echo) (.*)} $line match test args] } { |
| 520 | if { ($platform == $UNIX && $args in {"*" "*.*"}) |
| 521 | || ($platform == $WINDOWS && $args eq "--args /TMP/fossil-cmd-line-101.txt") } { |
| 522 | set line "$test ARG_FOR_PLATFORM" |
| 523 | } |
| 524 | } |
| 525 | } elseif { $testname eq "commit-warning" } { |
| 526 | if { [regexp {^(micro-smile|pale facepalm) .*} $line match desc] } { |
| @@ -550,11 +555,14 @@ | |
| 550 | lappend test_simplify_name_lines "$result_prefix$line" |
| 551 | continue |
| 552 | } |
| 553 | } elseif { $testname eq "settings-repo" } { |
| 554 | if { [regexp {^fossil test-th-eval (?:--open-config )?\{setting case-sensitive\}$} $prev_line] } { |
| 555 | if { ($platform == $UNIX && $line eq "on") || ($platform == $WINDOWS && $line eq "off") } { |
| 556 | set line "EXPECTED_FOR_PLATFORM" |
| 557 | } |
| 558 | } |
| 559 | } elseif { $testname eq "symlinks" } { |
| 560 | # Collect all lines and post-process at the end |
| @@ -576,10 +584,11 @@ | |
| 576 | } |
| 577 | } elseif { $testname eq "th1" } { |
| 578 | if { [regexp {^fossil test-th-eval --vfs ([^ ]+) \{globalState vfs\}$} $line match vfs] } { |
| 579 | if { ($platform == $UNIX && $vfs == "unix-dotfile") |
| 580 | || ($platform == $WINDOWS && $vfs == "win32-longpath") } { |
| 581 | regsub $vfs $line {EXEPECTED_VFS} line |
| 582 | } |
| 583 | } elseif { $prev_line eq "fossil test-th-eval --vfs EXEPECTED_VFS {globalState vfs}" } { |
| 584 | # Replace $vfs from previous line |
| 585 | regsub "^$vfs\$" $line {EXEPECTED_VFS} line |
| @@ -586,10 +595,12 @@ | |
| 586 | } elseif { $prev_line eq "fossil test-th-eval {set tcl_platform(platform)}" } { |
| 587 | if { $platform == $UNIX } { |
| 588 | regsub {^unix$} $line {EXPECTED_PLATFORM} line |
| 589 | } elseif { $platform == $WINDOWS } { |
| 590 | regsub {^windows$} $line {EXPECTED_PLATFORM} line |
| 591 | } |
| 592 | } elseif { $line eq "ERROR (1): " } { |
| 593 | # Some output goes to stderr on Unix but stdout on Windows |
| 594 | set line "RESULT (0): " |
| 595 | } |
| 596 |
| --- test/rewrite-test-output.tcl | |
| +++ test/rewrite-test-output.tcl | |
| @@ -367,10 +367,11 @@ | |
| 367 | |
| 368 | # Platforms we detect |
| 369 | set UNKOWN_PLATFORM 0 |
| 370 | set UNIX 1 |
| 371 | set WINDOWS 2 |
| 372 | set CYGWIN 3 |
| 373 | |
| 374 | # One specific wiki test creates repetitive output of varying length |
| 375 | set wiki_f13_cmd1 "fossil wiki create {timestamp of 2399999} f13 --technote 2399999" |
| 376 | set wiki_f13_cmd2 "fossil wiki list --technote --show-technote-ids" |
| 377 | set wiki_f13_cmd3 "fossil wiki export a13 --technote ID" |
| @@ -425,10 +426,13 @@ | |
| 426 | set testname "" |
| 427 | } elseif { $testname ne "" } { |
| 428 | if { $platform == $UNKOWN_PLATFORM } { |
| 429 | if { [regexp {^[A-Z]:/.*?/fossil\.exe } $line] } { |
| 430 | set platform $WINDOWS |
| 431 | } elseif { [regexp {^/.*?/fossil\.exe } $line] } { |
| 432 | # No drive, but still .exe - must be CYGWIN |
| 433 | set platform $CYGWIN |
| 434 | } elseif { [regexp {^/.*?/fossil } $line] } { |
| 435 | set platform $UNIX |
| 436 | } |
| 437 | } |
| 438 | |
| @@ -516,11 +520,12 @@ | |
| 520 | continue |
| 521 | } |
| 522 | } elseif { $testname eq "cmdline" } { |
| 523 | if { [regexp {^(fossil test-echo) (.*)} $line match test args] } { |
| 524 | if { ($platform == $UNIX && $args in {"*" "*.*"}) |
| 525 | || ($platform == $WINDOWS && $args eq "--args /TMP/fossil-cmd-line-101.txt") |
| 526 | || ($platform == $CYGWIN && $args in {"*" "*.*"}) } { |
| 527 | set line "$test ARG_FOR_PLATFORM" |
| 528 | } |
| 529 | } |
| 530 | } elseif { $testname eq "commit-warning" } { |
| 531 | if { [regexp {^(micro-smile|pale facepalm) .*} $line match desc] } { |
| @@ -550,11 +555,14 @@ | |
| 555 | lappend test_simplify_name_lines "$result_prefix$line" |
| 556 | continue |
| 557 | } |
| 558 | } elseif { $testname eq "settings-repo" } { |
| 559 | if { [regexp {^fossil test-th-eval (?:--open-config )?\{setting case-sensitive\}$} $prev_line] } { |
| 560 | if { ($platform == $UNIX && $line eq "on") |
| 561 | || ($platform == $WINDOWS && $line eq "off") |
| 562 | || ($platform == $CYGWIN && $line eq "off") |
| 563 | } { |
| 564 | set line "EXPECTED_FOR_PLATFORM" |
| 565 | } |
| 566 | } |
| 567 | } elseif { $testname eq "symlinks" } { |
| 568 | # Collect all lines and post-process at the end |
| @@ -576,10 +584,11 @@ | |
| 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 |
| 594 | regsub "^$vfs\$" $line {EXEPECTED_VFS} line |
| @@ -586,10 +595,12 @@ | |
| 595 | } elseif { $prev_line eq "fossil test-th-eval {set tcl_platform(platform)}" } { |
| 596 | if { $platform == $UNIX } { |
| 597 | regsub {^unix$} $line {EXPECTED_PLATFORM} line |
| 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 |