Fossil SCM

Add test for Cygwin in rewrite-test-output.tcl. Best results are achieved if testing using fossil.exe instead of just fossil.

preben 2024-01-04 18:03 testing-improvements
Commit c86335802d99d7ee99cc20abcbf05d4d8f15c4027d0bcc6edf25bb1fc3f69792
1 file changed +13 -2
--- test/rewrite-test-output.tcl
+++ test/rewrite-test-output.tcl
@@ -367,10 +367,11 @@
367367
368368
# Platforms we detect
369369
set UNKOWN_PLATFORM 0
370370
set UNIX 1
371371
set WINDOWS 2
372
+set CYGWIN 3
372373
373374
# One specific wiki test creates repetitive output of varying length
374375
set wiki_f13_cmd1 "fossil wiki create {timestamp of 2399999} f13 --technote 2399999"
375376
set wiki_f13_cmd2 "fossil wiki list --technote --show-technote-ids"
376377
set wiki_f13_cmd3 "fossil wiki export a13 --technote ID"
@@ -425,10 +426,13 @@
425426
set testname ""
426427
} elseif { $testname ne "" } {
427428
if { $platform == $UNKOWN_PLATFORM } {
428429
if { [regexp {^[A-Z]:/.*?/fossil\.exe } $line] } {
429430
set platform $WINDOWS
431
+ } elseif { [regexp {^/.*?/fossil\.exe } $line] } {
432
+ # No drive, but still .exe - must be CYGWIN
433
+ set platform $CYGWIN
430434
} elseif { [regexp {^/.*?/fossil } $line] } {
431435
set platform $UNIX
432436
}
433437
}
434438
@@ -516,11 +520,12 @@
516520
continue
517521
}
518522
} elseif { $testname eq "cmdline" } {
519523
if { [regexp {^(fossil test-echo) (.*)} $line match test args] } {
520524
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 {"*" "*.*"}) } {
522527
set line "$test ARG_FOR_PLATFORM"
523528
}
524529
}
525530
} elseif { $testname eq "commit-warning" } {
526531
if { [regexp {^(micro-smile|pale facepalm) .*} $line match desc] } {
@@ -550,11 +555,14 @@
550555
lappend test_simplify_name_lines "$result_prefix$line"
551556
continue
552557
}
553558
} elseif { $testname eq "settings-repo" } {
554559
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
+ } {
556564
set line "EXPECTED_FOR_PLATFORM"
557565
}
558566
}
559567
} elseif { $testname eq "symlinks" } {
560568
# Collect all lines and post-process at the end
@@ -576,10 +584,11 @@
576584
}
577585
} elseif { $testname eq "th1" } {
578586
if { [regexp {^fossil test-th-eval --vfs ([^ ]+) \{globalState vfs\}$} $line match vfs] } {
579587
if { ($platform == $UNIX && $vfs == "unix-dotfile")
580588
|| ($platform == $WINDOWS && $vfs == "win32-longpath") } {
589
+ || ($platform == $CYGWIN && $vfs == "win32-longpath") } {
581590
regsub $vfs $line {EXEPECTED_VFS} line
582591
}
583592
} elseif { $prev_line eq "fossil test-th-eval --vfs EXEPECTED_VFS {globalState vfs}" } {
584593
# Replace $vfs from previous line
585594
regsub "^$vfs\$" $line {EXEPECTED_VFS} line
@@ -586,10 +595,12 @@
586595
} elseif { $prev_line eq "fossil test-th-eval {set tcl_platform(platform)}" } {
587596
if { $platform == $UNIX } {
588597
regsub {^unix$} $line {EXPECTED_PLATFORM} line
589598
} elseif { $platform == $WINDOWS } {
590599
regsub {^windows$} $line {EXPECTED_PLATFORM} line
600
+ } elseif { $platform == $CYGWIN } {
601
+ regsub {^unix$} $line {EXPECTED_PLATFORM} line
591602
}
592603
} elseif { $line eq "ERROR (1): " } {
593604
# Some output goes to stderr on Unix but stdout on Windows
594605
set line "RESULT (0): "
595606
}
596607
--- 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

Keyboard Shortcuts

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