Fossil SCM
Merge current state of testing-improvements. make clean output is now easy to review.
Commit
e5bcfd1efe9b638f3b639ebabe75275f0c8421dd6752821ec63250cb3997faed
Parent
9d9bf1abfb59ec6…
24 files changed
+1
-13
+1
-1
+5
+14
-1
+6
-6
+1
-1
+27
-27
+5
-5
+3
-1
+3
-3
+1
-1
+645
+5
-5
+13
-9
+7
-3
+1
-1
+1
-11
+26
-3
+14
-17
+2
-2
+8
-1
+3
-3
+25
-7
+125
~
test/commit-warning.test
~
test/delta1.test
~
test/fake-editor.tcl
~
test/json.test
~
test/merge1.test
~
test/merge2.test
~
test/merge3.test
~
test/merge4.test
~
test/merge5.test
~
test/merge_renames.test
~
test/merge_warn.test
~
test/rewrite-test-output.tcl
~
test/set-manifest.test
~
test/settings-repo.test
~
test/settings.test
~
test/stash.test
~
test/symlinks.test
~
test/tester.tcl
~
test/th1-docs.test
~
test/th1-hooks.test
~
test/th1-tcl.test
~
test/th1.test
~
test/unversioned.test
~
test/update.test
+1
-13
| --- test/commit-warning.test | ||
| +++ test/commit-warning.test | ||
| @@ -172,13 +172,10 @@ | ||
| 172 | 172 | test_block_in_checkout pre-commit-warnings-fossil-1 { |
| 173 | 173 | fossil test-commit-warning --no-settings |
| 174 | 174 | } { |
| 175 | 175 | test pre-commit-warnings-fossil-1 {[normalize_result] eq \ |
| 176 | 176 | [subst -nocommands -novariables [string trim { |
| 177 | -1\tart/branching.odp\tbinary data | |
| 178 | -1\tart/concept1.dia\tbinary data | |
| 179 | -1\tart/concept2.dia\tbinary data | |
| 180 | 177 | 1\tcompat/zlib/contrib/blast/test.pk\tbinary data |
| 181 | 178 | 1\tcompat/zlib/contrib/dotzlib/DotZLib.build\tCR/LF line endings |
| 182 | 179 | 1\tcompat/zlib/contrib/dotzlib/DotZLib.chm\tbinary data |
| 183 | 180 | 1\tcompat/zlib/contrib/dotzlib/DotZLib.sln\tCR/LF line endings |
| 184 | 181 | 1\tcompat/zlib/contrib/dotzlib/DotZLib/AssemblyInfo.cs\tCR/LF line endings |
| @@ -192,19 +189,10 @@ | ||
| 192 | 189 | 1\tcompat/zlib/contrib/dotzlib/DotZLib/Inflater.cs\tinvalid UTF-8 |
| 193 | 190 | 1\tcompat/zlib/contrib/dotzlib/DotZLib/UnitTests.cs\tCR/LF line endings |
| 194 | 191 | 1\tcompat/zlib/contrib/dotzlib/LICENSE_1_0.txt\tCR/LF line endings |
| 195 | 192 | 1\tcompat/zlib/contrib/dotzlib/readme.txt\tCR/LF line endings |
| 196 | 193 | 1\tcompat/zlib/contrib/gcc_gvmat64/gvmat64.S\tCR/LF line endings |
| 197 | -1\tcompat/zlib/contrib/masmx64/bld_ml64.bat\tCR/LF line endings | |
| 198 | -1\tcompat/zlib/contrib/masmx64/gvmat64.asm\tCR/LF line endings | |
| 199 | -1\tcompat/zlib/contrib/masmx64/inffas8664.c\tCR/LF line endings | |
| 200 | -1\tcompat/zlib/contrib/masmx64/inffasx64.asm\tCR/LF line endings | |
| 201 | -1\tcompat/zlib/contrib/masmx64/readme.txt\tCR/LF line endings | |
| 202 | -1\tcompat/zlib/contrib/masmx86/bld_ml32.bat\tCR/LF line endings | |
| 203 | -1\tcompat/zlib/contrib/masmx86/inffas32.asm\tCR/LF line endings | |
| 204 | -1\tcompat/zlib/contrib/masmx86/match686.asm\tCR/LF line endings | |
| 205 | -1\tcompat/zlib/contrib/masmx86/readme.txt\tCR/LF line endings | |
| 206 | 194 | 1\tcompat/zlib/contrib/puff/zeros.raw\tbinary data |
| 207 | 195 | 1\tcompat/zlib/contrib/testzlib/testzlib.c\tCR/LF line endings |
| 208 | 196 | 1\tcompat/zlib/contrib/testzlib/testzlib.txt\tCR/LF line endings |
| 209 | 197 | 1\tcompat/zlib/contrib/vstudio/readme.txt\tCR/LF line endings |
| 210 | 198 | 1\tcompat/zlib/contrib/vstudio/vc10/miniunz.vcxproj\tCR/LF line endings |
| @@ -243,18 +231,18 @@ | ||
| 243 | 231 | 1\tcompat/zlib/contrib/vstudio/vc9/zlibvc.sln\tCR/LF line endings |
| 244 | 232 | 1\tcompat/zlib/contrib/vstudio/vc9/zlibvc.vcproj\tCR/LF line endings |
| 245 | 233 | 1\tcompat/zlib/win32/zlib.def\tCR/LF line endings |
| 246 | 234 | 1\tcompat/zlib/zlib.3.pdf\tbinary data |
| 247 | 235 | 1\tcompat/zlib/zlib.map\tCR/LF line endings |
| 236 | +1\textsrc/pikchr.wasm\tbinary data | |
| 248 | 237 | 1\tskins/blitz/arrow_project.png\tbinary data |
| 249 | 238 | 1\tskins/blitz/dir.png\tbinary data |
| 250 | 239 | 1\tskins/blitz/file.png\tbinary data |
| 251 | 240 | 1\tskins/blitz/fossil_100.png\tbinary data |
| 252 | 241 | 1\tskins/blitz/fossil_80_reversed_darkcyan.png\tbinary data |
| 253 | 242 | 1\tskins/blitz/fossil_80_reversed_darkcyan_text.png\tbinary data |
| 254 | 243 | 1\tskins/blitz/rss_20.png\tbinary data |
| 255 | -1\tskins/bootstrap/css.txt\tlong lines | |
| 256 | 244 | 1\tsrc/alerts/bflat2.wav\tbinary data |
| 257 | 245 | 1\tsrc/alerts/bflat3.wav\tbinary data |
| 258 | 246 | 1\tsrc/alerts/bloop.wav\tbinary data |
| 259 | 247 | 1\tsrc/alerts/plunk.wav\tbinary data |
| 260 | 248 | 1\tsrc/sounds/0.wav\tbinary data |
| 261 | 249 |
| --- test/commit-warning.test | |
| +++ test/commit-warning.test | |
| @@ -172,13 +172,10 @@ | |
| 172 | test_block_in_checkout pre-commit-warnings-fossil-1 { |
| 173 | fossil test-commit-warning --no-settings |
| 174 | } { |
| 175 | test pre-commit-warnings-fossil-1 {[normalize_result] eq \ |
| 176 | [subst -nocommands -novariables [string trim { |
| 177 | 1\tart/branching.odp\tbinary data |
| 178 | 1\tart/concept1.dia\tbinary data |
| 179 | 1\tart/concept2.dia\tbinary data |
| 180 | 1\tcompat/zlib/contrib/blast/test.pk\tbinary data |
| 181 | 1\tcompat/zlib/contrib/dotzlib/DotZLib.build\tCR/LF line endings |
| 182 | 1\tcompat/zlib/contrib/dotzlib/DotZLib.chm\tbinary data |
| 183 | 1\tcompat/zlib/contrib/dotzlib/DotZLib.sln\tCR/LF line endings |
| 184 | 1\tcompat/zlib/contrib/dotzlib/DotZLib/AssemblyInfo.cs\tCR/LF line endings |
| @@ -192,19 +189,10 @@ | |
| 192 | 1\tcompat/zlib/contrib/dotzlib/DotZLib/Inflater.cs\tinvalid UTF-8 |
| 193 | 1\tcompat/zlib/contrib/dotzlib/DotZLib/UnitTests.cs\tCR/LF line endings |
| 194 | 1\tcompat/zlib/contrib/dotzlib/LICENSE_1_0.txt\tCR/LF line endings |
| 195 | 1\tcompat/zlib/contrib/dotzlib/readme.txt\tCR/LF line endings |
| 196 | 1\tcompat/zlib/contrib/gcc_gvmat64/gvmat64.S\tCR/LF line endings |
| 197 | 1\tcompat/zlib/contrib/masmx64/bld_ml64.bat\tCR/LF line endings |
| 198 | 1\tcompat/zlib/contrib/masmx64/gvmat64.asm\tCR/LF line endings |
| 199 | 1\tcompat/zlib/contrib/masmx64/inffas8664.c\tCR/LF line endings |
| 200 | 1\tcompat/zlib/contrib/masmx64/inffasx64.asm\tCR/LF line endings |
| 201 | 1\tcompat/zlib/contrib/masmx64/readme.txt\tCR/LF line endings |
| 202 | 1\tcompat/zlib/contrib/masmx86/bld_ml32.bat\tCR/LF line endings |
| 203 | 1\tcompat/zlib/contrib/masmx86/inffas32.asm\tCR/LF line endings |
| 204 | 1\tcompat/zlib/contrib/masmx86/match686.asm\tCR/LF line endings |
| 205 | 1\tcompat/zlib/contrib/masmx86/readme.txt\tCR/LF line endings |
| 206 | 1\tcompat/zlib/contrib/puff/zeros.raw\tbinary data |
| 207 | 1\tcompat/zlib/contrib/testzlib/testzlib.c\tCR/LF line endings |
| 208 | 1\tcompat/zlib/contrib/testzlib/testzlib.txt\tCR/LF line endings |
| 209 | 1\tcompat/zlib/contrib/vstudio/readme.txt\tCR/LF line endings |
| 210 | 1\tcompat/zlib/contrib/vstudio/vc10/miniunz.vcxproj\tCR/LF line endings |
| @@ -243,18 +231,18 @@ | |
| 243 | 1\tcompat/zlib/contrib/vstudio/vc9/zlibvc.sln\tCR/LF line endings |
| 244 | 1\tcompat/zlib/contrib/vstudio/vc9/zlibvc.vcproj\tCR/LF line endings |
| 245 | 1\tcompat/zlib/win32/zlib.def\tCR/LF line endings |
| 246 | 1\tcompat/zlib/zlib.3.pdf\tbinary data |
| 247 | 1\tcompat/zlib/zlib.map\tCR/LF line endings |
| 248 | 1\tskins/blitz/arrow_project.png\tbinary data |
| 249 | 1\tskins/blitz/dir.png\tbinary data |
| 250 | 1\tskins/blitz/file.png\tbinary data |
| 251 | 1\tskins/blitz/fossil_100.png\tbinary data |
| 252 | 1\tskins/blitz/fossil_80_reversed_darkcyan.png\tbinary data |
| 253 | 1\tskins/blitz/fossil_80_reversed_darkcyan_text.png\tbinary data |
| 254 | 1\tskins/blitz/rss_20.png\tbinary data |
| 255 | 1\tskins/bootstrap/css.txt\tlong lines |
| 256 | 1\tsrc/alerts/bflat2.wav\tbinary data |
| 257 | 1\tsrc/alerts/bflat3.wav\tbinary data |
| 258 | 1\tsrc/alerts/bloop.wav\tbinary data |
| 259 | 1\tsrc/alerts/plunk.wav\tbinary data |
| 260 | 1\tsrc/sounds/0.wav\tbinary data |
| 261 |
| --- test/commit-warning.test | |
| +++ test/commit-warning.test | |
| @@ -172,13 +172,10 @@ | |
| 172 | test_block_in_checkout pre-commit-warnings-fossil-1 { |
| 173 | fossil test-commit-warning --no-settings |
| 174 | } { |
| 175 | test pre-commit-warnings-fossil-1 {[normalize_result] eq \ |
| 176 | [subst -nocommands -novariables [string trim { |
| 177 | 1\tcompat/zlib/contrib/blast/test.pk\tbinary data |
| 178 | 1\tcompat/zlib/contrib/dotzlib/DotZLib.build\tCR/LF line endings |
| 179 | 1\tcompat/zlib/contrib/dotzlib/DotZLib.chm\tbinary data |
| 180 | 1\tcompat/zlib/contrib/dotzlib/DotZLib.sln\tCR/LF line endings |
| 181 | 1\tcompat/zlib/contrib/dotzlib/DotZLib/AssemblyInfo.cs\tCR/LF line endings |
| @@ -192,19 +189,10 @@ | |
| 189 | 1\tcompat/zlib/contrib/dotzlib/DotZLib/Inflater.cs\tinvalid UTF-8 |
| 190 | 1\tcompat/zlib/contrib/dotzlib/DotZLib/UnitTests.cs\tCR/LF line endings |
| 191 | 1\tcompat/zlib/contrib/dotzlib/LICENSE_1_0.txt\tCR/LF line endings |
| 192 | 1\tcompat/zlib/contrib/dotzlib/readme.txt\tCR/LF line endings |
| 193 | 1\tcompat/zlib/contrib/gcc_gvmat64/gvmat64.S\tCR/LF line endings |
| 194 | 1\tcompat/zlib/contrib/puff/zeros.raw\tbinary data |
| 195 | 1\tcompat/zlib/contrib/testzlib/testzlib.c\tCR/LF line endings |
| 196 | 1\tcompat/zlib/contrib/testzlib/testzlib.txt\tCR/LF line endings |
| 197 | 1\tcompat/zlib/contrib/vstudio/readme.txt\tCR/LF line endings |
| 198 | 1\tcompat/zlib/contrib/vstudio/vc10/miniunz.vcxproj\tCR/LF line endings |
| @@ -243,18 +231,18 @@ | |
| 231 | 1\tcompat/zlib/contrib/vstudio/vc9/zlibvc.sln\tCR/LF line endings |
| 232 | 1\tcompat/zlib/contrib/vstudio/vc9/zlibvc.vcproj\tCR/LF line endings |
| 233 | 1\tcompat/zlib/win32/zlib.def\tCR/LF line endings |
| 234 | 1\tcompat/zlib/zlib.3.pdf\tbinary data |
| 235 | 1\tcompat/zlib/zlib.map\tCR/LF line endings |
| 236 | 1\textsrc/pikchr.wasm\tbinary data |
| 237 | 1\tskins/blitz/arrow_project.png\tbinary data |
| 238 | 1\tskins/blitz/dir.png\tbinary data |
| 239 | 1\tskins/blitz/file.png\tbinary data |
| 240 | 1\tskins/blitz/fossil_100.png\tbinary data |
| 241 | 1\tskins/blitz/fossil_80_reversed_darkcyan.png\tbinary data |
| 242 | 1\tskins/blitz/fossil_80_reversed_darkcyan_text.png\tbinary data |
| 243 | 1\tskins/blitz/rss_20.png\tbinary data |
| 244 | 1\tsrc/alerts/bflat2.wav\tbinary data |
| 245 | 1\tsrc/alerts/bflat3.wav\tbinary data |
| 246 | 1\tsrc/alerts/bloop.wav\tbinary data |
| 247 | 1\tsrc/alerts/plunk.wav\tbinary data |
| 248 | 1\tsrc/sounds/0.wav\tbinary data |
| 249 |
+1
-1
| --- test/delta1.test | ||
| +++ test/delta1.test | ||
| @@ -25,11 +25,11 @@ | ||
| 25 | 25 | # For each test, copy the file intact to "./t1". Make |
| 26 | 26 | # some random changes in "./t2". Then call test-delta on the |
| 27 | 27 | # two files to make sure that deltas between these two files |
| 28 | 28 | # work properly. |
| 29 | 29 | # |
| 30 | -set filelist [glob $testdir/*] | |
| 30 | +set filelist [lsort [glob $testdir/*]] | |
| 31 | 31 | foreach f $filelist { |
| 32 | 32 | if {[file isdir $f]} continue |
| 33 | 33 | set base [file root [file tail $f]] |
| 34 | 34 | set f1 [read_file $f] |
| 35 | 35 | write_file t1 $f1 |
| 36 | 36 |
| --- test/delta1.test | |
| +++ test/delta1.test | |
| @@ -25,11 +25,11 @@ | |
| 25 | # For each test, copy the file intact to "./t1". Make |
| 26 | # some random changes in "./t2". Then call test-delta on the |
| 27 | # two files to make sure that deltas between these two files |
| 28 | # work properly. |
| 29 | # |
| 30 | set filelist [glob $testdir/*] |
| 31 | foreach f $filelist { |
| 32 | if {[file isdir $f]} continue |
| 33 | set base [file root [file tail $f]] |
| 34 | set f1 [read_file $f] |
| 35 | write_file t1 $f1 |
| 36 |
| --- test/delta1.test | |
| +++ test/delta1.test | |
| @@ -25,11 +25,11 @@ | |
| 25 | # For each test, copy the file intact to "./t1". Make |
| 26 | # some random changes in "./t2". Then call test-delta on the |
| 27 | # two files to make sure that deltas between these two files |
| 28 | # work properly. |
| 29 | # |
| 30 | set filelist [lsort [glob $testdir/*]] |
| 31 | foreach f $filelist { |
| 32 | if {[file isdir $f]} continue |
| 33 | set base [file root [file tail $f]] |
| 34 | set f1 [read_file $f] |
| 35 | write_file t1 $f1 |
| 36 |
+5
| --- test/fake-editor.tcl | ||
| +++ test/fake-editor.tcl | ||
| @@ -49,10 +49,15 @@ | ||
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | ############################################################################### |
| 52 | 52 | |
| 53 | 53 | set fileName [lindex $argv 0] |
| 54 | + | |
| 55 | +if {[regexp {^CYGWIN} $::tcl_platform(os)]} { | |
| 56 | + # Under Cygwin, we get a Windows path but must access using the unix path. | |
| 57 | + set fileName [exec cygpath --unix $fileName] | |
| 58 | +} | |
| 54 | 59 | |
| 55 | 60 | if {[file exists $fileName]} { |
| 56 | 61 | set data [readFile $fileName] |
| 57 | 62 | } else { |
| 58 | 63 | set data "" |
| 59 | 64 |
| --- test/fake-editor.tcl | |
| +++ test/fake-editor.tcl | |
| @@ -49,10 +49,15 @@ | |
| 49 | } |
| 50 | |
| 51 | ############################################################################### |
| 52 | |
| 53 | set fileName [lindex $argv 0] |
| 54 | |
| 55 | if {[file exists $fileName]} { |
| 56 | set data [readFile $fileName] |
| 57 | } else { |
| 58 | set data "" |
| 59 |
| --- test/fake-editor.tcl | |
| +++ test/fake-editor.tcl | |
| @@ -49,10 +49,15 @@ | |
| 49 | } |
| 50 | |
| 51 | ############################################################################### |
| 52 | |
| 53 | set fileName [lindex $argv 0] |
| 54 | |
| 55 | if {[regexp {^CYGWIN} $::tcl_platform(os)]} { |
| 56 | # Under Cygwin, we get a Windows path but must access using the unix path. |
| 57 | set fileName [exec cygpath --unix $fileName] |
| 58 | } |
| 59 | |
| 60 | if {[file exists $fileName]} { |
| 61 | set data [readFile $fileName] |
| 62 | } else { |
| 63 | set data "" |
| 64 |
+14
-1
| --- test/json.test | ||
| +++ test/json.test | ||
| @@ -177,10 +177,18 @@ | ||
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | #### VERSION AKA HAI |
| 180 | 180 | |
| 181 | 181 | # The JSON API generally assumes we have a respository, so let it have one. |
| 182 | + | |
| 183 | +# Set FOSSIL_USER to ensure consistent results in "json user list" | |
| 184 | +set _fossil_user "" | |
| 185 | +if [info exists env(FOSSIL_USER)] { | |
| 186 | + set _fossil_user $env(FOSSIL_USER) | |
| 187 | +} | |
| 188 | +set ::env(FOSSIL_USER) "JSON-TEST-USER" | |
| 189 | + | |
| 182 | 190 | test_setup |
| 183 | 191 | |
| 184 | 192 | # Stop backoffice from running during this test as it can cause hangs. |
| 185 | 193 | fossil settings backoffice-disable 1 |
| 186 | 194 | |
| @@ -887,11 +895,10 @@ | ||
| 887 | 895 | fossil_json HAI -expectError |
| 888 | 896 | test json-RC-4102-CLI-exit {$CODE != 0} |
| 889 | 897 | test_json_envelope json-RC-4102-CLI-exit {fossil timestamp command procTimeUs \ |
| 890 | 898 | procTimeMs resultCode resultText} {payload} |
| 891 | 899 | test json-RC-4102 {[dict get $JR resultCode] eq "FOSSIL-4102"} |
| 892 | -fossil open .rep.fossil | |
| 893 | 900 | |
| 894 | 901 | # FOSSIL-4103 FSL_JSON_E_DB_NOT_VALID |
| 895 | 902 | # Fossil repository db file is not valid. |
| 896 | 903 | write_file nope.fossil { |
| 897 | 904 | This is not a fossil repo. It ought to be a SQLite db with a well-known schema, |
| @@ -908,5 +915,11 @@ | ||
| 908 | 915 | } |
| 909 | 916 | |
| 910 | 917 | ############################################################################### |
| 911 | 918 | |
| 912 | 919 | test_cleanup |
| 920 | + | |
| 921 | +if { $_fossil_user eq "" } { | |
| 922 | + unset ::env(FOSSIL_USER) | |
| 923 | +} else { | |
| 924 | + set ::env(FOSSIL_USER) $_fossil_user | |
| 925 | +} | |
| 913 | 926 |
| --- test/json.test | |
| +++ test/json.test | |
| @@ -177,10 +177,18 @@ | |
| 177 | } |
| 178 | |
| 179 | #### VERSION AKA HAI |
| 180 | |
| 181 | # The JSON API generally assumes we have a respository, so let it have one. |
| 182 | test_setup |
| 183 | |
| 184 | # Stop backoffice from running during this test as it can cause hangs. |
| 185 | fossil settings backoffice-disable 1 |
| 186 | |
| @@ -887,11 +895,10 @@ | |
| 887 | fossil_json HAI -expectError |
| 888 | test json-RC-4102-CLI-exit {$CODE != 0} |
| 889 | test_json_envelope json-RC-4102-CLI-exit {fossil timestamp command procTimeUs \ |
| 890 | procTimeMs resultCode resultText} {payload} |
| 891 | test json-RC-4102 {[dict get $JR resultCode] eq "FOSSIL-4102"} |
| 892 | fossil open .rep.fossil |
| 893 | |
| 894 | # FOSSIL-4103 FSL_JSON_E_DB_NOT_VALID |
| 895 | # Fossil repository db file is not valid. |
| 896 | write_file nope.fossil { |
| 897 | This is not a fossil repo. It ought to be a SQLite db with a well-known schema, |
| @@ -908,5 +915,11 @@ | |
| 908 | } |
| 909 | |
| 910 | ############################################################################### |
| 911 | |
| 912 | test_cleanup |
| 913 |
| --- test/json.test | |
| +++ test/json.test | |
| @@ -177,10 +177,18 @@ | |
| 177 | } |
| 178 | |
| 179 | #### VERSION AKA HAI |
| 180 | |
| 181 | # The JSON API generally assumes we have a respository, so let it have one. |
| 182 | |
| 183 | # Set FOSSIL_USER to ensure consistent results in "json user list" |
| 184 | set _fossil_user "" |
| 185 | if [info exists env(FOSSIL_USER)] { |
| 186 | set _fossil_user $env(FOSSIL_USER) |
| 187 | } |
| 188 | set ::env(FOSSIL_USER) "JSON-TEST-USER" |
| 189 | |
| 190 | test_setup |
| 191 | |
| 192 | # Stop backoffice from running during this test as it can cause hangs. |
| 193 | fossil settings backoffice-disable 1 |
| 194 | |
| @@ -887,11 +895,10 @@ | |
| 895 | fossil_json HAI -expectError |
| 896 | test json-RC-4102-CLI-exit {$CODE != 0} |
| 897 | test_json_envelope json-RC-4102-CLI-exit {fossil timestamp command procTimeUs \ |
| 898 | procTimeMs resultCode resultText} {payload} |
| 899 | test json-RC-4102 {[dict get $JR resultCode] eq "FOSSIL-4102"} |
| 900 | |
| 901 | # FOSSIL-4103 FSL_JSON_E_DB_NOT_VALID |
| 902 | # Fossil repository db file is not valid. |
| 903 | write_file nope.fossil { |
| 904 | This is not a fossil repo. It ought to be a SQLite db with a well-known schema, |
| @@ -908,5 +915,11 @@ | |
| 915 | } |
| 916 | |
| 917 | ############################################################################### |
| 918 | |
| 919 | test_cleanup |
| 920 | |
| 921 | if { $_fossil_user eq "" } { |
| 922 | unset ::env(FOSSIL_USER) |
| 923 | } else { |
| 924 | set ::env(FOSSIL_USER) $_fossil_user |
| 925 | } |
| 926 |
+6
-6
| --- test/merge1.test | ||
| +++ test/merge1.test | ||
| @@ -98,13 +98,13 @@ | ||
| 98 | 98 | 222 - The second line program line in code - 2222 |
| 99 | 99 | 333 - This is a test of the merging algohm - 3333 |
| 100 | 100 | 444 - If all goes well, we will be pleased - 4444 |
| 101 | 101 | 555 - we think it well and other stuff too - 5555 |
| 102 | 102 | } |
| 103 | -fossil 3-way-merge t1 t3 t2 a32 | |
| 103 | +fossil 3-way-merge t1 t3 t2 a32 -expectError | |
| 104 | 104 | test merge1-2.1 {[same_file t32 a32]} |
| 105 | -fossil 3-way-merge t1 t2 t3 a23 | |
| 105 | +fossil 3-way-merge t1 t2 t3 a23 -expectError | |
| 106 | 106 | test merge1-2.2 {[same_file t23 a23]} |
| 107 | 107 | |
| 108 | 108 | write_file_indented t1 { |
| 109 | 109 | 111 - This is line one of the demo program - 1111 |
| 110 | 110 | 222 - The second line program line in code - 2222 |
| @@ -183,13 +183,13 @@ | ||
| 183 | 183 | 222 - The second line program line in code - 2222 |
| 184 | 184 | 333 - This is a test of the merging algohm - 3333 |
| 185 | 185 | 444 - If all goes well, we will be pleased - 4444 |
| 186 | 186 | 555 - we think it well and other stuff too - 5555 |
| 187 | 187 | } |
| 188 | -fossil 3-way-merge t1 t3 t2 a32 | |
| 188 | +fossil 3-way-merge t1 t3 t2 a32 -expectError | |
| 189 | 189 | test merge1-4.1 {[same_file t32 a32]} |
| 190 | -fossil 3-way-merge t1 t2 t3 a23 | |
| 190 | +fossil 3-way-merge t1 t2 t3 a23 -expectError | |
| 191 | 191 | test merge1-4.2 {[same_file t23 a23]} |
| 192 | 192 | |
| 193 | 193 | write_file_indented t1 { |
| 194 | 194 | 111 - This is line one of the demo program - 1111 |
| 195 | 195 | 222 - The second line program line in code - 2222 |
| @@ -330,11 +330,11 @@ | ||
| 330 | 330 | KLMN |
| 331 | 331 | OPQR |
| 332 | 332 | STUV |
| 333 | 333 | XYZ. |
| 334 | 334 | } |
| 335 | -fossil 3-way-merge t1 t2 t3 a23 | |
| 335 | +fossil 3-way-merge t1 t2 t3 a23 -expectError | |
| 336 | 336 | test merge1-7.1 {[same_file t23 a23]} |
| 337 | 337 | |
| 338 | 338 | write_file_indented t2 { |
| 339 | 339 | abcd |
| 340 | 340 | efgh 2 |
| @@ -398,11 +398,11 @@ | ||
| 398 | 398 | KLMN |
| 399 | 399 | OPQR |
| 400 | 400 | STUV |
| 401 | 401 | XYZ. |
| 402 | 402 | } |
| 403 | -fossil 3-way-merge t1 t2 t3 a23 | |
| 403 | +fossil 3-way-merge t1 t2 t3 a23 -expectError | |
| 404 | 404 | test merge1-7.2 {[same_file t23 a23]} |
| 405 | 405 | |
| 406 | 406 | ############################################################################### |
| 407 | 407 | |
| 408 | 408 | test_cleanup |
| 409 | 409 |
| --- test/merge1.test | |
| +++ test/merge1.test | |
| @@ -98,13 +98,13 @@ | |
| 98 | 222 - The second line program line in code - 2222 |
| 99 | 333 - This is a test of the merging algohm - 3333 |
| 100 | 444 - If all goes well, we will be pleased - 4444 |
| 101 | 555 - we think it well and other stuff too - 5555 |
| 102 | } |
| 103 | fossil 3-way-merge t1 t3 t2 a32 |
| 104 | test merge1-2.1 {[same_file t32 a32]} |
| 105 | fossil 3-way-merge t1 t2 t3 a23 |
| 106 | test merge1-2.2 {[same_file t23 a23]} |
| 107 | |
| 108 | write_file_indented t1 { |
| 109 | 111 - This is line one of the demo program - 1111 |
| 110 | 222 - The second line program line in code - 2222 |
| @@ -183,13 +183,13 @@ | |
| 183 | 222 - The second line program line in code - 2222 |
| 184 | 333 - This is a test of the merging algohm - 3333 |
| 185 | 444 - If all goes well, we will be pleased - 4444 |
| 186 | 555 - we think it well and other stuff too - 5555 |
| 187 | } |
| 188 | fossil 3-way-merge t1 t3 t2 a32 |
| 189 | test merge1-4.1 {[same_file t32 a32]} |
| 190 | fossil 3-way-merge t1 t2 t3 a23 |
| 191 | test merge1-4.2 {[same_file t23 a23]} |
| 192 | |
| 193 | write_file_indented t1 { |
| 194 | 111 - This is line one of the demo program - 1111 |
| 195 | 222 - The second line program line in code - 2222 |
| @@ -330,11 +330,11 @@ | |
| 330 | KLMN |
| 331 | OPQR |
| 332 | STUV |
| 333 | XYZ. |
| 334 | } |
| 335 | fossil 3-way-merge t1 t2 t3 a23 |
| 336 | test merge1-7.1 {[same_file t23 a23]} |
| 337 | |
| 338 | write_file_indented t2 { |
| 339 | abcd |
| 340 | efgh 2 |
| @@ -398,11 +398,11 @@ | |
| 398 | KLMN |
| 399 | OPQR |
| 400 | STUV |
| 401 | XYZ. |
| 402 | } |
| 403 | fossil 3-way-merge t1 t2 t3 a23 |
| 404 | test merge1-7.2 {[same_file t23 a23]} |
| 405 | |
| 406 | ############################################################################### |
| 407 | |
| 408 | test_cleanup |
| 409 |
| --- test/merge1.test | |
| +++ test/merge1.test | |
| @@ -98,13 +98,13 @@ | |
| 98 | 222 - The second line program line in code - 2222 |
| 99 | 333 - This is a test of the merging algohm - 3333 |
| 100 | 444 - If all goes well, we will be pleased - 4444 |
| 101 | 555 - we think it well and other stuff too - 5555 |
| 102 | } |
| 103 | fossil 3-way-merge t1 t3 t2 a32 -expectError |
| 104 | test merge1-2.1 {[same_file t32 a32]} |
| 105 | fossil 3-way-merge t1 t2 t3 a23 -expectError |
| 106 | test merge1-2.2 {[same_file t23 a23]} |
| 107 | |
| 108 | write_file_indented t1 { |
| 109 | 111 - This is line one of the demo program - 1111 |
| 110 | 222 - The second line program line in code - 2222 |
| @@ -183,13 +183,13 @@ | |
| 183 | 222 - The second line program line in code - 2222 |
| 184 | 333 - This is a test of the merging algohm - 3333 |
| 185 | 444 - If all goes well, we will be pleased - 4444 |
| 186 | 555 - we think it well and other stuff too - 5555 |
| 187 | } |
| 188 | fossil 3-way-merge t1 t3 t2 a32 -expectError |
| 189 | test merge1-4.1 {[same_file t32 a32]} |
| 190 | fossil 3-way-merge t1 t2 t3 a23 -expectError |
| 191 | test merge1-4.2 {[same_file t23 a23]} |
| 192 | |
| 193 | write_file_indented t1 { |
| 194 | 111 - This is line one of the demo program - 1111 |
| 195 | 222 - The second line program line in code - 2222 |
| @@ -330,11 +330,11 @@ | |
| 330 | KLMN |
| 331 | OPQR |
| 332 | STUV |
| 333 | XYZ. |
| 334 | } |
| 335 | fossil 3-way-merge t1 t2 t3 a23 -expectError |
| 336 | test merge1-7.1 {[same_file t23 a23]} |
| 337 | |
| 338 | write_file_indented t2 { |
| 339 | abcd |
| 340 | efgh 2 |
| @@ -398,11 +398,11 @@ | |
| 398 | KLMN |
| 399 | OPQR |
| 400 | STUV |
| 401 | XYZ. |
| 402 | } |
| 403 | fossil 3-way-merge t1 t2 t3 a23 -expectError |
| 404 | test merge1-7.2 {[same_file t23 a23]} |
| 405 | |
| 406 | ############################################################################### |
| 407 | |
| 408 | test_cleanup |
| 409 |
+1
-1
| --- test/merge2.test | ||
| +++ test/merge2.test | ||
| @@ -18,11 +18,11 @@ | ||
| 18 | 18 | # Tests of the delta mechanism. |
| 19 | 19 | # |
| 20 | 20 | |
| 21 | 21 | test_setup "" |
| 22 | 22 | |
| 23 | -set filelist [glob $testdir/*] | |
| 23 | +set filelist [lsort [glob $testdir/*]] | |
| 24 | 24 | foreach f $filelist { |
| 25 | 25 | if {[file isdir $f]} continue |
| 26 | 26 | set base [file root [file tail $f]] |
| 27 | 27 | if {[string match "utf16*" $base]} continue |
| 28 | 28 | set f1 [read_file $f] |
| 29 | 29 |
| --- test/merge2.test | |
| +++ test/merge2.test | |
| @@ -18,11 +18,11 @@ | |
| 18 | # Tests of the delta mechanism. |
| 19 | # |
| 20 | |
| 21 | test_setup "" |
| 22 | |
| 23 | set filelist [glob $testdir/*] |
| 24 | foreach f $filelist { |
| 25 | if {[file isdir $f]} continue |
| 26 | set base [file root [file tail $f]] |
| 27 | if {[string match "utf16*" $base]} continue |
| 28 | set f1 [read_file $f] |
| 29 |
| --- test/merge2.test | |
| +++ test/merge2.test | |
| @@ -18,11 +18,11 @@ | |
| 18 | # Tests of the delta mechanism. |
| 19 | # |
| 20 | |
| 21 | test_setup "" |
| 22 | |
| 23 | set filelist [lsort [glob $testdir/*]] |
| 24 | foreach f $filelist { |
| 25 | if {[file isdir $f]} continue |
| 26 | set base [file root [file tail $f]] |
| 27 | if {[string match "utf16*" $base]} continue |
| 28 | set f1 [read_file $f] |
| 29 |
+27
-27
| --- test/merge3.test | ||
| +++ test/merge3.test | ||
| @@ -18,15 +18,15 @@ | ||
| 18 | 18 | # Tests of the 3-way merge |
| 19 | 19 | # |
| 20 | 20 | |
| 21 | 21 | test_setup "" |
| 22 | 22 | |
| 23 | -proc merge-test {testid basis v1 v2 result} { | |
| 23 | +proc merge-test {testid basis v1 v2 result {fossil_args ""}} { | |
| 24 | 24 | write_file t1 [join [string trim $basis] \n]\n |
| 25 | 25 | write_file t2 [join [string trim $v1] \n]\n |
| 26 | 26 | write_file t3 [join [string trim $v2] \n]\n |
| 27 | - fossil 3-way-merge t1 t2 t3 t4 | |
| 27 | + fossil 3-way-merge t1 t2 t3 t4 {*}$fossil_args | |
| 28 | 28 | set x [read_file t4] |
| 29 | 29 | regsub -all \ |
| 30 | 30 | {<<<<<<< BEGIN MERGE CONFLICT: local copy shown first <+ \(line \d+\)} \ |
| 31 | 31 | $x {MINE:} x |
| 32 | 32 | regsub -all \ |
| @@ -74,56 +74,56 @@ | ||
| 74 | 74 | 1 2 3b 4b 5b 6 7 8 9 |
| 75 | 75 | } { |
| 76 | 76 | 1 2 3 4 5c 6 7 8 9 |
| 77 | 77 | } { |
| 78 | 78 | 1 2 MINE: 3b 4b 5b COM: 3 4 5 YOURS: 3 4 5c END 6 7 8 9 |
| 79 | -} | |
| 79 | +} -expectError | |
| 80 | 80 | merge-test 4 { |
| 81 | 81 | 1 2 3 4 5 6 7 8 9 |
| 82 | 82 | } { |
| 83 | 83 | 1 2 3b 4b 5b 6b 7 8 9 |
| 84 | 84 | } { |
| 85 | 85 | 1 2 3 4 5c 6 7 8 9 |
| 86 | 86 | } { |
| 87 | 87 | 1 2 MINE: 3b 4b 5b 6b COM: 3 4 5 6 YOURS: 3 4 5c 6 END 7 8 9 |
| 88 | -} | |
| 88 | +} -expectError | |
| 89 | 89 | merge-test 5 { |
| 90 | 90 | 1 2 3 4 5 6 7 8 9 |
| 91 | 91 | } { |
| 92 | 92 | 1 2 3b 4b 5b 6b 7 8 9 |
| 93 | 93 | } { |
| 94 | 94 | 1 2 3 4 5c 6c 7c 8 9 |
| 95 | 95 | } { |
| 96 | 96 | 1 2 MINE: 3b 4b 5b 6b 7 COM: 3 4 5 6 7 YOURS: 3 4 5c 6c 7c END 8 9 |
| 97 | -} | |
| 97 | +} -expectError | |
| 98 | 98 | merge-test 6 { |
| 99 | 99 | 1 2 3 4 5 6 7 8 9 |
| 100 | 100 | } { |
| 101 | 101 | 1 2 3b 4b 5b 6b 7 8b 9 |
| 102 | 102 | } { |
| 103 | 103 | 1 2 3 4 5c 6c 7c 8 9 |
| 104 | 104 | } { |
| 105 | 105 | 1 2 MINE: 3b 4b 5b 6b 7 COM: 3 4 5 6 7 YOURS: 3 4 5c 6c 7c END 8b 9 |
| 106 | -} | |
| 106 | +} -expectError | |
| 107 | 107 | merge-test 7 { |
| 108 | 108 | 1 2 3 4 5 6 7 8 9 |
| 109 | 109 | } { |
| 110 | 110 | 1 2 3b 4b 5b 6b 7 8b 9 |
| 111 | 111 | } { |
| 112 | 112 | 1 2 3 4 5c 6c 7c 8c 9 |
| 113 | 113 | } { |
| 114 | 114 | 1 2 MINE: 3b 4b 5b 6b 7 8b COM: 3 4 5 6 7 8 YOURS: 3 4 5c 6c 7c 8c END 9 |
| 115 | -} | |
| 115 | +} -expectError | |
| 116 | 116 | merge-test 8 { |
| 117 | 117 | 1 2 3 4 5 6 7 8 9 |
| 118 | 118 | } { |
| 119 | 119 | 1 2 3b 4b 5b 6b 7 8b 9b |
| 120 | 120 | } { |
| 121 | 121 | 1 2 3 4 5c 6c 7c 8c 9 |
| 122 | 122 | } { |
| 123 | 123 | 1 2 MINE: 3b 4b 5b 6b 7 8b 9b COM: 3 4 5 6 7 8 9 YOURS: 3 4 5c 6c 7c 8c 9 END |
| 124 | -} | |
| 124 | +} -expectError | |
| 125 | 125 | merge-test 9 { |
| 126 | 126 | 1 2 3 4 5 6 7 8 9 |
| 127 | 127 | } { |
| 128 | 128 | 1 2 3b 4b 5 6 7 8b 9b |
| 129 | 129 | } { |
| @@ -147,11 +147,11 @@ | ||
| 147 | 147 | 1 2 3b 4b 5 6 7 8b 9b |
| 148 | 148 | } { |
| 149 | 149 | 1 2 3b 4c 5 6c 7c 8 9 |
| 150 | 150 | } { |
| 151 | 151 | 1 2 MINE: 3b 4b COM: 3 4 YOURS: 3b 4c END 5 6c 7c 8b 9b |
| 152 | -} | |
| 152 | +} -expectError | |
| 153 | 153 | merge-test 12 { |
| 154 | 154 | 1 2 3 4 5 6 7 8 9 |
| 155 | 155 | } { |
| 156 | 156 | 1 2 3b4b 5 6 7 8b 9b |
| 157 | 157 | } { |
| @@ -202,20 +202,20 @@ | ||
| 202 | 202 | 1 6 7 8 9 |
| 203 | 203 | } { |
| 204 | 204 | 1 2 3 4 9 |
| 205 | 205 | } { |
| 206 | 206 | 1 MINE: 6 7 8 COM: 2 3 4 5 6 7 8 YOURS: 2 3 4 END 9 |
| 207 | -} | |
| 207 | +} -expectError | |
| 208 | 208 | merge-test 25 { |
| 209 | 209 | 1 2 3 4 5 6 7 8 9 |
| 210 | 210 | } { |
| 211 | 211 | 1 7 8 9 |
| 212 | 212 | } { |
| 213 | 213 | 1 2 3 9 |
| 214 | 214 | } { |
| 215 | 215 | 1 MINE: 7 8 COM: 2 3 4 5 6 7 8 YOURS: 2 3 END 9 |
| 216 | -} | |
| 216 | +} -expectError | |
| 217 | 217 | |
| 218 | 218 | merge-test 30 { |
| 219 | 219 | 1 2 3 4 5 6 7 8 9 |
| 220 | 220 | } { |
| 221 | 221 | 1 2 3 4 5 6 7 9 |
| @@ -257,20 +257,20 @@ | ||
| 257 | 257 | 1 2 3 4 9 |
| 258 | 258 | } { |
| 259 | 259 | 1 6 7 8 9 |
| 260 | 260 | } { |
| 261 | 261 | 1 MINE: 2 3 4 COM: 2 3 4 5 6 7 8 YOURS: 6 7 8 END 9 |
| 262 | -} | |
| 262 | +} -expectError | |
| 263 | 263 | merge-test 35 { |
| 264 | 264 | 1 2 3 4 5 6 7 8 9 |
| 265 | 265 | } { |
| 266 | 266 | 1 2 3 9 |
| 267 | 267 | } { |
| 268 | 268 | 1 7 8 9 |
| 269 | 269 | } { |
| 270 | 270 | 1 MINE: 2 3 COM: 2 3 4 5 6 7 8 YOURS: 7 8 END 9 |
| 271 | -} | |
| 271 | +} -expectError | |
| 272 | 272 | |
| 273 | 273 | merge-test 40 { |
| 274 | 274 | 2 3 4 5 6 7 8 |
| 275 | 275 | } { |
| 276 | 276 | 3 4 5 6 7 8 |
| @@ -312,20 +312,20 @@ | ||
| 312 | 312 | 6 7 8 |
| 313 | 313 | } { |
| 314 | 314 | 2 3 4 |
| 315 | 315 | } { |
| 316 | 316 | MINE: 6 7 8 COM: 2 3 4 5 6 7 8 YOURS: 2 3 4 END |
| 317 | -} | |
| 317 | +} -expectError | |
| 318 | 318 | merge-test 45 { |
| 319 | 319 | 2 3 4 5 6 7 8 |
| 320 | 320 | } { |
| 321 | 321 | 7 8 |
| 322 | 322 | } { |
| 323 | 323 | 2 3 |
| 324 | 324 | } { |
| 325 | 325 | MINE: 7 8 COM: 2 3 4 5 6 7 8 YOURS: 2 3 END |
| 326 | -} | |
| 326 | +} -expectError | |
| 327 | 327 | |
| 328 | 328 | merge-test 50 { |
| 329 | 329 | 2 3 4 5 6 7 8 |
| 330 | 330 | } { |
| 331 | 331 | 2 3 4 5 6 7 |
| @@ -366,20 +366,20 @@ | ||
| 366 | 366 | 2 3 4 |
| 367 | 367 | } { |
| 368 | 368 | 6 7 8 |
| 369 | 369 | } { |
| 370 | 370 | MINE: 2 3 4 COM: 2 3 4 5 6 7 8 YOURS: 6 7 8 END |
| 371 | -} | |
| 371 | +} -expectError | |
| 372 | 372 | merge-test 55 { |
| 373 | 373 | 2 3 4 5 6 7 8 |
| 374 | 374 | } { |
| 375 | 375 | 2 3 |
| 376 | 376 | } { |
| 377 | 377 | 7 8 |
| 378 | 378 | } { |
| 379 | 379 | MINE: 2 3 COM: 2 3 4 5 6 7 8 YOURS: 7 8 END |
| 380 | -} | |
| 380 | +} -expectError | |
| 381 | 381 | |
| 382 | 382 | merge-test 60 { |
| 383 | 383 | 1 2 3 4 5 6 7 8 9 |
| 384 | 384 | } { |
| 385 | 385 | 1 2b 3 4 5 6 7 8 9 |
| @@ -421,20 +421,20 @@ | ||
| 421 | 421 | 1 2b 3b 4b 5b 6 7 8 9 |
| 422 | 422 | } { |
| 423 | 423 | 1 2 3 4 9 |
| 424 | 424 | } { |
| 425 | 425 | 1 MINE: 2b 3b 4b 5b 6 7 8 COM: 2 3 4 5 6 7 8 YOURS: 2 3 4 END 9 |
| 426 | -} | |
| 426 | +} -expectError | |
| 427 | 427 | merge-test 65 { |
| 428 | 428 | 1 2 3 4 5 6 7 8 9 |
| 429 | 429 | } { |
| 430 | 430 | 1 2b 3b 4b 5b 6b 7 8 9 |
| 431 | 431 | } { |
| 432 | 432 | 1 2 3 9 |
| 433 | 433 | } { |
| 434 | 434 | 1 MINE: 2b 3b 4b 5b 6b 7 8 COM: 2 3 4 5 6 7 8 YOURS: 2 3 END 9 |
| 435 | -} | |
| 435 | +} -expectError | |
| 436 | 436 | |
| 437 | 437 | merge-test 70 { |
| 438 | 438 | 1 2 3 4 5 6 7 8 9 |
| 439 | 439 | } { |
| 440 | 440 | 1 2 3 4 5 6 7 9 |
| @@ -476,20 +476,20 @@ | ||
| 476 | 476 | 1 2 3 4 9 |
| 477 | 477 | } { |
| 478 | 478 | 1 2b 3b 4b 5b 6 7 8 9 |
| 479 | 479 | } { |
| 480 | 480 | 1 MINE: 2 3 4 COM: 2 3 4 5 6 7 8 YOURS: 2b 3b 4b 5b 6 7 8 END 9 |
| 481 | -} | |
| 481 | +} -expectError | |
| 482 | 482 | merge-test 75 { |
| 483 | 483 | 1 2 3 4 5 6 7 8 9 |
| 484 | 484 | } { |
| 485 | 485 | 1 2 3 9 |
| 486 | 486 | } { |
| 487 | 487 | 1 2b 3b 4b 5b 6b 7 8 9 |
| 488 | 488 | } { |
| 489 | 489 | 1 MINE: 2 3 COM: 2 3 4 5 6 7 8 YOURS: 2b 3b 4b 5b 6b 7 8 END 9 |
| 490 | -} | |
| 490 | +} -expectError | |
| 491 | 491 | |
| 492 | 492 | merge-test 80 { |
| 493 | 493 | 2 3 4 5 6 7 8 |
| 494 | 494 | } { |
| 495 | 495 | 2b 3 4 5 6 7 8 |
| @@ -531,20 +531,20 @@ | ||
| 531 | 531 | 2b 3b 4b 5b 6 7 8 |
| 532 | 532 | } { |
| 533 | 533 | 2 3 4 |
| 534 | 534 | } { |
| 535 | 535 | MINE: 2b 3b 4b 5b 6 7 8 COM: 2 3 4 5 6 7 8 YOURS: 2 3 4 END |
| 536 | -} | |
| 536 | +} -expectError | |
| 537 | 537 | merge-test 85 { |
| 538 | 538 | 2 3 4 5 6 7 8 |
| 539 | 539 | } { |
| 540 | 540 | 2b 3b 4b 5b 6b 7 8 |
| 541 | 541 | } { |
| 542 | 542 | 2 3 |
| 543 | 543 | } { |
| 544 | 544 | MINE: 2b 3b 4b 5b 6b 7 8 COM: 2 3 4 5 6 7 8 YOURS: 2 3 END |
| 545 | -} | |
| 545 | +} -expectError | |
| 546 | 546 | |
| 547 | 547 | merge-test 90 { |
| 548 | 548 | 2 3 4 5 6 7 8 |
| 549 | 549 | } { |
| 550 | 550 | 2 3 4 5 6 7 |
| @@ -586,20 +586,20 @@ | ||
| 586 | 586 | 2 3 4 |
| 587 | 587 | } { |
| 588 | 588 | 2b 3b 4b 5b 6 7 8 |
| 589 | 589 | } { |
| 590 | 590 | MINE: 2 3 4 COM: 2 3 4 5 6 7 8 YOURS: 2b 3b 4b 5b 6 7 8 END |
| 591 | -} | |
| 591 | +} -expectError | |
| 592 | 592 | merge-test 95 { |
| 593 | 593 | 2 3 4 5 6 7 8 |
| 594 | 594 | } { |
| 595 | 595 | 2 3 |
| 596 | 596 | } { |
| 597 | 597 | 2b 3b 4b 5b 6b 7 8 |
| 598 | 598 | } { |
| 599 | 599 | MINE: 2 3 COM: 2 3 4 5 6 7 8 YOURS: 2b 3b 4b 5b 6b 7 8 END |
| 600 | -} | |
| 600 | +} -expectError | |
| 601 | 601 | |
| 602 | 602 | merge-test 100 { |
| 603 | 603 | 1 2 3 4 5 6 7 8 9 |
| 604 | 604 | } { |
| 605 | 605 | 1 2b 3 4 5 7 8 9 a b c d e |
| @@ -632,19 +632,19 @@ | ||
| 632 | 632 | 1 2 3 4 5 7 8 9b |
| 633 | 633 | } { |
| 634 | 634 | 1 2 3 4 5 7 8 9b a b c d e |
| 635 | 635 | } { |
| 636 | 636 | 1 2 3 4 5 7 8 MINE: 9b COM: 9 YOURS: 9b a b c d e END |
| 637 | -} | |
| 637 | +} -expectError | |
| 638 | 638 | merge-test 104 { |
| 639 | 639 | 1 2 3 4 5 6 7 8 9 |
| 640 | 640 | } { |
| 641 | 641 | 1 2 3 4 5 7 8 9b a b c d e |
| 642 | 642 | } { |
| 643 | 643 | 1 2 3 4 5 7 8 9b |
| 644 | 644 | } { |
| 645 | 645 | 1 2 3 4 5 7 8 MINE: 9b a b c d e COM: 9 YOURS: 9b END |
| 646 | -} | |
| 646 | +} -expectError | |
| 647 | 647 | |
| 648 | 648 | ############################################################################### |
| 649 | 649 | |
| 650 | 650 | test_cleanup |
| 651 | 651 |
| --- test/merge3.test | |
| +++ test/merge3.test | |
| @@ -18,15 +18,15 @@ | |
| 18 | # Tests of the 3-way merge |
| 19 | # |
| 20 | |
| 21 | test_setup "" |
| 22 | |
| 23 | proc merge-test {testid basis v1 v2 result} { |
| 24 | write_file t1 [join [string trim $basis] \n]\n |
| 25 | write_file t2 [join [string trim $v1] \n]\n |
| 26 | write_file t3 [join [string trim $v2] \n]\n |
| 27 | fossil 3-way-merge t1 t2 t3 t4 |
| 28 | set x [read_file t4] |
| 29 | regsub -all \ |
| 30 | {<<<<<<< BEGIN MERGE CONFLICT: local copy shown first <+ \(line \d+\)} \ |
| 31 | $x {MINE:} x |
| 32 | regsub -all \ |
| @@ -74,56 +74,56 @@ | |
| 74 | 1 2 3b 4b 5b 6 7 8 9 |
| 75 | } { |
| 76 | 1 2 3 4 5c 6 7 8 9 |
| 77 | } { |
| 78 | 1 2 MINE: 3b 4b 5b COM: 3 4 5 YOURS: 3 4 5c END 6 7 8 9 |
| 79 | } |
| 80 | merge-test 4 { |
| 81 | 1 2 3 4 5 6 7 8 9 |
| 82 | } { |
| 83 | 1 2 3b 4b 5b 6b 7 8 9 |
| 84 | } { |
| 85 | 1 2 3 4 5c 6 7 8 9 |
| 86 | } { |
| 87 | 1 2 MINE: 3b 4b 5b 6b COM: 3 4 5 6 YOURS: 3 4 5c 6 END 7 8 9 |
| 88 | } |
| 89 | merge-test 5 { |
| 90 | 1 2 3 4 5 6 7 8 9 |
| 91 | } { |
| 92 | 1 2 3b 4b 5b 6b 7 8 9 |
| 93 | } { |
| 94 | 1 2 3 4 5c 6c 7c 8 9 |
| 95 | } { |
| 96 | 1 2 MINE: 3b 4b 5b 6b 7 COM: 3 4 5 6 7 YOURS: 3 4 5c 6c 7c END 8 9 |
| 97 | } |
| 98 | merge-test 6 { |
| 99 | 1 2 3 4 5 6 7 8 9 |
| 100 | } { |
| 101 | 1 2 3b 4b 5b 6b 7 8b 9 |
| 102 | } { |
| 103 | 1 2 3 4 5c 6c 7c 8 9 |
| 104 | } { |
| 105 | 1 2 MINE: 3b 4b 5b 6b 7 COM: 3 4 5 6 7 YOURS: 3 4 5c 6c 7c END 8b 9 |
| 106 | } |
| 107 | merge-test 7 { |
| 108 | 1 2 3 4 5 6 7 8 9 |
| 109 | } { |
| 110 | 1 2 3b 4b 5b 6b 7 8b 9 |
| 111 | } { |
| 112 | 1 2 3 4 5c 6c 7c 8c 9 |
| 113 | } { |
| 114 | 1 2 MINE: 3b 4b 5b 6b 7 8b COM: 3 4 5 6 7 8 YOURS: 3 4 5c 6c 7c 8c END 9 |
| 115 | } |
| 116 | merge-test 8 { |
| 117 | 1 2 3 4 5 6 7 8 9 |
| 118 | } { |
| 119 | 1 2 3b 4b 5b 6b 7 8b 9b |
| 120 | } { |
| 121 | 1 2 3 4 5c 6c 7c 8c 9 |
| 122 | } { |
| 123 | 1 2 MINE: 3b 4b 5b 6b 7 8b 9b COM: 3 4 5 6 7 8 9 YOURS: 3 4 5c 6c 7c 8c 9 END |
| 124 | } |
| 125 | merge-test 9 { |
| 126 | 1 2 3 4 5 6 7 8 9 |
| 127 | } { |
| 128 | 1 2 3b 4b 5 6 7 8b 9b |
| 129 | } { |
| @@ -147,11 +147,11 @@ | |
| 147 | 1 2 3b 4b 5 6 7 8b 9b |
| 148 | } { |
| 149 | 1 2 3b 4c 5 6c 7c 8 9 |
| 150 | } { |
| 151 | 1 2 MINE: 3b 4b COM: 3 4 YOURS: 3b 4c END 5 6c 7c 8b 9b |
| 152 | } |
| 153 | merge-test 12 { |
| 154 | 1 2 3 4 5 6 7 8 9 |
| 155 | } { |
| 156 | 1 2 3b4b 5 6 7 8b 9b |
| 157 | } { |
| @@ -202,20 +202,20 @@ | |
| 202 | 1 6 7 8 9 |
| 203 | } { |
| 204 | 1 2 3 4 9 |
| 205 | } { |
| 206 | 1 MINE: 6 7 8 COM: 2 3 4 5 6 7 8 YOURS: 2 3 4 END 9 |
| 207 | } |
| 208 | merge-test 25 { |
| 209 | 1 2 3 4 5 6 7 8 9 |
| 210 | } { |
| 211 | 1 7 8 9 |
| 212 | } { |
| 213 | 1 2 3 9 |
| 214 | } { |
| 215 | 1 MINE: 7 8 COM: 2 3 4 5 6 7 8 YOURS: 2 3 END 9 |
| 216 | } |
| 217 | |
| 218 | merge-test 30 { |
| 219 | 1 2 3 4 5 6 7 8 9 |
| 220 | } { |
| 221 | 1 2 3 4 5 6 7 9 |
| @@ -257,20 +257,20 @@ | |
| 257 | 1 2 3 4 9 |
| 258 | } { |
| 259 | 1 6 7 8 9 |
| 260 | } { |
| 261 | 1 MINE: 2 3 4 COM: 2 3 4 5 6 7 8 YOURS: 6 7 8 END 9 |
| 262 | } |
| 263 | merge-test 35 { |
| 264 | 1 2 3 4 5 6 7 8 9 |
| 265 | } { |
| 266 | 1 2 3 9 |
| 267 | } { |
| 268 | 1 7 8 9 |
| 269 | } { |
| 270 | 1 MINE: 2 3 COM: 2 3 4 5 6 7 8 YOURS: 7 8 END 9 |
| 271 | } |
| 272 | |
| 273 | merge-test 40 { |
| 274 | 2 3 4 5 6 7 8 |
| 275 | } { |
| 276 | 3 4 5 6 7 8 |
| @@ -312,20 +312,20 @@ | |
| 312 | 6 7 8 |
| 313 | } { |
| 314 | 2 3 4 |
| 315 | } { |
| 316 | MINE: 6 7 8 COM: 2 3 4 5 6 7 8 YOURS: 2 3 4 END |
| 317 | } |
| 318 | merge-test 45 { |
| 319 | 2 3 4 5 6 7 8 |
| 320 | } { |
| 321 | 7 8 |
| 322 | } { |
| 323 | 2 3 |
| 324 | } { |
| 325 | MINE: 7 8 COM: 2 3 4 5 6 7 8 YOURS: 2 3 END |
| 326 | } |
| 327 | |
| 328 | merge-test 50 { |
| 329 | 2 3 4 5 6 7 8 |
| 330 | } { |
| 331 | 2 3 4 5 6 7 |
| @@ -366,20 +366,20 @@ | |
| 366 | 2 3 4 |
| 367 | } { |
| 368 | 6 7 8 |
| 369 | } { |
| 370 | MINE: 2 3 4 COM: 2 3 4 5 6 7 8 YOURS: 6 7 8 END |
| 371 | } |
| 372 | merge-test 55 { |
| 373 | 2 3 4 5 6 7 8 |
| 374 | } { |
| 375 | 2 3 |
| 376 | } { |
| 377 | 7 8 |
| 378 | } { |
| 379 | MINE: 2 3 COM: 2 3 4 5 6 7 8 YOURS: 7 8 END |
| 380 | } |
| 381 | |
| 382 | merge-test 60 { |
| 383 | 1 2 3 4 5 6 7 8 9 |
| 384 | } { |
| 385 | 1 2b 3 4 5 6 7 8 9 |
| @@ -421,20 +421,20 @@ | |
| 421 | 1 2b 3b 4b 5b 6 7 8 9 |
| 422 | } { |
| 423 | 1 2 3 4 9 |
| 424 | } { |
| 425 | 1 MINE: 2b 3b 4b 5b 6 7 8 COM: 2 3 4 5 6 7 8 YOURS: 2 3 4 END 9 |
| 426 | } |
| 427 | merge-test 65 { |
| 428 | 1 2 3 4 5 6 7 8 9 |
| 429 | } { |
| 430 | 1 2b 3b 4b 5b 6b 7 8 9 |
| 431 | } { |
| 432 | 1 2 3 9 |
| 433 | } { |
| 434 | 1 MINE: 2b 3b 4b 5b 6b 7 8 COM: 2 3 4 5 6 7 8 YOURS: 2 3 END 9 |
| 435 | } |
| 436 | |
| 437 | merge-test 70 { |
| 438 | 1 2 3 4 5 6 7 8 9 |
| 439 | } { |
| 440 | 1 2 3 4 5 6 7 9 |
| @@ -476,20 +476,20 @@ | |
| 476 | 1 2 3 4 9 |
| 477 | } { |
| 478 | 1 2b 3b 4b 5b 6 7 8 9 |
| 479 | } { |
| 480 | 1 MINE: 2 3 4 COM: 2 3 4 5 6 7 8 YOURS: 2b 3b 4b 5b 6 7 8 END 9 |
| 481 | } |
| 482 | merge-test 75 { |
| 483 | 1 2 3 4 5 6 7 8 9 |
| 484 | } { |
| 485 | 1 2 3 9 |
| 486 | } { |
| 487 | 1 2b 3b 4b 5b 6b 7 8 9 |
| 488 | } { |
| 489 | 1 MINE: 2 3 COM: 2 3 4 5 6 7 8 YOURS: 2b 3b 4b 5b 6b 7 8 END 9 |
| 490 | } |
| 491 | |
| 492 | merge-test 80 { |
| 493 | 2 3 4 5 6 7 8 |
| 494 | } { |
| 495 | 2b 3 4 5 6 7 8 |
| @@ -531,20 +531,20 @@ | |
| 531 | 2b 3b 4b 5b 6 7 8 |
| 532 | } { |
| 533 | 2 3 4 |
| 534 | } { |
| 535 | MINE: 2b 3b 4b 5b 6 7 8 COM: 2 3 4 5 6 7 8 YOURS: 2 3 4 END |
| 536 | } |
| 537 | merge-test 85 { |
| 538 | 2 3 4 5 6 7 8 |
| 539 | } { |
| 540 | 2b 3b 4b 5b 6b 7 8 |
| 541 | } { |
| 542 | 2 3 |
| 543 | } { |
| 544 | MINE: 2b 3b 4b 5b 6b 7 8 COM: 2 3 4 5 6 7 8 YOURS: 2 3 END |
| 545 | } |
| 546 | |
| 547 | merge-test 90 { |
| 548 | 2 3 4 5 6 7 8 |
| 549 | } { |
| 550 | 2 3 4 5 6 7 |
| @@ -586,20 +586,20 @@ | |
| 586 | 2 3 4 |
| 587 | } { |
| 588 | 2b 3b 4b 5b 6 7 8 |
| 589 | } { |
| 590 | MINE: 2 3 4 COM: 2 3 4 5 6 7 8 YOURS: 2b 3b 4b 5b 6 7 8 END |
| 591 | } |
| 592 | merge-test 95 { |
| 593 | 2 3 4 5 6 7 8 |
| 594 | } { |
| 595 | 2 3 |
| 596 | } { |
| 597 | 2b 3b 4b 5b 6b 7 8 |
| 598 | } { |
| 599 | MINE: 2 3 COM: 2 3 4 5 6 7 8 YOURS: 2b 3b 4b 5b 6b 7 8 END |
| 600 | } |
| 601 | |
| 602 | merge-test 100 { |
| 603 | 1 2 3 4 5 6 7 8 9 |
| 604 | } { |
| 605 | 1 2b 3 4 5 7 8 9 a b c d e |
| @@ -632,19 +632,19 @@ | |
| 632 | 1 2 3 4 5 7 8 9b |
| 633 | } { |
| 634 | 1 2 3 4 5 7 8 9b a b c d e |
| 635 | } { |
| 636 | 1 2 3 4 5 7 8 MINE: 9b COM: 9 YOURS: 9b a b c d e END |
| 637 | } |
| 638 | merge-test 104 { |
| 639 | 1 2 3 4 5 6 7 8 9 |
| 640 | } { |
| 641 | 1 2 3 4 5 7 8 9b a b c d e |
| 642 | } { |
| 643 | 1 2 3 4 5 7 8 9b |
| 644 | } { |
| 645 | 1 2 3 4 5 7 8 MINE: 9b a b c d e COM: 9 YOURS: 9b END |
| 646 | } |
| 647 | |
| 648 | ############################################################################### |
| 649 | |
| 650 | test_cleanup |
| 651 |
| --- test/merge3.test | |
| +++ test/merge3.test | |
| @@ -18,15 +18,15 @@ | |
| 18 | # Tests of the 3-way merge |
| 19 | # |
| 20 | |
| 21 | test_setup "" |
| 22 | |
| 23 | proc merge-test {testid basis v1 v2 result {fossil_args ""}} { |
| 24 | write_file t1 [join [string trim $basis] \n]\n |
| 25 | write_file t2 [join [string trim $v1] \n]\n |
| 26 | write_file t3 [join [string trim $v2] \n]\n |
| 27 | fossil 3-way-merge t1 t2 t3 t4 {*}$fossil_args |
| 28 | set x [read_file t4] |
| 29 | regsub -all \ |
| 30 | {<<<<<<< BEGIN MERGE CONFLICT: local copy shown first <+ \(line \d+\)} \ |
| 31 | $x {MINE:} x |
| 32 | regsub -all \ |
| @@ -74,56 +74,56 @@ | |
| 74 | 1 2 3b 4b 5b 6 7 8 9 |
| 75 | } { |
| 76 | 1 2 3 4 5c 6 7 8 9 |
| 77 | } { |
| 78 | 1 2 MINE: 3b 4b 5b COM: 3 4 5 YOURS: 3 4 5c END 6 7 8 9 |
| 79 | } -expectError |
| 80 | merge-test 4 { |
| 81 | 1 2 3 4 5 6 7 8 9 |
| 82 | } { |
| 83 | 1 2 3b 4b 5b 6b 7 8 9 |
| 84 | } { |
| 85 | 1 2 3 4 5c 6 7 8 9 |
| 86 | } { |
| 87 | 1 2 MINE: 3b 4b 5b 6b COM: 3 4 5 6 YOURS: 3 4 5c 6 END 7 8 9 |
| 88 | } -expectError |
| 89 | merge-test 5 { |
| 90 | 1 2 3 4 5 6 7 8 9 |
| 91 | } { |
| 92 | 1 2 3b 4b 5b 6b 7 8 9 |
| 93 | } { |
| 94 | 1 2 3 4 5c 6c 7c 8 9 |
| 95 | } { |
| 96 | 1 2 MINE: 3b 4b 5b 6b 7 COM: 3 4 5 6 7 YOURS: 3 4 5c 6c 7c END 8 9 |
| 97 | } -expectError |
| 98 | merge-test 6 { |
| 99 | 1 2 3 4 5 6 7 8 9 |
| 100 | } { |
| 101 | 1 2 3b 4b 5b 6b 7 8b 9 |
| 102 | } { |
| 103 | 1 2 3 4 5c 6c 7c 8 9 |
| 104 | } { |
| 105 | 1 2 MINE: 3b 4b 5b 6b 7 COM: 3 4 5 6 7 YOURS: 3 4 5c 6c 7c END 8b 9 |
| 106 | } -expectError |
| 107 | merge-test 7 { |
| 108 | 1 2 3 4 5 6 7 8 9 |
| 109 | } { |
| 110 | 1 2 3b 4b 5b 6b 7 8b 9 |
| 111 | } { |
| 112 | 1 2 3 4 5c 6c 7c 8c 9 |
| 113 | } { |
| 114 | 1 2 MINE: 3b 4b 5b 6b 7 8b COM: 3 4 5 6 7 8 YOURS: 3 4 5c 6c 7c 8c END 9 |
| 115 | } -expectError |
| 116 | merge-test 8 { |
| 117 | 1 2 3 4 5 6 7 8 9 |
| 118 | } { |
| 119 | 1 2 3b 4b 5b 6b 7 8b 9b |
| 120 | } { |
| 121 | 1 2 3 4 5c 6c 7c 8c 9 |
| 122 | } { |
| 123 | 1 2 MINE: 3b 4b 5b 6b 7 8b 9b COM: 3 4 5 6 7 8 9 YOURS: 3 4 5c 6c 7c 8c 9 END |
| 124 | } -expectError |
| 125 | merge-test 9 { |
| 126 | 1 2 3 4 5 6 7 8 9 |
| 127 | } { |
| 128 | 1 2 3b 4b 5 6 7 8b 9b |
| 129 | } { |
| @@ -147,11 +147,11 @@ | |
| 147 | 1 2 3b 4b 5 6 7 8b 9b |
| 148 | } { |
| 149 | 1 2 3b 4c 5 6c 7c 8 9 |
| 150 | } { |
| 151 | 1 2 MINE: 3b 4b COM: 3 4 YOURS: 3b 4c END 5 6c 7c 8b 9b |
| 152 | } -expectError |
| 153 | merge-test 12 { |
| 154 | 1 2 3 4 5 6 7 8 9 |
| 155 | } { |
| 156 | 1 2 3b4b 5 6 7 8b 9b |
| 157 | } { |
| @@ -202,20 +202,20 @@ | |
| 202 | 1 6 7 8 9 |
| 203 | } { |
| 204 | 1 2 3 4 9 |
| 205 | } { |
| 206 | 1 MINE: 6 7 8 COM: 2 3 4 5 6 7 8 YOURS: 2 3 4 END 9 |
| 207 | } -expectError |
| 208 | merge-test 25 { |
| 209 | 1 2 3 4 5 6 7 8 9 |
| 210 | } { |
| 211 | 1 7 8 9 |
| 212 | } { |
| 213 | 1 2 3 9 |
| 214 | } { |
| 215 | 1 MINE: 7 8 COM: 2 3 4 5 6 7 8 YOURS: 2 3 END 9 |
| 216 | } -expectError |
| 217 | |
| 218 | merge-test 30 { |
| 219 | 1 2 3 4 5 6 7 8 9 |
| 220 | } { |
| 221 | 1 2 3 4 5 6 7 9 |
| @@ -257,20 +257,20 @@ | |
| 257 | 1 2 3 4 9 |
| 258 | } { |
| 259 | 1 6 7 8 9 |
| 260 | } { |
| 261 | 1 MINE: 2 3 4 COM: 2 3 4 5 6 7 8 YOURS: 6 7 8 END 9 |
| 262 | } -expectError |
| 263 | merge-test 35 { |
| 264 | 1 2 3 4 5 6 7 8 9 |
| 265 | } { |
| 266 | 1 2 3 9 |
| 267 | } { |
| 268 | 1 7 8 9 |
| 269 | } { |
| 270 | 1 MINE: 2 3 COM: 2 3 4 5 6 7 8 YOURS: 7 8 END 9 |
| 271 | } -expectError |
| 272 | |
| 273 | merge-test 40 { |
| 274 | 2 3 4 5 6 7 8 |
| 275 | } { |
| 276 | 3 4 5 6 7 8 |
| @@ -312,20 +312,20 @@ | |
| 312 | 6 7 8 |
| 313 | } { |
| 314 | 2 3 4 |
| 315 | } { |
| 316 | MINE: 6 7 8 COM: 2 3 4 5 6 7 8 YOURS: 2 3 4 END |
| 317 | } -expectError |
| 318 | merge-test 45 { |
| 319 | 2 3 4 5 6 7 8 |
| 320 | } { |
| 321 | 7 8 |
| 322 | } { |
| 323 | 2 3 |
| 324 | } { |
| 325 | MINE: 7 8 COM: 2 3 4 5 6 7 8 YOURS: 2 3 END |
| 326 | } -expectError |
| 327 | |
| 328 | merge-test 50 { |
| 329 | 2 3 4 5 6 7 8 |
| 330 | } { |
| 331 | 2 3 4 5 6 7 |
| @@ -366,20 +366,20 @@ | |
| 366 | 2 3 4 |
| 367 | } { |
| 368 | 6 7 8 |
| 369 | } { |
| 370 | MINE: 2 3 4 COM: 2 3 4 5 6 7 8 YOURS: 6 7 8 END |
| 371 | } -expectError |
| 372 | merge-test 55 { |
| 373 | 2 3 4 5 6 7 8 |
| 374 | } { |
| 375 | 2 3 |
| 376 | } { |
| 377 | 7 8 |
| 378 | } { |
| 379 | MINE: 2 3 COM: 2 3 4 5 6 7 8 YOURS: 7 8 END |
| 380 | } -expectError |
| 381 | |
| 382 | merge-test 60 { |
| 383 | 1 2 3 4 5 6 7 8 9 |
| 384 | } { |
| 385 | 1 2b 3 4 5 6 7 8 9 |
| @@ -421,20 +421,20 @@ | |
| 421 | 1 2b 3b 4b 5b 6 7 8 9 |
| 422 | } { |
| 423 | 1 2 3 4 9 |
| 424 | } { |
| 425 | 1 MINE: 2b 3b 4b 5b 6 7 8 COM: 2 3 4 5 6 7 8 YOURS: 2 3 4 END 9 |
| 426 | } -expectError |
| 427 | merge-test 65 { |
| 428 | 1 2 3 4 5 6 7 8 9 |
| 429 | } { |
| 430 | 1 2b 3b 4b 5b 6b 7 8 9 |
| 431 | } { |
| 432 | 1 2 3 9 |
| 433 | } { |
| 434 | 1 MINE: 2b 3b 4b 5b 6b 7 8 COM: 2 3 4 5 6 7 8 YOURS: 2 3 END 9 |
| 435 | } -expectError |
| 436 | |
| 437 | merge-test 70 { |
| 438 | 1 2 3 4 5 6 7 8 9 |
| 439 | } { |
| 440 | 1 2 3 4 5 6 7 9 |
| @@ -476,20 +476,20 @@ | |
| 476 | 1 2 3 4 9 |
| 477 | } { |
| 478 | 1 2b 3b 4b 5b 6 7 8 9 |
| 479 | } { |
| 480 | 1 MINE: 2 3 4 COM: 2 3 4 5 6 7 8 YOURS: 2b 3b 4b 5b 6 7 8 END 9 |
| 481 | } -expectError |
| 482 | merge-test 75 { |
| 483 | 1 2 3 4 5 6 7 8 9 |
| 484 | } { |
| 485 | 1 2 3 9 |
| 486 | } { |
| 487 | 1 2b 3b 4b 5b 6b 7 8 9 |
| 488 | } { |
| 489 | 1 MINE: 2 3 COM: 2 3 4 5 6 7 8 YOURS: 2b 3b 4b 5b 6b 7 8 END 9 |
| 490 | } -expectError |
| 491 | |
| 492 | merge-test 80 { |
| 493 | 2 3 4 5 6 7 8 |
| 494 | } { |
| 495 | 2b 3 4 5 6 7 8 |
| @@ -531,20 +531,20 @@ | |
| 531 | 2b 3b 4b 5b 6 7 8 |
| 532 | } { |
| 533 | 2 3 4 |
| 534 | } { |
| 535 | MINE: 2b 3b 4b 5b 6 7 8 COM: 2 3 4 5 6 7 8 YOURS: 2 3 4 END |
| 536 | } -expectError |
| 537 | merge-test 85 { |
| 538 | 2 3 4 5 6 7 8 |
| 539 | } { |
| 540 | 2b 3b 4b 5b 6b 7 8 |
| 541 | } { |
| 542 | 2 3 |
| 543 | } { |
| 544 | MINE: 2b 3b 4b 5b 6b 7 8 COM: 2 3 4 5 6 7 8 YOURS: 2 3 END |
| 545 | } -expectError |
| 546 | |
| 547 | merge-test 90 { |
| 548 | 2 3 4 5 6 7 8 |
| 549 | } { |
| 550 | 2 3 4 5 6 7 |
| @@ -586,20 +586,20 @@ | |
| 586 | 2 3 4 |
| 587 | } { |
| 588 | 2b 3b 4b 5b 6 7 8 |
| 589 | } { |
| 590 | MINE: 2 3 4 COM: 2 3 4 5 6 7 8 YOURS: 2b 3b 4b 5b 6 7 8 END |
| 591 | } -expectError |
| 592 | merge-test 95 { |
| 593 | 2 3 4 5 6 7 8 |
| 594 | } { |
| 595 | 2 3 |
| 596 | } { |
| 597 | 2b 3b 4b 5b 6b 7 8 |
| 598 | } { |
| 599 | MINE: 2 3 COM: 2 3 4 5 6 7 8 YOURS: 2b 3b 4b 5b 6b 7 8 END |
| 600 | } -expectError |
| 601 | |
| 602 | merge-test 100 { |
| 603 | 1 2 3 4 5 6 7 8 9 |
| 604 | } { |
| 605 | 1 2b 3 4 5 7 8 9 a b c d e |
| @@ -632,19 +632,19 @@ | |
| 632 | 1 2 3 4 5 7 8 9b |
| 633 | } { |
| 634 | 1 2 3 4 5 7 8 9b a b c d e |
| 635 | } { |
| 636 | 1 2 3 4 5 7 8 MINE: 9b COM: 9 YOURS: 9b a b c d e END |
| 637 | } -expectError |
| 638 | merge-test 104 { |
| 639 | 1 2 3 4 5 6 7 8 9 |
| 640 | } { |
| 641 | 1 2 3 4 5 7 8 9b a b c d e |
| 642 | } { |
| 643 | 1 2 3 4 5 7 8 9b |
| 644 | } { |
| 645 | 1 2 3 4 5 7 8 MINE: 9b a b c d e COM: 9 YOURS: 9b END |
| 646 | } -expectError |
| 647 | |
| 648 | ############################################################################### |
| 649 | |
| 650 | test_cleanup |
| 651 |
+5
-5
| --- test/merge4.test | ||
| +++ test/merge4.test | ||
| @@ -18,16 +18,16 @@ | ||
| 18 | 18 | # Tests of the 3-way merge |
| 19 | 19 | # |
| 20 | 20 | |
| 21 | 21 | test_setup "" |
| 22 | 22 | |
| 23 | -proc merge-test {testid basis v1 v2 result1 result2} { | |
| 23 | +proc merge-test {testid basis v1 v2 result1 result2 {fossil_args ""}} { | |
| 24 | 24 | write_file t1 [join [string trim $basis] \n]\n |
| 25 | 25 | write_file t2 [join [string trim $v1] \n]\n |
| 26 | 26 | write_file t3 [join [string trim $v2] \n]\n |
| 27 | - fossil 3-way-merge t1 t2 t3 t4 | |
| 28 | - fossil 3-way-merge t1 t3 t2 t5 | |
| 27 | + fossil 3-way-merge t1 t2 t3 t4 {*}$fossil_args | |
| 28 | + fossil 3-way-merge t1 t3 t2 t5 {*}$fossil_args | |
| 29 | 29 | set x [read_file t4] |
| 30 | 30 | regsub -all {<<<<<<< BEGIN MERGE CONFLICT.*<< \(line \d+\)} $x {>} x |
| 31 | 31 | regsub -all {\|\|\|\|\|\|\|.*======= \(line \d+\)} $x {=} x |
| 32 | 32 | regsub -all {>>>>>>> END MERGE CONFLICT.*>>>>} $x {<} x |
| 33 | 33 | set x [split [string trim $x] \n] |
| @@ -61,11 +61,11 @@ | ||
| 61 | 61 | 1 2 3 4c 5c 6c 7 8 9 |
| 62 | 62 | } { |
| 63 | 63 | 1 > 2b 3b 4b 5 6b 7b 8b = 2 3 4c 5c 6c 7 8 < 9 |
| 64 | 64 | } { |
| 65 | 65 | 1 > 2 3 4c 5c 6c 7 8 = 2b 3b 4b 5 6b 7b 8b < 9 |
| 66 | -} | |
| 66 | +} -expectError | |
| 67 | 67 | merge-test 1001 { |
| 68 | 68 | 1 2 3 4 5 6 7 8 9 |
| 69 | 69 | } { |
| 70 | 70 | 1 2b 3b 4 5 6 7b 8b 9 |
| 71 | 71 | } { |
| @@ -83,11 +83,11 @@ | ||
| 83 | 83 | 2 3 4c 5c 6c 7 8 |
| 84 | 84 | } { |
| 85 | 85 | > 2b 3b 4b 5 6b 7b 8b = 2 3 4c 5c 6c 7 8 < |
| 86 | 86 | } { |
| 87 | 87 | > 2 3 4c 5c 6c 7 8 = 2b 3b 4b 5 6b 7b 8b < |
| 88 | -} | |
| 88 | +} -expectError | |
| 89 | 89 | merge-test 1003 { |
| 90 | 90 | 2 3 4 5 6 7 8 |
| 91 | 91 | } { |
| 92 | 92 | 2b 3b 4 5 6 7b 8b |
| 93 | 93 | } { |
| 94 | 94 |
| --- test/merge4.test | |
| +++ test/merge4.test | |
| @@ -18,16 +18,16 @@ | |
| 18 | # Tests of the 3-way merge |
| 19 | # |
| 20 | |
| 21 | test_setup "" |
| 22 | |
| 23 | proc merge-test {testid basis v1 v2 result1 result2} { |
| 24 | write_file t1 [join [string trim $basis] \n]\n |
| 25 | write_file t2 [join [string trim $v1] \n]\n |
| 26 | write_file t3 [join [string trim $v2] \n]\n |
| 27 | fossil 3-way-merge t1 t2 t3 t4 |
| 28 | fossil 3-way-merge t1 t3 t2 t5 |
| 29 | set x [read_file t4] |
| 30 | regsub -all {<<<<<<< BEGIN MERGE CONFLICT.*<< \(line \d+\)} $x {>} x |
| 31 | regsub -all {\|\|\|\|\|\|\|.*======= \(line \d+\)} $x {=} x |
| 32 | regsub -all {>>>>>>> END MERGE CONFLICT.*>>>>} $x {<} x |
| 33 | set x [split [string trim $x] \n] |
| @@ -61,11 +61,11 @@ | |
| 61 | 1 2 3 4c 5c 6c 7 8 9 |
| 62 | } { |
| 63 | 1 > 2b 3b 4b 5 6b 7b 8b = 2 3 4c 5c 6c 7 8 < 9 |
| 64 | } { |
| 65 | 1 > 2 3 4c 5c 6c 7 8 = 2b 3b 4b 5 6b 7b 8b < 9 |
| 66 | } |
| 67 | merge-test 1001 { |
| 68 | 1 2 3 4 5 6 7 8 9 |
| 69 | } { |
| 70 | 1 2b 3b 4 5 6 7b 8b 9 |
| 71 | } { |
| @@ -83,11 +83,11 @@ | |
| 83 | 2 3 4c 5c 6c 7 8 |
| 84 | } { |
| 85 | > 2b 3b 4b 5 6b 7b 8b = 2 3 4c 5c 6c 7 8 < |
| 86 | } { |
| 87 | > 2 3 4c 5c 6c 7 8 = 2b 3b 4b 5 6b 7b 8b < |
| 88 | } |
| 89 | merge-test 1003 { |
| 90 | 2 3 4 5 6 7 8 |
| 91 | } { |
| 92 | 2b 3b 4 5 6 7b 8b |
| 93 | } { |
| 94 |
| --- test/merge4.test | |
| +++ test/merge4.test | |
| @@ -18,16 +18,16 @@ | |
| 18 | # Tests of the 3-way merge |
| 19 | # |
| 20 | |
| 21 | test_setup "" |
| 22 | |
| 23 | proc merge-test {testid basis v1 v2 result1 result2 {fossil_args ""}} { |
| 24 | write_file t1 [join [string trim $basis] \n]\n |
| 25 | write_file t2 [join [string trim $v1] \n]\n |
| 26 | write_file t3 [join [string trim $v2] \n]\n |
| 27 | fossil 3-way-merge t1 t2 t3 t4 {*}$fossil_args |
| 28 | fossil 3-way-merge t1 t3 t2 t5 {*}$fossil_args |
| 29 | set x [read_file t4] |
| 30 | regsub -all {<<<<<<< BEGIN MERGE CONFLICT.*<< \(line \d+\)} $x {>} x |
| 31 | regsub -all {\|\|\|\|\|\|\|.*======= \(line \d+\)} $x {=} x |
| 32 | regsub -all {>>>>>>> END MERGE CONFLICT.*>>>>} $x {<} x |
| 33 | set x [split [string trim $x] \n] |
| @@ -61,11 +61,11 @@ | |
| 61 | 1 2 3 4c 5c 6c 7 8 9 |
| 62 | } { |
| 63 | 1 > 2b 3b 4b 5 6b 7b 8b = 2 3 4c 5c 6c 7 8 < 9 |
| 64 | } { |
| 65 | 1 > 2 3 4c 5c 6c 7 8 = 2b 3b 4b 5 6b 7b 8b < 9 |
| 66 | } -expectError |
| 67 | merge-test 1001 { |
| 68 | 1 2 3 4 5 6 7 8 9 |
| 69 | } { |
| 70 | 1 2b 3b 4 5 6 7b 8b 9 |
| 71 | } { |
| @@ -83,11 +83,11 @@ | |
| 83 | 2 3 4c 5c 6c 7 8 |
| 84 | } { |
| 85 | > 2b 3b 4b 5 6b 7b 8b = 2 3 4c 5c 6c 7 8 < |
| 86 | } { |
| 87 | > 2 3 4c 5c 6c 7 8 = 2b 3b 4b 5 6b 7b 8b < |
| 88 | } -expectError |
| 89 | merge-test 1003 { |
| 90 | 2 3 4 5 6 7 8 |
| 91 | } { |
| 92 | 2b 3b 4 5 6 7b 8b |
| 93 | } { |
| 94 |
+3
-1
| --- test/merge5.test | ||
| +++ test/merge5.test | ||
| @@ -16,11 +16,13 @@ | ||
| 16 | 16 | ############################################################################ |
| 17 | 17 | # |
| 18 | 18 | # Tests of the "merge" command |
| 19 | 19 | # |
| 20 | 20 | |
| 21 | -puts "Skipping Merge5 tests" | |
| 21 | +if {! $::QUIET} { | |
| 22 | + puts "Skipping Merge5 tests" | |
| 23 | +} | |
| 22 | 24 | protOut { |
| 23 | 25 | fossil sqlite3 --no-repository reacts badly to SQL dumped from |
| 24 | 26 | repositories created from fossil older than version 2.0. |
| 25 | 27 | } |
| 26 | 28 | test merge5-sqlite3-issue false knownBug |
| 27 | 29 |
| --- test/merge5.test | |
| +++ test/merge5.test | |
| @@ -16,11 +16,13 @@ | |
| 16 | ############################################################################ |
| 17 | # |
| 18 | # Tests of the "merge" command |
| 19 | # |
| 20 | |
| 21 | puts "Skipping Merge5 tests" |
| 22 | protOut { |
| 23 | fossil sqlite3 --no-repository reacts badly to SQL dumped from |
| 24 | repositories created from fossil older than version 2.0. |
| 25 | } |
| 26 | test merge5-sqlite3-issue false knownBug |
| 27 |
| --- test/merge5.test | |
| +++ test/merge5.test | |
| @@ -16,11 +16,13 @@ | |
| 16 | ############################################################################ |
| 17 | # |
| 18 | # Tests of the "merge" command |
| 19 | # |
| 20 | |
| 21 | if {! $::QUIET} { |
| 22 | puts "Skipping Merge5 tests" |
| 23 | } |
| 24 | protOut { |
| 25 | fossil sqlite3 --no-repository reacts badly to SQL dumped from |
| 26 | repositories created from fossil older than version 2.0. |
| 27 | } |
| 28 | test merge5-sqlite3-issue false knownBug |
| 29 |
+3
-3
| --- test/merge_renames.test | ||
| +++ test/merge_renames.test | ||
| @@ -262,19 +262,19 @@ | ||
| 262 | 262 | fossil add f1 |
| 263 | 263 | fossil commit -b b2 -m "add f1" |
| 264 | 264 | |
| 265 | 265 | fossil update trunk |
| 266 | 266 | fossil merge b1 |
| 267 | -fossil merge b2 | |
| 267 | +fossil merge b2 -expectError | |
| 268 | 268 | test_status_list merge_renames-8-1 $RESULT { |
| 269 | 269 | MERGE f1 |
| 270 | 270 | WARNING: 1 merge conflicts |
| 271 | 271 | } |
| 272 | 272 | |
| 273 | 273 | fossil revert |
| 274 | 274 | fossil merge --integrate b1 |
| 275 | -fossil merge b2 | |
| 275 | +fossil merge b2 -expectError | |
| 276 | 276 | test_status_list merge_renames-8-2 $RESULT { |
| 277 | 277 | MERGE f1 |
| 278 | 278 | WARNING: 1 merge conflicts |
| 279 | 279 | } |
| 280 | 280 | |
| @@ -322,11 +322,11 @@ | ||
| 322 | 322 | fossil undo |
| 323 | 323 | test_status_list merge_renames-9-5 $RESULT { |
| 324 | 324 | UNDO f1 |
| 325 | 325 | UNDO f2 |
| 326 | 326 | } |
| 327 | -fossil merge -n b | |
| 327 | +fossil merge -n b -expectError | |
| 328 | 328 | test_status_list merge_renames-9-6 $RESULT " |
| 329 | 329 | $expectedMerge |
| 330 | 330 | REMINDER: this was a dry run - no files were actually changed. |
| 331 | 331 | " |
| 332 | 332 | test merge_renames-9-7 {[fossil changes] eq ""} |
| 333 | 333 |
| --- test/merge_renames.test | |
| +++ test/merge_renames.test | |
| @@ -262,19 +262,19 @@ | |
| 262 | fossil add f1 |
| 263 | fossil commit -b b2 -m "add f1" |
| 264 | |
| 265 | fossil update trunk |
| 266 | fossil merge b1 |
| 267 | fossil merge b2 |
| 268 | test_status_list merge_renames-8-1 $RESULT { |
| 269 | MERGE f1 |
| 270 | WARNING: 1 merge conflicts |
| 271 | } |
| 272 | |
| 273 | fossil revert |
| 274 | fossil merge --integrate b1 |
| 275 | fossil merge b2 |
| 276 | test_status_list merge_renames-8-2 $RESULT { |
| 277 | MERGE f1 |
| 278 | WARNING: 1 merge conflicts |
| 279 | } |
| 280 | |
| @@ -322,11 +322,11 @@ | |
| 322 | fossil undo |
| 323 | test_status_list merge_renames-9-5 $RESULT { |
| 324 | UNDO f1 |
| 325 | UNDO f2 |
| 326 | } |
| 327 | fossil merge -n b |
| 328 | test_status_list merge_renames-9-6 $RESULT " |
| 329 | $expectedMerge |
| 330 | REMINDER: this was a dry run - no files were actually changed. |
| 331 | " |
| 332 | test merge_renames-9-7 {[fossil changes] eq ""} |
| 333 |
| --- test/merge_renames.test | |
| +++ test/merge_renames.test | |
| @@ -262,19 +262,19 @@ | |
| 262 | fossil add f1 |
| 263 | fossil commit -b b2 -m "add f1" |
| 264 | |
| 265 | fossil update trunk |
| 266 | fossil merge b1 |
| 267 | fossil merge b2 -expectError |
| 268 | test_status_list merge_renames-8-1 $RESULT { |
| 269 | MERGE f1 |
| 270 | WARNING: 1 merge conflicts |
| 271 | } |
| 272 | |
| 273 | fossil revert |
| 274 | fossil merge --integrate b1 |
| 275 | fossil merge b2 -expectError |
| 276 | test_status_list merge_renames-8-2 $RESULT { |
| 277 | MERGE f1 |
| 278 | WARNING: 1 merge conflicts |
| 279 | } |
| 280 | |
| @@ -322,11 +322,11 @@ | |
| 322 | fossil undo |
| 323 | test_status_list merge_renames-9-5 $RESULT { |
| 324 | UNDO f1 |
| 325 | UNDO f2 |
| 326 | } |
| 327 | fossil merge -n b -expectError |
| 328 | test_status_list merge_renames-9-6 $RESULT " |
| 329 | $expectedMerge |
| 330 | REMINDER: this was a dry run - no files were actually changed. |
| 331 | " |
| 332 | test merge_renames-9-7 {[fossil changes] eq ""} |
| 333 |
+1
-1
| --- test/merge_warn.test | ||
| +++ test/merge_warn.test | ||
| @@ -40,11 +40,11 @@ | ||
| 40 | 40 | fossil commit -m "add f4" |
| 41 | 41 | |
| 42 | 42 | fossil update trunk |
| 43 | 43 | write_file f1 "f1.1" |
| 44 | 44 | write_file f3 "f3.1" |
| 45 | -fossil merge --integrate mrg | |
| 45 | +fossil merge --integrate mrg -expectError | |
| 46 | 46 | test_status_list merge_warn-1 $RESULT { |
| 47 | 47 | WARNING: 1 unmanaged files were overwritten |
| 48 | 48 | WARNING: 2 merge conflicts |
| 49 | 49 | DELETE f1 |
| 50 | 50 | MERGE f2 |
| 51 | 51 | |
| 52 | 52 | ADDED test/rewrite-test-output.tcl |
| --- test/merge_warn.test | |
| +++ test/merge_warn.test | |
| @@ -40,11 +40,11 @@ | |
| 40 | fossil commit -m "add f4" |
| 41 | |
| 42 | fossil update trunk |
| 43 | write_file f1 "f1.1" |
| 44 | write_file f3 "f3.1" |
| 45 | fossil merge --integrate mrg |
| 46 | test_status_list merge_warn-1 $RESULT { |
| 47 | WARNING: 1 unmanaged files were overwritten |
| 48 | WARNING: 2 merge conflicts |
| 49 | DELETE f1 |
| 50 | MERGE f2 |
| 51 | |
| 52 | DDED test/rewrite-test-output.tcl |
| --- test/merge_warn.test | |
| +++ test/merge_warn.test | |
| @@ -40,11 +40,11 @@ | |
| 40 | fossil commit -m "add f4" |
| 41 | |
| 42 | fossil update trunk |
| 43 | write_file f1 "f1.1" |
| 44 | write_file f3 "f3.1" |
| 45 | fossil merge --integrate mrg -expectError |
| 46 | test_status_list merge_warn-1 $RESULT { |
| 47 | WARNING: 1 unmanaged files were overwritten |
| 48 | WARNING: 2 merge conflicts |
| 49 | DELETE f1 |
| 50 | MERGE f2 |
| 51 | |
| 52 | DDED test/rewrite-test-output.tcl |
+645
| --- a/test/rewrite-test-output.tcl | ||
| +++ b/test/rewrite-test-output.tcl | ||
| @@ -0,0 +1,645 @@ | ||
| 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 | +} |
| --- a/test/rewrite-test-output.tcl | |
| +++ b/test/rewrite-test-output.tcl | |
| @@ -0,0 +1,645 @@ | |
| --- a/test/rewrite-test-output.tcl | |
| +++ b/test/rewrite-test-output.tcl | |
| @@ -0,0 +1,645 @@ | |
| 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 | } |
+5
-5
| --- test/set-manifest.test | ||
| +++ test/set-manifest.test | ||
| @@ -46,21 +46,21 @@ | ||
| 46 | 46 | #### Verify classic behavior of the manifest setting |
| 47 | 47 | |
| 48 | 48 | # Setting is off by default, and there are no extra files. |
| 49 | 49 | fossil settings manifest |
| 50 | 50 | test "set-manifest-1" {[regexp {^manifest *$} $RESULT]} |
| 51 | -set filelist [glob -nocomplain manifest*] | |
| 51 | +set filelist [lsort [glob -nocomplain manifest*]] | |
| 52 | 52 | test "set-manifest-1-n" {[llength $filelist] == 0} |
| 53 | 53 | |
| 54 | 54 | # Classic behavior: TRUE value creates manifest and manifest.uuid |
| 55 | 55 | set truths [list true on 1] |
| 56 | 56 | foreach v $truths { |
| 57 | 57 | fossil settings manifest $v |
| 58 | 58 | test "set-manifest-2-$v" {$RESULT eq ""} |
| 59 | 59 | fossil settings manifest |
| 60 | 60 | test "set-manifest-2-$v-a" {[regexp "^manifest\\s+\\(local\\)\\s+$v\\s*$" $RESULT]} |
| 61 | - set filelist [glob manifest*] | |
| 61 | + set filelist [lsort [glob manifest*]] | |
| 62 | 62 | test "set-manifest-2-$v-n" {[llength $filelist] == 2} |
| 63 | 63 | foreach f $filelist { |
| 64 | 64 | test "set-manifest-2-$v-f-$f" {[file isfile $f]} |
| 65 | 65 | } |
| 66 | 66 | } |
| @@ -88,21 +88,21 @@ | ||
| 88 | 88 | foreach v $falses { |
| 89 | 89 | fossil settings manifest $v |
| 90 | 90 | test "set-manifest-3-$v" {$RESULT eq ""} |
| 91 | 91 | fossil settings manifest |
| 92 | 92 | test "set-manifest-3-$v-a" {[regexp "^manifest\\s+\\(local\\)\\s+$v\\s*$" $RESULT]} |
| 93 | - set filelist [glob -nocomplain manifest*] | |
| 93 | + set filelist [lsort [glob -nocomplain manifest*]] | |
| 94 | 94 | test "set-manifest-3-$v-n" {[llength $filelist] == 0} |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | |
| 98 | 98 | # Classic behavior: unset removes manifest and manifest.uuid |
| 99 | 99 | fossil unset manifest |
| 100 | 100 | test "set-manifest-4" {$RESULT eq ""} |
| 101 | 101 | fossil settings manifest |
| 102 | 102 | test "set-manifest-4-a" {[regexp {^manifest *$} $RESULT]} |
| 103 | -set filelist [glob -nocomplain manifest*] | |
| 103 | +set filelist [lsort [glob -nocomplain manifest*]] | |
| 104 | 104 | test "set-manifest-4-n" {[llength $filelist] == 0} |
| 105 | 105 | |
| 106 | 106 | |
| 107 | 107 | ##### Tags Manifest feature extends the manifest setting |
| 108 | 108 | |
| @@ -112,11 +112,11 @@ | ||
| 112 | 112 | foreach v $truths { |
| 113 | 113 | fossil settings manifest $v |
| 114 | 114 | test "set-manifest-5-$v" {$RESULT eq ""} |
| 115 | 115 | fossil settings manifest |
| 116 | 116 | test "set-manifest-5-$v-a" {[regexp "^manifest\\s+\\(local\\)\\s+$v\\s*$" $RESULT]} |
| 117 | - set filelist [glob manifest*] | |
| 117 | + set filelist [lsort [glob manifest*]] | |
| 118 | 118 | test "set-manifest-5-$v-n" {[llength $filelist] == [string length $v]} |
| 119 | 119 | foreach f $filelist { |
| 120 | 120 | test "set-manifest-5-$v-f-$f" {[file isfile $f]} |
| 121 | 121 | } |
| 122 | 122 | } |
| 123 | 123 |
| --- test/set-manifest.test | |
| +++ test/set-manifest.test | |
| @@ -46,21 +46,21 @@ | |
| 46 | #### Verify classic behavior of the manifest setting |
| 47 | |
| 48 | # Setting is off by default, and there are no extra files. |
| 49 | fossil settings manifest |
| 50 | test "set-manifest-1" {[regexp {^manifest *$} $RESULT]} |
| 51 | set filelist [glob -nocomplain manifest*] |
| 52 | test "set-manifest-1-n" {[llength $filelist] == 0} |
| 53 | |
| 54 | # Classic behavior: TRUE value creates manifest and manifest.uuid |
| 55 | set truths [list true on 1] |
| 56 | foreach v $truths { |
| 57 | fossil settings manifest $v |
| 58 | test "set-manifest-2-$v" {$RESULT eq ""} |
| 59 | fossil settings manifest |
| 60 | test "set-manifest-2-$v-a" {[regexp "^manifest\\s+\\(local\\)\\s+$v\\s*$" $RESULT]} |
| 61 | set filelist [glob manifest*] |
| 62 | test "set-manifest-2-$v-n" {[llength $filelist] == 2} |
| 63 | foreach f $filelist { |
| 64 | test "set-manifest-2-$v-f-$f" {[file isfile $f]} |
| 65 | } |
| 66 | } |
| @@ -88,21 +88,21 @@ | |
| 88 | foreach v $falses { |
| 89 | fossil settings manifest $v |
| 90 | test "set-manifest-3-$v" {$RESULT eq ""} |
| 91 | fossil settings manifest |
| 92 | test "set-manifest-3-$v-a" {[regexp "^manifest\\s+\\(local\\)\\s+$v\\s*$" $RESULT]} |
| 93 | set filelist [glob -nocomplain manifest*] |
| 94 | test "set-manifest-3-$v-n" {[llength $filelist] == 0} |
| 95 | } |
| 96 | |
| 97 | |
| 98 | # Classic behavior: unset removes manifest and manifest.uuid |
| 99 | fossil unset manifest |
| 100 | test "set-manifest-4" {$RESULT eq ""} |
| 101 | fossil settings manifest |
| 102 | test "set-manifest-4-a" {[regexp {^manifest *$} $RESULT]} |
| 103 | set filelist [glob -nocomplain manifest*] |
| 104 | test "set-manifest-4-n" {[llength $filelist] == 0} |
| 105 | |
| 106 | |
| 107 | ##### Tags Manifest feature extends the manifest setting |
| 108 | |
| @@ -112,11 +112,11 @@ | |
| 112 | foreach v $truths { |
| 113 | fossil settings manifest $v |
| 114 | test "set-manifest-5-$v" {$RESULT eq ""} |
| 115 | fossil settings manifest |
| 116 | test "set-manifest-5-$v-a" {[regexp "^manifest\\s+\\(local\\)\\s+$v\\s*$" $RESULT]} |
| 117 | set filelist [glob manifest*] |
| 118 | test "set-manifest-5-$v-n" {[llength $filelist] == [string length $v]} |
| 119 | foreach f $filelist { |
| 120 | test "set-manifest-5-$v-f-$f" {[file isfile $f]} |
| 121 | } |
| 122 | } |
| 123 |
| --- test/set-manifest.test | |
| +++ test/set-manifest.test | |
| @@ -46,21 +46,21 @@ | |
| 46 | #### Verify classic behavior of the manifest setting |
| 47 | |
| 48 | # Setting is off by default, and there are no extra files. |
| 49 | fossil settings manifest |
| 50 | test "set-manifest-1" {[regexp {^manifest *$} $RESULT]} |
| 51 | set filelist [lsort [glob -nocomplain manifest*]] |
| 52 | test "set-manifest-1-n" {[llength $filelist] == 0} |
| 53 | |
| 54 | # Classic behavior: TRUE value creates manifest and manifest.uuid |
| 55 | set truths [list true on 1] |
| 56 | foreach v $truths { |
| 57 | fossil settings manifest $v |
| 58 | test "set-manifest-2-$v" {$RESULT eq ""} |
| 59 | fossil settings manifest |
| 60 | test "set-manifest-2-$v-a" {[regexp "^manifest\\s+\\(local\\)\\s+$v\\s*$" $RESULT]} |
| 61 | set filelist [lsort [glob manifest*]] |
| 62 | test "set-manifest-2-$v-n" {[llength $filelist] == 2} |
| 63 | foreach f $filelist { |
| 64 | test "set-manifest-2-$v-f-$f" {[file isfile $f]} |
| 65 | } |
| 66 | } |
| @@ -88,21 +88,21 @@ | |
| 88 | foreach v $falses { |
| 89 | fossil settings manifest $v |
| 90 | test "set-manifest-3-$v" {$RESULT eq ""} |
| 91 | fossil settings manifest |
| 92 | test "set-manifest-3-$v-a" {[regexp "^manifest\\s+\\(local\\)\\s+$v\\s*$" $RESULT]} |
| 93 | set filelist [lsort [glob -nocomplain manifest*]] |
| 94 | test "set-manifest-3-$v-n" {[llength $filelist] == 0} |
| 95 | } |
| 96 | |
| 97 | |
| 98 | # Classic behavior: unset removes manifest and manifest.uuid |
| 99 | fossil unset manifest |
| 100 | test "set-manifest-4" {$RESULT eq ""} |
| 101 | fossil settings manifest |
| 102 | test "set-manifest-4-a" {[regexp {^manifest *$} $RESULT]} |
| 103 | set filelist [lsort [glob -nocomplain manifest*]] |
| 104 | test "set-manifest-4-n" {[llength $filelist] == 0} |
| 105 | |
| 106 | |
| 107 | ##### Tags Manifest feature extends the manifest setting |
| 108 | |
| @@ -112,11 +112,11 @@ | |
| 112 | foreach v $truths { |
| 113 | fossil settings manifest $v |
| 114 | test "set-manifest-5-$v" {$RESULT eq ""} |
| 115 | fossil settings manifest |
| 116 | test "set-manifest-5-$v-a" {[regexp "^manifest\\s+\\(local\\)\\s+$v\\s*$" $RESULT]} |
| 117 | set filelist [lsort [glob manifest*]] |
| 118 | test "set-manifest-5-$v-n" {[llength $filelist] == [string length $v]} |
| 119 | foreach f $filelist { |
| 120 | test "set-manifest-5-$v-f-$f" {[file isfile $f]} |
| 121 | } |
| 122 | } |
| 123 |
+13
-9
| --- test/settings-repo.test | ||
| +++ test/settings-repo.test | ||
| @@ -40,11 +40,15 @@ | ||
| 40 | 40 | foreach name $all_settings { |
| 41 | 41 | # |
| 42 | 42 | # HACK: Make 100% sure that there are no non-default setting values |
| 43 | 43 | # present anywhere. |
| 44 | 44 | # |
| 45 | - fossil unset $name --exact --global | |
| 45 | + if {$name eq "manifest"} { | |
| 46 | + fossil unset $name --exact --global -expectError | |
| 47 | + } else { | |
| 48 | + fossil unset $name --exact --global | |
| 49 | + } | |
| 46 | 50 | fossil unset $name --exact |
| 47 | 51 | |
| 48 | 52 | # |
| 49 | 53 | # NOTE: Query for the hard-coded default value of this setting and |
| 50 | 54 | # save it. |
| @@ -53,62 +57,62 @@ | ||
| 53 | 57 | set defaults($name) [normalize_result] |
| 54 | 58 | } |
| 55 | 59 | |
| 56 | 60 | ############################################################################### |
| 57 | 61 | |
| 58 | -fossil settings bad-setting some_value | |
| 62 | +fossil settings bad-setting some_value -expectError | |
| 59 | 63 | |
| 60 | 64 | test settings-set-bad-local { |
| 61 | 65 | [normalize_result] eq "no such setting: bad-setting" |
| 62 | 66 | } |
| 63 | 67 | |
| 64 | -fossil settings bad-setting some_value --global | |
| 68 | +fossil settings bad-setting some_value --global -expectError | |
| 65 | 69 | |
| 66 | 70 | test settings-set-bad-global { |
| 67 | 71 | [normalize_result] eq "no such setting: bad-setting" |
| 68 | 72 | } |
| 69 | 73 | |
| 70 | 74 | ############################################################################### |
| 71 | 75 | |
| 72 | -fossil unset bad-setting | |
| 76 | +fossil unset bad-setting -expectError | |
| 73 | 77 | |
| 74 | 78 | test settings-unset-bad-local { |
| 75 | 79 | [normalize_result] eq "no such setting: bad-setting" |
| 76 | 80 | } |
| 77 | 81 | |
| 78 | -fossil unset bad-setting --global | |
| 82 | +fossil unset bad-setting --global -expectError | |
| 79 | 83 | |
| 80 | 84 | test settings-unset-bad-global { |
| 81 | 85 | [normalize_result] eq "no such setting: bad-setting" |
| 82 | 86 | } |
| 83 | 87 | |
| 84 | 88 | ############################################################################### |
| 85 | 89 | |
| 86 | -fossil settings ssl some_value | |
| 90 | +fossil settings ssl some_value -expectError | |
| 87 | 91 | |
| 88 | 92 | test settings-set-ambiguous-local { |
| 89 | 93 | [normalize_result] eq |
| 90 | 94 | "ambiguous setting \"ssl\" - might be: ssl-ca-location ssl-identity" |
| 91 | 95 | } |
| 92 | 96 | |
| 93 | -fossil settings ssl some_value --global | |
| 97 | +fossil settings ssl some_value --global -expectError | |
| 94 | 98 | |
| 95 | 99 | test settings-set-ambiguous-global { |
| 96 | 100 | [normalize_result] eq |
| 97 | 101 | "ambiguous setting \"ssl\" - might be: ssl-ca-location ssl-identity" |
| 98 | 102 | } |
| 99 | 103 | |
| 100 | 104 | ############################################################################### |
| 101 | 105 | |
| 102 | -fossil unset ssl | |
| 106 | +fossil unset ssl -expectError | |
| 103 | 107 | |
| 104 | 108 | test settings-unset-ambiguous-local { |
| 105 | 109 | [normalize_result] eq |
| 106 | 110 | "ambiguous setting \"ssl\" - might be: ssl-ca-location ssl-identity" |
| 107 | 111 | } |
| 108 | 112 | |
| 109 | -fossil unset ssl --global | |
| 113 | +fossil unset ssl --global -expectError | |
| 110 | 114 | |
| 111 | 115 | test settings-unset-ambiguous-global { |
| 112 | 116 | [normalize_result] eq |
| 113 | 117 | "ambiguous setting \"ssl\" - might be: ssl-ca-location ssl-identity" |
| 114 | 118 | } |
| 115 | 119 |
| --- test/settings-repo.test | |
| +++ test/settings-repo.test | |
| @@ -40,11 +40,15 @@ | |
| 40 | foreach name $all_settings { |
| 41 | # |
| 42 | # HACK: Make 100% sure that there are no non-default setting values |
| 43 | # present anywhere. |
| 44 | # |
| 45 | fossil unset $name --exact --global |
| 46 | fossil unset $name --exact |
| 47 | |
| 48 | # |
| 49 | # NOTE: Query for the hard-coded default value of this setting and |
| 50 | # save it. |
| @@ -53,62 +57,62 @@ | |
| 53 | set defaults($name) [normalize_result] |
| 54 | } |
| 55 | |
| 56 | ############################################################################### |
| 57 | |
| 58 | fossil settings bad-setting some_value |
| 59 | |
| 60 | test settings-set-bad-local { |
| 61 | [normalize_result] eq "no such setting: bad-setting" |
| 62 | } |
| 63 | |
| 64 | fossil settings bad-setting some_value --global |
| 65 | |
| 66 | test settings-set-bad-global { |
| 67 | [normalize_result] eq "no such setting: bad-setting" |
| 68 | } |
| 69 | |
| 70 | ############################################################################### |
| 71 | |
| 72 | fossil unset bad-setting |
| 73 | |
| 74 | test settings-unset-bad-local { |
| 75 | [normalize_result] eq "no such setting: bad-setting" |
| 76 | } |
| 77 | |
| 78 | fossil unset bad-setting --global |
| 79 | |
| 80 | test settings-unset-bad-global { |
| 81 | [normalize_result] eq "no such setting: bad-setting" |
| 82 | } |
| 83 | |
| 84 | ############################################################################### |
| 85 | |
| 86 | fossil settings ssl some_value |
| 87 | |
| 88 | test settings-set-ambiguous-local { |
| 89 | [normalize_result] eq |
| 90 | "ambiguous setting \"ssl\" - might be: ssl-ca-location ssl-identity" |
| 91 | } |
| 92 | |
| 93 | fossil settings ssl some_value --global |
| 94 | |
| 95 | test settings-set-ambiguous-global { |
| 96 | [normalize_result] eq |
| 97 | "ambiguous setting \"ssl\" - might be: ssl-ca-location ssl-identity" |
| 98 | } |
| 99 | |
| 100 | ############################################################################### |
| 101 | |
| 102 | fossil unset ssl |
| 103 | |
| 104 | test settings-unset-ambiguous-local { |
| 105 | [normalize_result] eq |
| 106 | "ambiguous setting \"ssl\" - might be: ssl-ca-location ssl-identity" |
| 107 | } |
| 108 | |
| 109 | fossil unset ssl --global |
| 110 | |
| 111 | test settings-unset-ambiguous-global { |
| 112 | [normalize_result] eq |
| 113 | "ambiguous setting \"ssl\" - might be: ssl-ca-location ssl-identity" |
| 114 | } |
| 115 |
| --- test/settings-repo.test | |
| +++ test/settings-repo.test | |
| @@ -40,11 +40,15 @@ | |
| 40 | foreach name $all_settings { |
| 41 | # |
| 42 | # HACK: Make 100% sure that there are no non-default setting values |
| 43 | # present anywhere. |
| 44 | # |
| 45 | if {$name eq "manifest"} { |
| 46 | fossil unset $name --exact --global -expectError |
| 47 | } else { |
| 48 | fossil unset $name --exact --global |
| 49 | } |
| 50 | fossil unset $name --exact |
| 51 | |
| 52 | # |
| 53 | # NOTE: Query for the hard-coded default value of this setting and |
| 54 | # save it. |
| @@ -53,62 +57,62 @@ | |
| 57 | set defaults($name) [normalize_result] |
| 58 | } |
| 59 | |
| 60 | ############################################################################### |
| 61 | |
| 62 | fossil settings bad-setting some_value -expectError |
| 63 | |
| 64 | test settings-set-bad-local { |
| 65 | [normalize_result] eq "no such setting: bad-setting" |
| 66 | } |
| 67 | |
| 68 | fossil settings bad-setting some_value --global -expectError |
| 69 | |
| 70 | test settings-set-bad-global { |
| 71 | [normalize_result] eq "no such setting: bad-setting" |
| 72 | } |
| 73 | |
| 74 | ############################################################################### |
| 75 | |
| 76 | fossil unset bad-setting -expectError |
| 77 | |
| 78 | test settings-unset-bad-local { |
| 79 | [normalize_result] eq "no such setting: bad-setting" |
| 80 | } |
| 81 | |
| 82 | fossil unset bad-setting --global -expectError |
| 83 | |
| 84 | test settings-unset-bad-global { |
| 85 | [normalize_result] eq "no such setting: bad-setting" |
| 86 | } |
| 87 | |
| 88 | ############################################################################### |
| 89 | |
| 90 | fossil settings ssl some_value -expectError |
| 91 | |
| 92 | test settings-set-ambiguous-local { |
| 93 | [normalize_result] eq |
| 94 | "ambiguous setting \"ssl\" - might be: ssl-ca-location ssl-identity" |
| 95 | } |
| 96 | |
| 97 | fossil settings ssl some_value --global -expectError |
| 98 | |
| 99 | test settings-set-ambiguous-global { |
| 100 | [normalize_result] eq |
| 101 | "ambiguous setting \"ssl\" - might be: ssl-ca-location ssl-identity" |
| 102 | } |
| 103 | |
| 104 | ############################################################################### |
| 105 | |
| 106 | fossil unset ssl -expectError |
| 107 | |
| 108 | test settings-unset-ambiguous-local { |
| 109 | [normalize_result] eq |
| 110 | "ambiguous setting \"ssl\" - might be: ssl-ca-location ssl-identity" |
| 111 | } |
| 112 | |
| 113 | fossil unset ssl --global -expectError |
| 114 | |
| 115 | test settings-unset-ambiguous-global { |
| 116 | [normalize_result] eq |
| 117 | "ambiguous setting \"ssl\" - might be: ssl-ca-location ssl-identity" |
| 118 | } |
| 119 |
+7
-3
| --- test/settings.test | ||
| +++ test/settings.test | ||
| @@ -92,11 +92,15 @@ | ||
| 92 | 92 | test settings-query-local-$name { |
| 93 | 93 | [regexp -- [string map [list %name% $name] $pattern(1)] $data] || |
| 94 | 94 | [regexp -- [string map [list %name% $name] $pattern(2)] $data] |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | - fossil settings $name --exact --global | |
| 97 | + if {$name eq "manifest"} { | |
| 98 | + fossil settings $name --exact --global -expectError | |
| 99 | + } else { | |
| 100 | + fossil settings $name --exact --global | |
| 101 | + } | |
| 98 | 102 | set data [normalize_result] |
| 99 | 103 | |
| 100 | 104 | if {$name eq "manifest"} { |
| 101 | 105 | test settings-query-global-$name { |
| 102 | 106 | $data eq "cannot set 'manifest' globally" |
| @@ -109,20 +113,20 @@ | ||
| 109 | 113 | } |
| 110 | 114 | } |
| 111 | 115 | |
| 112 | 116 | ############################################################################### |
| 113 | 117 | |
| 114 | -fossil settings bad-setting | |
| 118 | +fossil settings bad-setting -expectError | |
| 115 | 119 | |
| 116 | 120 | test settings-query-bad-local { |
| 117 | 121 | [normalize_result] eq "no such setting: bad-setting" |
| 118 | 122 | } |
| 119 | 123 | |
| 120 | -fossil settings bad-setting --global | |
| 124 | +fossil settings bad-setting --global -expectError | |
| 121 | 125 | |
| 122 | 126 | test settings-query-bad-global { |
| 123 | 127 | [normalize_result] eq "no such setting: bad-setting" |
| 124 | 128 | } |
| 125 | 129 | |
| 126 | 130 | ############################################################################### |
| 127 | 131 | |
| 128 | 132 | test_cleanup |
| 129 | 133 |
| --- test/settings.test | |
| +++ test/settings.test | |
| @@ -92,11 +92,15 @@ | |
| 92 | test settings-query-local-$name { |
| 93 | [regexp -- [string map [list %name% $name] $pattern(1)] $data] || |
| 94 | [regexp -- [string map [list %name% $name] $pattern(2)] $data] |
| 95 | } |
| 96 | |
| 97 | fossil settings $name --exact --global |
| 98 | set data [normalize_result] |
| 99 | |
| 100 | if {$name eq "manifest"} { |
| 101 | test settings-query-global-$name { |
| 102 | $data eq "cannot set 'manifest' globally" |
| @@ -109,20 +113,20 @@ | |
| 109 | } |
| 110 | } |
| 111 | |
| 112 | ############################################################################### |
| 113 | |
| 114 | fossil settings bad-setting |
| 115 | |
| 116 | test settings-query-bad-local { |
| 117 | [normalize_result] eq "no such setting: bad-setting" |
| 118 | } |
| 119 | |
| 120 | fossil settings bad-setting --global |
| 121 | |
| 122 | test settings-query-bad-global { |
| 123 | [normalize_result] eq "no such setting: bad-setting" |
| 124 | } |
| 125 | |
| 126 | ############################################################################### |
| 127 | |
| 128 | test_cleanup |
| 129 |
| --- test/settings.test | |
| +++ test/settings.test | |
| @@ -92,11 +92,15 @@ | |
| 92 | test settings-query-local-$name { |
| 93 | [regexp -- [string map [list %name% $name] $pattern(1)] $data] || |
| 94 | [regexp -- [string map [list %name% $name] $pattern(2)] $data] |
| 95 | } |
| 96 | |
| 97 | if {$name eq "manifest"} { |
| 98 | fossil settings $name --exact --global -expectError |
| 99 | } else { |
| 100 | fossil settings $name --exact --global |
| 101 | } |
| 102 | set data [normalize_result] |
| 103 | |
| 104 | if {$name eq "manifest"} { |
| 105 | test settings-query-global-$name { |
| 106 | $data eq "cannot set 'manifest' globally" |
| @@ -109,20 +113,20 @@ | |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | ############################################################################### |
| 117 | |
| 118 | fossil settings bad-setting -expectError |
| 119 | |
| 120 | test settings-query-bad-local { |
| 121 | [normalize_result] eq "no such setting: bad-setting" |
| 122 | } |
| 123 | |
| 124 | fossil settings bad-setting --global -expectError |
| 125 | |
| 126 | test settings-query-bad-global { |
| 127 | [normalize_result] eq "no such setting: bad-setting" |
| 128 | } |
| 129 | |
| 130 | ############################################################################### |
| 131 | |
| 132 | test_cleanup |
| 133 |
+1
-1
| --- test/stash.test | ||
| +++ test/stash.test | ||
| @@ -206,11 +206,11 @@ | ||
| 206 | 206 | # fossil: ./src/delta.c:231: checksum: Assertion '...' failed. |
| 207 | 207 | # Should be triggered by this stash-WY-1 test. |
| 208 | 208 | fossil checkout --force c1 |
| 209 | 209 | fossil clean |
| 210 | 210 | fossil mv --soft f1 f1new |
| 211 | -stash-test WY-1 {save -m "Reported 2016-02-09"} { | |
| 211 | +stash-test WY-1 {-expectError save -m "Reported 2016-02-09"} { | |
| 212 | 212 | REVERT f1 |
| 213 | 213 | DELETE f1new |
| 214 | 214 | } -changes { |
| 215 | 215 | } -addremove { |
| 216 | 216 | } -exists {f1 f2 f3} -notexists {f1new} -knownbugs {-code -result} |
| 217 | 217 |
| --- test/stash.test | |
| +++ test/stash.test | |
| @@ -206,11 +206,11 @@ | |
| 206 | # fossil: ./src/delta.c:231: checksum: Assertion '...' failed. |
| 207 | # Should be triggered by this stash-WY-1 test. |
| 208 | fossil checkout --force c1 |
| 209 | fossil clean |
| 210 | fossil mv --soft f1 f1new |
| 211 | stash-test WY-1 {save -m "Reported 2016-02-09"} { |
| 212 | REVERT f1 |
| 213 | DELETE f1new |
| 214 | } -changes { |
| 215 | } -addremove { |
| 216 | } -exists {f1 f2 f3} -notexists {f1new} -knownbugs {-code -result} |
| 217 |
| --- test/stash.test | |
| +++ test/stash.test | |
| @@ -206,11 +206,11 @@ | |
| 206 | # fossil: ./src/delta.c:231: checksum: Assertion '...' failed. |
| 207 | # Should be triggered by this stash-WY-1 test. |
| 208 | fossil checkout --force c1 |
| 209 | fossil clean |
| 210 | fossil mv --soft f1 f1new |
| 211 | stash-test WY-1 {-expectError save -m "Reported 2016-02-09"} { |
| 212 | REVERT f1 |
| 213 | DELETE f1new |
| 214 | } -changes { |
| 215 | } -addremove { |
| 216 | } -exists {f1 f2 f3} -notexists {f1new} -knownbugs {-code -result} |
| 217 |
+1
-11
| --- test/symlinks.test | ||
| +++ test/symlinks.test | ||
| @@ -23,17 +23,10 @@ | ||
| 23 | 23 | if {$is_windows} { |
| 24 | 24 | puts "Symlinks are not supported on Windows." |
| 25 | 25 | test_cleanup_then_return |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | -fossil test-th-eval --open-config "setting allow-symlinks" | |
| 29 | - | |
| 30 | -if {![string is true -strict [normalize_result]]} { | |
| 31 | - puts "Symlinks are not enabled." | |
| 32 | - test_cleanup_then_return | |
| 33 | -} | |
| 34 | - | |
| 35 | 28 | require_no_open_checkout |
| 36 | 29 | |
| 37 | 30 | ############################################################################### |
| 38 | 31 | |
| 39 | 32 | test_setup; set rootDir [file normalize [pwd]] |
| @@ -68,11 +61,11 @@ | ||
| 68 | 61 | |
| 69 | 62 | fossil add [file join $rootDir symdirA f1.txt] |
| 70 | 63 | test symlinks-skip-dir-traversal {[normalize_result] eq \ |
| 71 | 64 | "SKIP symdirA/f1.txt"} |
| 72 | 65 | |
| 73 | -fossil commit -m "c1" | |
| 66 | +fossil commit -m "c1" -expectError | |
| 74 | 67 | |
| 75 | 68 | test symlinks-empty-commit {[normalize_result] eq \ |
| 76 | 69 | "nothing has changed; use --allow-empty to override"} |
| 77 | 70 | |
| 78 | 71 | ############################################################################### |
| @@ -80,13 +73,10 @@ | ||
| 80 | 73 | fossil ls |
| 81 | 74 | test symlinks-dir-5 {[normalize_result] eq ""} |
| 82 | 75 | |
| 83 | 76 | ############################################################################### |
| 84 | 77 | |
| 85 | -fossil set allow | |
| 86 | -puts $RESULT | |
| 87 | - | |
| 88 | 78 | fossil extras |
| 89 | 79 | test symlinks-dir-6 {[normalize_result] eq \ |
| 90 | 80 | "subdirA/f1.txt\nsubdirA/f2.txt\nsymdirA"} |
| 91 | 81 | |
| 92 | 82 | ############################################################################### |
| 93 | 83 |
| --- test/symlinks.test | |
| +++ test/symlinks.test | |
| @@ -23,17 +23,10 @@ | |
| 23 | if {$is_windows} { |
| 24 | puts "Symlinks are not supported on Windows." |
| 25 | test_cleanup_then_return |
| 26 | } |
| 27 | |
| 28 | fossil test-th-eval --open-config "setting allow-symlinks" |
| 29 | |
| 30 | if {![string is true -strict [normalize_result]]} { |
| 31 | puts "Symlinks are not enabled." |
| 32 | test_cleanup_then_return |
| 33 | } |
| 34 | |
| 35 | require_no_open_checkout |
| 36 | |
| 37 | ############################################################################### |
| 38 | |
| 39 | test_setup; set rootDir [file normalize [pwd]] |
| @@ -68,11 +61,11 @@ | |
| 68 | |
| 69 | fossil add [file join $rootDir symdirA f1.txt] |
| 70 | test symlinks-skip-dir-traversal {[normalize_result] eq \ |
| 71 | "SKIP symdirA/f1.txt"} |
| 72 | |
| 73 | fossil commit -m "c1" |
| 74 | |
| 75 | test symlinks-empty-commit {[normalize_result] eq \ |
| 76 | "nothing has changed; use --allow-empty to override"} |
| 77 | |
| 78 | ############################################################################### |
| @@ -80,13 +73,10 @@ | |
| 80 | fossil ls |
| 81 | test symlinks-dir-5 {[normalize_result] eq ""} |
| 82 | |
| 83 | ############################################################################### |
| 84 | |
| 85 | fossil set allow |
| 86 | puts $RESULT |
| 87 | |
| 88 | fossil extras |
| 89 | test symlinks-dir-6 {[normalize_result] eq \ |
| 90 | "subdirA/f1.txt\nsubdirA/f2.txt\nsymdirA"} |
| 91 | |
| 92 | ############################################################################### |
| 93 |
| --- test/symlinks.test | |
| +++ test/symlinks.test | |
| @@ -23,17 +23,10 @@ | |
| 23 | if {$is_windows} { |
| 24 | puts "Symlinks are not supported on Windows." |
| 25 | test_cleanup_then_return |
| 26 | } |
| 27 | |
| 28 | require_no_open_checkout |
| 29 | |
| 30 | ############################################################################### |
| 31 | |
| 32 | test_setup; set rootDir [file normalize [pwd]] |
| @@ -68,11 +61,11 @@ | |
| 61 | |
| 62 | fossil add [file join $rootDir symdirA f1.txt] |
| 63 | test symlinks-skip-dir-traversal {[normalize_result] eq \ |
| 64 | "SKIP symdirA/f1.txt"} |
| 65 | |
| 66 | fossil commit -m "c1" -expectError |
| 67 | |
| 68 | test symlinks-empty-commit {[normalize_result] eq \ |
| 69 | "nothing has changed; use --allow-empty to override"} |
| 70 | |
| 71 | ############################################################################### |
| @@ -80,13 +73,10 @@ | |
| 73 | fossil ls |
| 74 | test symlinks-dir-5 {[normalize_result] eq ""} |
| 75 | |
| 76 | ############################################################################### |
| 77 | |
| 78 | fossil extras |
| 79 | test symlinks-dir-6 {[normalize_result] eq \ |
| 80 | "subdirA/f1.txt\nsubdirA/f2.txt\nsymdirA"} |
| 81 | |
| 82 | ############################################################################### |
| 83 |
+26
-3
| --- test/tester.tcl | ||
| +++ test/tester.tcl | ||
| @@ -35,10 +35,11 @@ | ||
| 35 | 35 | set testfiledir [file normalize [file dirname [info script]]] |
| 36 | 36 | set testrundir [pwd] |
| 37 | 37 | set testdir [file normalize [file dirname $argv0]] |
| 38 | 38 | set fossilexe [file normalize [lindex $argv 0]] |
| 39 | 39 | set is_windows [expr {$::tcl_platform(platform) eq "windows"}] |
| 40 | +set is_cygwin [regexp {^CYGWIN} $::tcl_platform(os)] | |
| 40 | 41 | |
| 41 | 42 | if {$::is_windows} { |
| 42 | 43 | if {[string length [file extension $fossilexe]] == 0} { |
| 43 | 44 | append fossilexe .exe |
| 44 | 45 | } |
| @@ -447,10 +448,12 @@ | ||
| 447 | 448 | $::env(FOSSIL_TEST_DANGEROUS_IGNORE_OPEN_CHECKOUT) eq "YES_DO_IT"} { |
| 448 | 449 | return |
| 449 | 450 | } |
| 450 | 451 | catch {exec $::fossilexe info} res |
| 451 | 452 | if {[regexp {local-root:} $res]} { |
| 453 | + global skipped_tests testfile | |
| 454 | + lappend skipped_tests $testfile | |
| 452 | 455 | set projectName <unknown> |
| 453 | 456 | set localRoot <unknown> |
| 454 | 457 | regexp -line -- {^project-name: (.*)$} $res dummy projectName |
| 455 | 458 | set projectName [string trim $projectName] |
| 456 | 459 | regexp -line -- {^local-root: (.*)$} $res dummy localRoot |
| @@ -484,16 +487,22 @@ | ||
| 484 | 487 | } |
| 485 | 488 | error "Could not delete \"$path\", error: $error" |
| 486 | 489 | } |
| 487 | 490 | |
| 488 | 491 | proc test_cleanup_then_return {} { |
| 492 | + global skipped_tests testfile | |
| 493 | + lappend skipped_tests $testfile | |
| 489 | 494 | uplevel 1 [list test_cleanup] |
| 490 | 495 | return -code return |
| 491 | 496 | } |
| 492 | 497 | |
| 493 | 498 | proc test_cleanup {} { |
| 494 | - if {$::KEEP} {return}; # All cleanup disabled? | |
| 499 | + if {$::KEEP} { | |
| 500 | + # To avoid errors with require_no_open_checkout, cd out of here. | |
| 501 | + if {[info exists ::tempSavedPwd]} {cd $::tempSavedPwd; unset ::tempSavedPwd} | |
| 502 | + return | |
| 503 | + } | |
| 495 | 504 | if {![info exists ::tempRepoPath]} {return} |
| 496 | 505 | if {![file exists $::tempRepoPath]} {return} |
| 497 | 506 | if {![file isdirectory $::tempRepoPath]} {return} |
| 498 | 507 | set tempPathEnd [expr {[string length $::tempPath] - 1}] |
| 499 | 508 | if {[string length $::tempPath] == 0 || \ |
| @@ -518,11 +527,11 @@ | ||
| 518 | 527 | if {![info exists ::tempKeepHome]} {delete_temporary_home} |
| 519 | 528 | } |
| 520 | 529 | |
| 521 | 530 | proc delete_temporary_home {} { |
| 522 | 531 | if {$::KEEP} {return}; # All cleanup disabled? |
| 523 | - if {$::is_windows} { | |
| 532 | + if {$::is_windows || $::is_cygwin} { | |
| 524 | 533 | robust_delete [file join $::tempHomePath _fossil] |
| 525 | 534 | } else { |
| 526 | 535 | robust_delete [file join $::tempHomePath .fossil] |
| 527 | 536 | } |
| 528 | 537 | robust_delete $::tempHomePath |
| @@ -845,10 +854,11 @@ | ||
| 845 | 854 | } |
| 846 | 855 | } |
| 847 | 856 | } |
| 848 | 857 | set bad_test {} |
| 849 | 858 | set ignored_test {} |
| 859 | +set skipped_tests {} | |
| 850 | 860 | |
| 851 | 861 | # Return a random string N characters long. |
| 852 | 862 | # |
| 853 | 863 | set vocabulary 01234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" |
| 854 | 864 | append vocabulary " ()*^!.eeeeeeeeaaaaattiioo " |
| @@ -1009,11 +1019,11 @@ | ||
| 1009 | 1019 | set data [subst [read_file $dataFileName]] |
| 1010 | 1020 | |
| 1011 | 1021 | write_file $inFileName $data |
| 1012 | 1022 | |
| 1013 | 1023 | fossil http --in $inFileName --out $outFileName --ipaddr 127.0.0.1 \ |
| 1014 | - $repository --localauth --th-trace | |
| 1024 | + $repository --localauth --th-trace -expectError | |
| 1015 | 1025 | |
| 1016 | 1026 | set result [expr {[file exists $outFileName] ? [read_file $outFileName] : ""}] |
| 1017 | 1027 | |
| 1018 | 1028 | if {1} { |
| 1019 | 1029 | catch {file delete $inFileName} |
| @@ -1105,10 +1115,15 @@ | ||
| 1105 | 1115 | } |
| 1106 | 1116 | |
| 1107 | 1117 | |
| 1108 | 1118 | protInit $fossilexe |
| 1109 | 1119 | set ::tempKeepHome 1 |
| 1120 | + | |
| 1121 | +# Start in tempHomePath to help avoid errors with require_no_open_checkout | |
| 1122 | +set startPwd [pwd] | |
| 1123 | +cd $tempHomePath | |
| 1124 | + | |
| 1110 | 1125 | foreach testfile $argv { |
| 1111 | 1126 | protOut "***** $testfile ******" |
| 1112 | 1127 | if { [catch {source $testdir/$testfile.test} testerror testopts] } { |
| 1113 | 1128 | test test-framework-$testfile 0 |
| 1114 | 1129 | protOut "!!!!! $testfile: $testerror" |
| @@ -1116,10 +1131,11 @@ | ||
| 1116 | 1131 | } else { |
| 1117 | 1132 | test test-framework-$testfile 1 |
| 1118 | 1133 | } |
| 1119 | 1134 | protOut "***** End of $testfile: [llength $bad_test] errors so far ******" |
| 1120 | 1135 | } |
| 1136 | +cd $startPwd | |
| 1121 | 1137 | unset ::tempKeepHome; delete_temporary_home |
| 1122 | 1138 | |
| 1123 | 1139 | # Clean up the file descriptor |
| 1124 | 1140 | close $possibly_fd0 |
| 1125 | 1141 | |
| @@ -1134,6 +1150,13 @@ | ||
| 1134 | 1150 | if {$nErr>0 || !$::QUIET} { |
| 1135 | 1151 | protOut "***** Ignored results: $nErr ignored errors out of $test_count tests" 1 |
| 1136 | 1152 | } |
| 1137 | 1153 | if {$nErr>0} { |
| 1138 | 1154 | protOut "***** Ignored failures: $ignored_test" 1 |
| 1155 | +} | |
| 1156 | +set nSkipped [llength $skipped_tests] | |
| 1157 | +if {$nSkipped>0} { | |
| 1158 | + protOut "***** Skipped tests: $skipped_tests" 1 | |
| 1159 | +} | |
| 1160 | +if {$bad_test>0} { | |
| 1161 | + exit 1 | |
| 1139 | 1162 | } |
| 1140 | 1163 |
| --- test/tester.tcl | |
| +++ test/tester.tcl | |
| @@ -35,10 +35,11 @@ | |
| 35 | set testfiledir [file normalize [file dirname [info script]]] |
| 36 | set testrundir [pwd] |
| 37 | set testdir [file normalize [file dirname $argv0]] |
| 38 | set fossilexe [file normalize [lindex $argv 0]] |
| 39 | set is_windows [expr {$::tcl_platform(platform) eq "windows"}] |
| 40 | |
| 41 | if {$::is_windows} { |
| 42 | if {[string length [file extension $fossilexe]] == 0} { |
| 43 | append fossilexe .exe |
| 44 | } |
| @@ -447,10 +448,12 @@ | |
| 447 | $::env(FOSSIL_TEST_DANGEROUS_IGNORE_OPEN_CHECKOUT) eq "YES_DO_IT"} { |
| 448 | return |
| 449 | } |
| 450 | catch {exec $::fossilexe info} res |
| 451 | if {[regexp {local-root:} $res]} { |
| 452 | set projectName <unknown> |
| 453 | set localRoot <unknown> |
| 454 | regexp -line -- {^project-name: (.*)$} $res dummy projectName |
| 455 | set projectName [string trim $projectName] |
| 456 | regexp -line -- {^local-root: (.*)$} $res dummy localRoot |
| @@ -484,16 +487,22 @@ | |
| 484 | } |
| 485 | error "Could not delete \"$path\", error: $error" |
| 486 | } |
| 487 | |
| 488 | proc test_cleanup_then_return {} { |
| 489 | uplevel 1 [list test_cleanup] |
| 490 | return -code return |
| 491 | } |
| 492 | |
| 493 | proc test_cleanup {} { |
| 494 | if {$::KEEP} {return}; # All cleanup disabled? |
| 495 | if {![info exists ::tempRepoPath]} {return} |
| 496 | if {![file exists $::tempRepoPath]} {return} |
| 497 | if {![file isdirectory $::tempRepoPath]} {return} |
| 498 | set tempPathEnd [expr {[string length $::tempPath] - 1}] |
| 499 | if {[string length $::tempPath] == 0 || \ |
| @@ -518,11 +527,11 @@ | |
| 518 | if {![info exists ::tempKeepHome]} {delete_temporary_home} |
| 519 | } |
| 520 | |
| 521 | proc delete_temporary_home {} { |
| 522 | if {$::KEEP} {return}; # All cleanup disabled? |
| 523 | if {$::is_windows} { |
| 524 | robust_delete [file join $::tempHomePath _fossil] |
| 525 | } else { |
| 526 | robust_delete [file join $::tempHomePath .fossil] |
| 527 | } |
| 528 | robust_delete $::tempHomePath |
| @@ -845,10 +854,11 @@ | |
| 845 | } |
| 846 | } |
| 847 | } |
| 848 | set bad_test {} |
| 849 | set ignored_test {} |
| 850 | |
| 851 | # Return a random string N characters long. |
| 852 | # |
| 853 | set vocabulary 01234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" |
| 854 | append vocabulary " ()*^!.eeeeeeeeaaaaattiioo " |
| @@ -1009,11 +1019,11 @@ | |
| 1009 | set data [subst [read_file $dataFileName]] |
| 1010 | |
| 1011 | write_file $inFileName $data |
| 1012 | |
| 1013 | fossil http --in $inFileName --out $outFileName --ipaddr 127.0.0.1 \ |
| 1014 | $repository --localauth --th-trace |
| 1015 | |
| 1016 | set result [expr {[file exists $outFileName] ? [read_file $outFileName] : ""}] |
| 1017 | |
| 1018 | if {1} { |
| 1019 | catch {file delete $inFileName} |
| @@ -1105,10 +1115,15 @@ | |
| 1105 | } |
| 1106 | |
| 1107 | |
| 1108 | protInit $fossilexe |
| 1109 | set ::tempKeepHome 1 |
| 1110 | foreach testfile $argv { |
| 1111 | protOut "***** $testfile ******" |
| 1112 | if { [catch {source $testdir/$testfile.test} testerror testopts] } { |
| 1113 | test test-framework-$testfile 0 |
| 1114 | protOut "!!!!! $testfile: $testerror" |
| @@ -1116,10 +1131,11 @@ | |
| 1116 | } else { |
| 1117 | test test-framework-$testfile 1 |
| 1118 | } |
| 1119 | protOut "***** End of $testfile: [llength $bad_test] errors so far ******" |
| 1120 | } |
| 1121 | unset ::tempKeepHome; delete_temporary_home |
| 1122 | |
| 1123 | # Clean up the file descriptor |
| 1124 | close $possibly_fd0 |
| 1125 | |
| @@ -1134,6 +1150,13 @@ | |
| 1134 | if {$nErr>0 || !$::QUIET} { |
| 1135 | protOut "***** Ignored results: $nErr ignored errors out of $test_count tests" 1 |
| 1136 | } |
| 1137 | if {$nErr>0} { |
| 1138 | protOut "***** Ignored failures: $ignored_test" 1 |
| 1139 | } |
| 1140 |
| --- test/tester.tcl | |
| +++ test/tester.tcl | |
| @@ -35,10 +35,11 @@ | |
| 35 | set testfiledir [file normalize [file dirname [info script]]] |
| 36 | set testrundir [pwd] |
| 37 | set testdir [file normalize [file dirname $argv0]] |
| 38 | set fossilexe [file normalize [lindex $argv 0]] |
| 39 | set is_windows [expr {$::tcl_platform(platform) eq "windows"}] |
| 40 | set is_cygwin [regexp {^CYGWIN} $::tcl_platform(os)] |
| 41 | |
| 42 | if {$::is_windows} { |
| 43 | if {[string length [file extension $fossilexe]] == 0} { |
| 44 | append fossilexe .exe |
| 45 | } |
| @@ -447,10 +448,12 @@ | |
| 448 | $::env(FOSSIL_TEST_DANGEROUS_IGNORE_OPEN_CHECKOUT) eq "YES_DO_IT"} { |
| 449 | return |
| 450 | } |
| 451 | catch {exec $::fossilexe info} res |
| 452 | if {[regexp {local-root:} $res]} { |
| 453 | global skipped_tests testfile |
| 454 | lappend skipped_tests $testfile |
| 455 | set projectName <unknown> |
| 456 | set localRoot <unknown> |
| 457 | regexp -line -- {^project-name: (.*)$} $res dummy projectName |
| 458 | set projectName [string trim $projectName] |
| 459 | regexp -line -- {^local-root: (.*)$} $res dummy localRoot |
| @@ -484,16 +487,22 @@ | |
| 487 | } |
| 488 | error "Could not delete \"$path\", error: $error" |
| 489 | } |
| 490 | |
| 491 | proc test_cleanup_then_return {} { |
| 492 | global skipped_tests testfile |
| 493 | lappend skipped_tests $testfile |
| 494 | uplevel 1 [list test_cleanup] |
| 495 | return -code return |
| 496 | } |
| 497 | |
| 498 | proc test_cleanup {} { |
| 499 | if {$::KEEP} { |
| 500 | # To avoid errors with require_no_open_checkout, cd out of here. |
| 501 | if {[info exists ::tempSavedPwd]} {cd $::tempSavedPwd; unset ::tempSavedPwd} |
| 502 | return |
| 503 | } |
| 504 | if {![info exists ::tempRepoPath]} {return} |
| 505 | if {![file exists $::tempRepoPath]} {return} |
| 506 | if {![file isdirectory $::tempRepoPath]} {return} |
| 507 | set tempPathEnd [expr {[string length $::tempPath] - 1}] |
| 508 | if {[string length $::tempPath] == 0 || \ |
| @@ -518,11 +527,11 @@ | |
| 527 | if {![info exists ::tempKeepHome]} {delete_temporary_home} |
| 528 | } |
| 529 | |
| 530 | proc delete_temporary_home {} { |
| 531 | if {$::KEEP} {return}; # All cleanup disabled? |
| 532 | if {$::is_windows || $::is_cygwin} { |
| 533 | robust_delete [file join $::tempHomePath _fossil] |
| 534 | } else { |
| 535 | robust_delete [file join $::tempHomePath .fossil] |
| 536 | } |
| 537 | robust_delete $::tempHomePath |
| @@ -845,10 +854,11 @@ | |
| 854 | } |
| 855 | } |
| 856 | } |
| 857 | set bad_test {} |
| 858 | set ignored_test {} |
| 859 | set skipped_tests {} |
| 860 | |
| 861 | # Return a random string N characters long. |
| 862 | # |
| 863 | set vocabulary 01234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" |
| 864 | append vocabulary " ()*^!.eeeeeeeeaaaaattiioo " |
| @@ -1009,11 +1019,11 @@ | |
| 1019 | set data [subst [read_file $dataFileName]] |
| 1020 | |
| 1021 | write_file $inFileName $data |
| 1022 | |
| 1023 | fossil http --in $inFileName --out $outFileName --ipaddr 127.0.0.1 \ |
| 1024 | $repository --localauth --th-trace -expectError |
| 1025 | |
| 1026 | set result [expr {[file exists $outFileName] ? [read_file $outFileName] : ""}] |
| 1027 | |
| 1028 | if {1} { |
| 1029 | catch {file delete $inFileName} |
| @@ -1105,10 +1115,15 @@ | |
| 1115 | } |
| 1116 | |
| 1117 | |
| 1118 | protInit $fossilexe |
| 1119 | set ::tempKeepHome 1 |
| 1120 | |
| 1121 | # Start in tempHomePath to help avoid errors with require_no_open_checkout |
| 1122 | set startPwd [pwd] |
| 1123 | cd $tempHomePath |
| 1124 | |
| 1125 | foreach testfile $argv { |
| 1126 | protOut "***** $testfile ******" |
| 1127 | if { [catch {source $testdir/$testfile.test} testerror testopts] } { |
| 1128 | test test-framework-$testfile 0 |
| 1129 | protOut "!!!!! $testfile: $testerror" |
| @@ -1116,10 +1131,11 @@ | |
| 1131 | } else { |
| 1132 | test test-framework-$testfile 1 |
| 1133 | } |
| 1134 | protOut "***** End of $testfile: [llength $bad_test] errors so far ******" |
| 1135 | } |
| 1136 | cd $startPwd |
| 1137 | unset ::tempKeepHome; delete_temporary_home |
| 1138 | |
| 1139 | # Clean up the file descriptor |
| 1140 | close $possibly_fd0 |
| 1141 | |
| @@ -1134,6 +1150,13 @@ | |
| 1150 | if {$nErr>0 || !$::QUIET} { |
| 1151 | protOut "***** Ignored results: $nErr ignored errors out of $test_count tests" 1 |
| 1152 | } |
| 1153 | if {$nErr>0} { |
| 1154 | protOut "***** Ignored failures: $ignored_test" 1 |
| 1155 | } |
| 1156 | set nSkipped [llength $skipped_tests] |
| 1157 | if {$nSkipped>0} { |
| 1158 | protOut "***** Skipped tests: $skipped_tests" 1 |
| 1159 | } |
| 1160 | if {$bad_test>0} { |
| 1161 | exit 1 |
| 1162 | } |
| 1163 |
+14
-17
| --- test/th1-docs.test | ||
| +++ test/th1-docs.test | ||
| @@ -30,49 +30,46 @@ | ||
| 30 | 30 | if {[normalize_result] ne "1"} { |
| 31 | 31 | puts "Fossil was not compiled with Tcl support." |
| 32 | 32 | test_cleanup_then_return |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | -if {$::outside_fossil_repo} { | |
| 36 | - puts "Skipping th1-docs-* tests: not in Fossil repo checkout." | |
| 37 | - test_cleanup_then_return | |
| 38 | -} elseif ($::dirty_ckout) { | |
| 39 | - puts "Skipping th1-docs-* tests: uncommitted changes in Fossil checkout." | |
| 40 | - test_cleanup_then_return | |
| 41 | -} | |
| 42 | - | |
| 43 | 35 | ############################################################################### |
| 44 | 36 | |
| 45 | -test_setup "" | |
| 37 | +test_setup | |
| 46 | 38 | |
| 47 | 39 | ############################################################################### |
| 48 | 40 | |
| 49 | 41 | set env(TH1_ENABLE_DOCS) 1; # TH1 docs must be enabled for this test. |
| 50 | 42 | set env(TH1_ENABLE_TCL) 1; # Tcl integration must be enabled for this test. |
| 51 | 43 | |
| 52 | 44 | ############################################################################### |
| 53 | 45 | |
| 54 | -run_in_checkout { | |
| 55 | - set data [fossil info] | |
| 56 | -} | |
| 46 | +set data [fossil info] | |
| 57 | 47 | |
| 58 | 48 | regexp -line -- {^repository: (.*)$} $data dummy repository |
| 59 | 49 | |
| 60 | 50 | if {[string length $repository] == 0 || ![file exists $repository]} { |
| 61 | 51 | error "unable to locate repository" |
| 62 | 52 | } |
| 63 | 53 | |
| 64 | 54 | set dataFileName [file join $::testdir th1-docs-input.txt] |
| 55 | +set origFileStat [file join $::testdir fileStat.th1] | |
| 56 | + | |
| 57 | +if {![file exists $origFileStat]} { | |
| 58 | + error "unable to locate [$origFileStat]" | |
| 59 | +} | |
| 60 | + | |
| 61 | +file copy $origFileStat fileStat.th1 | |
| 62 | +fossil add fileStat.th1 | |
| 63 | +fossil commit -m "Add fileStat.th1" | |
| 65 | 64 | |
| 66 | 65 | ############################################################################### |
| 67 | 66 | |
| 68 | -run_in_checkout { | |
| 69 | - set RESULT [test_fossil_http \ | |
| 70 | - $repository $dataFileName /doc/trunk/test/fileStat.th1] | |
| 71 | -} | |
| 67 | +set RESULT [test_fossil_http \ | |
| 68 | + $repository $dataFileName /doc/trunk/fileStat.th1] | |
| 72 | 69 | |
| 73 | -test th1-docs-1a {[regexp {<title>Fossil: test/fileStat.th1</title>} $RESULT]} | |
| 70 | +test th1-docs-1a {[regexp {<title>Unnamed Fossil Project: fileStat.th1</title>} $RESULT]} | |
| 74 | 71 | test th1-docs-1b {[regexp {>\[[0-9a-f]{40,64}\]<} $RESULT]} |
| 75 | 72 | test th1-docs-1c {[regexp { contains \d+ files\.} $RESULT]} |
| 76 | 73 | |
| 77 | 74 | ############################################################################### |
| 78 | 75 | |
| 79 | 76 |
| --- test/th1-docs.test | |
| +++ test/th1-docs.test | |
| @@ -30,49 +30,46 @@ | |
| 30 | if {[normalize_result] ne "1"} { |
| 31 | puts "Fossil was not compiled with Tcl support." |
| 32 | test_cleanup_then_return |
| 33 | } |
| 34 | |
| 35 | if {$::outside_fossil_repo} { |
| 36 | puts "Skipping th1-docs-* tests: not in Fossil repo checkout." |
| 37 | test_cleanup_then_return |
| 38 | } elseif ($::dirty_ckout) { |
| 39 | puts "Skipping th1-docs-* tests: uncommitted changes in Fossil checkout." |
| 40 | test_cleanup_then_return |
| 41 | } |
| 42 | |
| 43 | ############################################################################### |
| 44 | |
| 45 | test_setup "" |
| 46 | |
| 47 | ############################################################################### |
| 48 | |
| 49 | set env(TH1_ENABLE_DOCS) 1; # TH1 docs must be enabled for this test. |
| 50 | set env(TH1_ENABLE_TCL) 1; # Tcl integration must be enabled for this test. |
| 51 | |
| 52 | ############################################################################### |
| 53 | |
| 54 | run_in_checkout { |
| 55 | set data [fossil info] |
| 56 | } |
| 57 | |
| 58 | regexp -line -- {^repository: (.*)$} $data dummy repository |
| 59 | |
| 60 | if {[string length $repository] == 0 || ![file exists $repository]} { |
| 61 | error "unable to locate repository" |
| 62 | } |
| 63 | |
| 64 | set dataFileName [file join $::testdir th1-docs-input.txt] |
| 65 | |
| 66 | ############################################################################### |
| 67 | |
| 68 | run_in_checkout { |
| 69 | set RESULT [test_fossil_http \ |
| 70 | $repository $dataFileName /doc/trunk/test/fileStat.th1] |
| 71 | } |
| 72 | |
| 73 | test th1-docs-1a {[regexp {<title>Fossil: test/fileStat.th1</title>} $RESULT]} |
| 74 | test th1-docs-1b {[regexp {>\[[0-9a-f]{40,64}\]<} $RESULT]} |
| 75 | test th1-docs-1c {[regexp { contains \d+ files\.} $RESULT]} |
| 76 | |
| 77 | ############################################################################### |
| 78 | |
| 79 |
| --- test/th1-docs.test | |
| +++ test/th1-docs.test | |
| @@ -30,49 +30,46 @@ | |
| 30 | if {[normalize_result] ne "1"} { |
| 31 | puts "Fossil was not compiled with Tcl support." |
| 32 | test_cleanup_then_return |
| 33 | } |
| 34 | |
| 35 | ############################################################################### |
| 36 | |
| 37 | test_setup |
| 38 | |
| 39 | ############################################################################### |
| 40 | |
| 41 | set env(TH1_ENABLE_DOCS) 1; # TH1 docs must be enabled for this test. |
| 42 | set env(TH1_ENABLE_TCL) 1; # Tcl integration must be enabled for this test. |
| 43 | |
| 44 | ############################################################################### |
| 45 | |
| 46 | set data [fossil info] |
| 47 | |
| 48 | regexp -line -- {^repository: (.*)$} $data dummy repository |
| 49 | |
| 50 | if {[string length $repository] == 0 || ![file exists $repository]} { |
| 51 | error "unable to locate repository" |
| 52 | } |
| 53 | |
| 54 | set dataFileName [file join $::testdir th1-docs-input.txt] |
| 55 | set origFileStat [file join $::testdir fileStat.th1] |
| 56 | |
| 57 | if {![file exists $origFileStat]} { |
| 58 | error "unable to locate [$origFileStat]" |
| 59 | } |
| 60 | |
| 61 | file copy $origFileStat fileStat.th1 |
| 62 | fossil add fileStat.th1 |
| 63 | fossil commit -m "Add fileStat.th1" |
| 64 | |
| 65 | ############################################################################### |
| 66 | |
| 67 | set RESULT [test_fossil_http \ |
| 68 | $repository $dataFileName /doc/trunk/fileStat.th1] |
| 69 | |
| 70 | test th1-docs-1a {[regexp {<title>Unnamed Fossil Project: fileStat.th1</title>} $RESULT]} |
| 71 | test th1-docs-1b {[regexp {>\[[0-9a-f]{40,64}\]<} $RESULT]} |
| 72 | test th1-docs-1c {[regexp { contains \d+ files\.} $RESULT]} |
| 73 | |
| 74 | ############################################################################### |
| 75 | |
| 76 |
+2
-2
| --- test/th1-hooks.test | ||
| +++ test/th1-hooks.test | ||
| @@ -146,11 +146,11 @@ | ||
| 146 | 146 | +++ some stuff here +++ |
| 147 | 147 | <h1><b>command_hook timeline command_notify timeline</b></h1>}} |
| 148 | 148 | |
| 149 | 149 | ############################################################################### |
| 150 | 150 | |
| 151 | -fossil timeline custom3; # NOTE: Bad "WHEN" argument. | |
| 151 | +fossil timeline custom3 -expectError; # NOTE: Bad "WHEN" argument. | |
| 152 | 152 | |
| 153 | 153 | test th1-cmd-hooks-1c {[normalize_result] eq \ |
| 154 | 154 | {<h1><b>command_hook timeline</b></h1> |
| 155 | 155 | unknown check-in or invalid date: custom3}} |
| 156 | 156 | |
| @@ -196,11 +196,11 @@ | ||
| 196 | 196 | test th1-custom-cmd-3a {[string trim $RESULT] eq \ |
| 197 | 197 | {<h1><b>command_hook test3</b></h1>}} |
| 198 | 198 | |
| 199 | 199 | ############################################################################### |
| 200 | 200 | |
| 201 | -fossil test4 | |
| 201 | +fossil test4 -expectError | |
| 202 | 202 | |
| 203 | 203 | test th1-custom-cmd-4a {[first_data_line] eq \ |
| 204 | 204 | {<h1><b>command_hook test4</b></h1>}} |
| 205 | 205 | |
| 206 | 206 | test th1-custom-cmd-4b {[regexp -- \ |
| 207 | 207 |
| --- test/th1-hooks.test | |
| +++ test/th1-hooks.test | |
| @@ -146,11 +146,11 @@ | |
| 146 | +++ some stuff here +++ |
| 147 | <h1><b>command_hook timeline command_notify timeline</b></h1>}} |
| 148 | |
| 149 | ############################################################################### |
| 150 | |
| 151 | fossil timeline custom3; # NOTE: Bad "WHEN" argument. |
| 152 | |
| 153 | test th1-cmd-hooks-1c {[normalize_result] eq \ |
| 154 | {<h1><b>command_hook timeline</b></h1> |
| 155 | unknown check-in or invalid date: custom3}} |
| 156 | |
| @@ -196,11 +196,11 @@ | |
| 196 | test th1-custom-cmd-3a {[string trim $RESULT] eq \ |
| 197 | {<h1><b>command_hook test3</b></h1>}} |
| 198 | |
| 199 | ############################################################################### |
| 200 | |
| 201 | fossil test4 |
| 202 | |
| 203 | test th1-custom-cmd-4a {[first_data_line] eq \ |
| 204 | {<h1><b>command_hook test4</b></h1>}} |
| 205 | |
| 206 | test th1-custom-cmd-4b {[regexp -- \ |
| 207 |
| --- test/th1-hooks.test | |
| +++ test/th1-hooks.test | |
| @@ -146,11 +146,11 @@ | |
| 146 | +++ some stuff here +++ |
| 147 | <h1><b>command_hook timeline command_notify timeline</b></h1>}} |
| 148 | |
| 149 | ############################################################################### |
| 150 | |
| 151 | fossil timeline custom3 -expectError; # NOTE: Bad "WHEN" argument. |
| 152 | |
| 153 | test th1-cmd-hooks-1c {[normalize_result] eq \ |
| 154 | {<h1><b>command_hook timeline</b></h1> |
| 155 | unknown check-in or invalid date: custom3}} |
| 156 | |
| @@ -196,11 +196,11 @@ | |
| 196 | test th1-custom-cmd-3a {[string trim $RESULT] eq \ |
| 197 | {<h1><b>command_hook test3</b></h1>}} |
| 198 | |
| 199 | ############################################################################### |
| 200 | |
| 201 | fossil test4 -expectError |
| 202 | |
| 203 | test th1-custom-cmd-4a {[first_data_line] eq \ |
| 204 | {<h1><b>command_hook test4</b></h1>}} |
| 205 | |
| 206 | test th1-custom-cmd-4b {[regexp -- \ |
| 207 |
+8
-1
| --- test/th1-tcl.test | ||
| +++ test/th1-tcl.test | ||
| @@ -129,11 +129,18 @@ | ||
| 129 | 129 | ############################################################################### |
| 130 | 130 | |
| 131 | 131 | fossil test-th-render --open-config \ |
| 132 | 132 | [file nativename [file join $path th1-tcl9.txt]] |
| 133 | 133 | |
| 134 | -test th1-tcl-9 {[string trim $RESULT] eq [list [file tail $fossilexe] 3 \ | |
| 134 | +# Under cygwin, the printed name with Usage: strips the extension | |
| 135 | +if { $::is_cygwin && [file extension $fossilexe] eq ".exe" } { | |
| 136 | + set fossilexeref [string range $fossilexe 0 end-4] | |
| 137 | +} else { | |
| 138 | + set fossilexeref $fossilexe | |
| 139 | +} | |
| 140 | + | |
| 141 | +test th1-tcl-9 {[string trim $RESULT] eq [list [file tail $fossilexeref] 3 \ | |
| 135 | 142 | [list test-th-render --open-config [file nativename [file join $path \ |
| 136 | 143 | th1-tcl9.txt]]]]} |
| 137 | 144 | |
| 138 | 145 | ############################################################################### |
| 139 | 146 | |
| 140 | 147 |
| --- test/th1-tcl.test | |
| +++ test/th1-tcl.test | |
| @@ -129,11 +129,18 @@ | |
| 129 | ############################################################################### |
| 130 | |
| 131 | fossil test-th-render --open-config \ |
| 132 | [file nativename [file join $path th1-tcl9.txt]] |
| 133 | |
| 134 | test th1-tcl-9 {[string trim $RESULT] eq [list [file tail $fossilexe] 3 \ |
| 135 | [list test-th-render --open-config [file nativename [file join $path \ |
| 136 | th1-tcl9.txt]]]]} |
| 137 | |
| 138 | ############################################################################### |
| 139 | |
| 140 |
| --- test/th1-tcl.test | |
| +++ test/th1-tcl.test | |
| @@ -129,11 +129,18 @@ | |
| 129 | ############################################################################### |
| 130 | |
| 131 | fossil test-th-render --open-config \ |
| 132 | [file nativename [file join $path th1-tcl9.txt]] |
| 133 | |
| 134 | # Under cygwin, the printed name with Usage: strips the extension |
| 135 | if { $::is_cygwin && [file extension $fossilexe] eq ".exe" } { |
| 136 | set fossilexeref [string range $fossilexe 0 end-4] |
| 137 | } else { |
| 138 | set fossilexeref $fossilexe |
| 139 | } |
| 140 | |
| 141 | test th1-tcl-9 {[string trim $RESULT] eq [list [file tail $fossilexeref] 3 \ |
| 142 | [list test-th-render --open-config [file nativename [file join $path \ |
| 143 | th1-tcl9.txt]]]]} |
| 144 | |
| 145 | ############################################################################### |
| 146 | |
| 147 |
+3
-3
| --- test/th1.test | ||
| +++ test/th1.test | ||
| @@ -730,11 +730,11 @@ | ||
| 730 | 730 | fossil test-th-eval "trace {}" |
| 731 | 731 | test th1-trace-1 {$RESULT eq {}} |
| 732 | 732 | |
| 733 | 733 | ############################################################################### |
| 734 | 734 | |
| 735 | -fossil test-th-eval --th-trace "trace {}" | |
| 735 | +fossil test-th-eval --th-trace "trace {}" -expectError | |
| 736 | 736 | set normalized_result [normalize_result] |
| 737 | 737 | |
| 738 | 738 | regsub -- {\n/\*\*\*\*\* Subprocess \d+ exit\(\d+\) \*\*\*\*\*/} \ |
| 739 | 739 | $normalized_result {} normalized_result |
| 740 | 740 | |
| @@ -758,11 +758,11 @@ | ||
| 758 | 758 | fossil test-th-eval "trace {this is a trace message.}" |
| 759 | 759 | test th1-trace-3 {$RESULT eq {}} |
| 760 | 760 | |
| 761 | 761 | ############################################################################### |
| 762 | 762 | |
| 763 | -fossil test-th-eval --th-trace "trace {this is a trace message.}" | |
| 763 | +fossil test-th-eval --th-trace "trace {this is a trace message.}" -expectError | |
| 764 | 764 | set normalized_result [normalize_result] |
| 765 | 765 | |
| 766 | 766 | regsub -- {\n/\*\*\*\*\* Subprocess \d+ exit\(\d+\) \*\*\*\*\*/} \ |
| 767 | 767 | $normalized_result {} normalized_result |
| 768 | 768 | |
| @@ -1023,11 +1023,11 @@ | ||
| 1023 | 1023 | fossil test-th-eval "globalState vfs" |
| 1024 | 1024 | test th1-globalState-14 {[string length $RESULT] == 0} |
| 1025 | 1025 | |
| 1026 | 1026 | ############################################################################### |
| 1027 | 1027 | |
| 1028 | -if {$is_windows} { | |
| 1028 | +if {$is_windows || $is_cygwin} { | |
| 1029 | 1029 | set altVfs win32-longpath |
| 1030 | 1030 | } else { |
| 1031 | 1031 | set altVfs unix-dotfile |
| 1032 | 1032 | } |
| 1033 | 1033 | |
| 1034 | 1034 |
| --- test/th1.test | |
| +++ test/th1.test | |
| @@ -730,11 +730,11 @@ | |
| 730 | fossil test-th-eval "trace {}" |
| 731 | test th1-trace-1 {$RESULT eq {}} |
| 732 | |
| 733 | ############################################################################### |
| 734 | |
| 735 | fossil test-th-eval --th-trace "trace {}" |
| 736 | set normalized_result [normalize_result] |
| 737 | |
| 738 | regsub -- {\n/\*\*\*\*\* Subprocess \d+ exit\(\d+\) \*\*\*\*\*/} \ |
| 739 | $normalized_result {} normalized_result |
| 740 | |
| @@ -758,11 +758,11 @@ | |
| 758 | fossil test-th-eval "trace {this is a trace message.}" |
| 759 | test th1-trace-3 {$RESULT eq {}} |
| 760 | |
| 761 | ############################################################################### |
| 762 | |
| 763 | fossil test-th-eval --th-trace "trace {this is a trace message.}" |
| 764 | set normalized_result [normalize_result] |
| 765 | |
| 766 | regsub -- {\n/\*\*\*\*\* Subprocess \d+ exit\(\d+\) \*\*\*\*\*/} \ |
| 767 | $normalized_result {} normalized_result |
| 768 | |
| @@ -1023,11 +1023,11 @@ | |
| 1023 | fossil test-th-eval "globalState vfs" |
| 1024 | test th1-globalState-14 {[string length $RESULT] == 0} |
| 1025 | |
| 1026 | ############################################################################### |
| 1027 | |
| 1028 | if {$is_windows} { |
| 1029 | set altVfs win32-longpath |
| 1030 | } else { |
| 1031 | set altVfs unix-dotfile |
| 1032 | } |
| 1033 | |
| 1034 |
| --- test/th1.test | |
| +++ test/th1.test | |
| @@ -730,11 +730,11 @@ | |
| 730 | fossil test-th-eval "trace {}" |
| 731 | test th1-trace-1 {$RESULT eq {}} |
| 732 | |
| 733 | ############################################################################### |
| 734 | |
| 735 | fossil test-th-eval --th-trace "trace {}" -expectError |
| 736 | set normalized_result [normalize_result] |
| 737 | |
| 738 | regsub -- {\n/\*\*\*\*\* Subprocess \d+ exit\(\d+\) \*\*\*\*\*/} \ |
| 739 | $normalized_result {} normalized_result |
| 740 | |
| @@ -758,11 +758,11 @@ | |
| 758 | fossil test-th-eval "trace {this is a trace message.}" |
| 759 | test th1-trace-3 {$RESULT eq {}} |
| 760 | |
| 761 | ############################################################################### |
| 762 | |
| 763 | fossil test-th-eval --th-trace "trace {this is a trace message.}" -expectError |
| 764 | set normalized_result [normalize_result] |
| 765 | |
| 766 | regsub -- {\n/\*\*\*\*\* Subprocess \d+ exit\(\d+\) \*\*\*\*\*/} \ |
| 767 | $normalized_result {} normalized_result |
| 768 | |
| @@ -1023,11 +1023,11 @@ | |
| 1023 | fossil test-th-eval "globalState vfs" |
| 1024 | test th1-globalState-14 {[string length $RESULT] == 0} |
| 1025 | |
| 1026 | ############################################################################### |
| 1027 | |
| 1028 | if {$is_windows || $is_cygwin} { |
| 1029 | set altVfs win32-longpath |
| 1030 | } else { |
| 1031 | set altVfs unix-dotfile |
| 1032 | } |
| 1033 | |
| 1034 |
+25
-7
| --- test/unversioned.test | ||
| +++ test/unversioned.test | ||
| @@ -26,10 +26,13 @@ | ||
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | require_no_open_checkout |
| 29 | 29 | |
| 30 | 30 | test_setup; set rootDir [file normalize [pwd]] |
| 31 | + | |
| 32 | +# Avoid delays from the backoffice. | |
| 33 | +fossil set backoffice-disable 1 | |
| 31 | 34 | |
| 32 | 35 | fossil test-th-eval --open-config {repository} |
| 33 | 36 | set repository [normalize_result] |
| 34 | 37 | |
| 35 | 38 | if {[string length $repository] == 0} { |
| @@ -46,13 +49,20 @@ | ||
| 46 | 49 | set env(VISUAL) [appendArgs \ |
| 47 | 50 | [info nameofexecutable] " " [file join $path fake-editor.tcl]] |
| 48 | 51 | |
| 49 | 52 | ############################################################################### |
| 50 | 53 | |
| 51 | -fossil unversioned | |
| 54 | +# Under cygwin, the printed name with Usage: strips the extension | |
| 55 | +if { $::is_cygwin && [file extension $fossilexe] eq ".exe" } { | |
| 56 | + set fossilexeref [string range $fossilexe 0 end-4] | |
| 57 | +} else { | |
| 58 | + set fossilexeref $fossilexe | |
| 59 | +} | |
| 60 | + | |
| 61 | +fossil unversioned -expectError | |
| 52 | 62 | test unversioned-1 {[normalize_result] eq \ |
| 53 | -[string map [list %fossil% [file nativename $fossilexe]] {Usage: %fossil%\ | |
| 63 | +[string map [list %fossil% [file nativename $fossilexeref]] {Usage: %fossil%\ | |
| 54 | 64 | unversioned add|cat|edit|export|list|revert|remove|sync|touch}]} |
| 55 | 65 | |
| 56 | 66 | ############################################################################### |
| 57 | 67 | |
| 58 | 68 | fossil unversioned list |
| @@ -312,26 +322,30 @@ | ||
| 312 | 322 | fossil user capabilities uvtester oy |
| 313 | 323 | |
| 314 | 324 | ############################################################################### |
| 315 | 325 | |
| 316 | 326 | foreach {pid port outTmpFile} [test_start_server $repository stopArg] {} |
| 317 | -puts [appendArgs "Started Fossil server, pid \"" $pid \" ", port \"" $port \".] | |
| 327 | +if {! $::QUIET} { | |
| 328 | + puts [appendArgs "Started Fossil server, pid \"" $pid \" ", port \"" $port \".] | |
| 329 | +} | |
| 318 | 330 | set remote [appendArgs http://uvtester: $password @localhost: $port /] |
| 319 | 331 | |
| 320 | 332 | ############################################################################### |
| 321 | 333 | |
| 322 | 334 | set clientDir [file join $tempPath [appendArgs \ |
| 323 | 335 | uvtest_ [string trim [clock seconds] -] _ [getSeqNo]]] |
| 324 | 336 | |
| 325 | 337 | set savedPwd [pwd] |
| 326 | 338 | file mkdir $clientDir; cd $clientDir |
| 327 | -puts [appendArgs "Now in client directory \"" [pwd] \".] | |
| 339 | +if {! $::QUIET} { | |
| 340 | + puts [appendArgs "Now in client directory \"" [pwd] \".] | |
| 341 | +} | |
| 328 | 342 | write_file unversioned-client1.txt "This is unversioned client file #1." |
| 329 | 343 | |
| 330 | 344 | ############################################################################### |
| 331 | 345 | |
| 332 | -fossil_maybe_answer y clone $remote uvrepo.fossil | |
| 346 | +fossil clone --save-http-password $remote uvrepo.fossil | |
| 333 | 347 | fossil open -f uvrepo.fossil |
| 334 | 348 | |
| 335 | 349 | ############################################################################### |
| 336 | 350 | |
| 337 | 351 | fossil unversioned list |
| @@ -426,20 +440,24 @@ | ||
| 426 | 440 | |
| 427 | 441 | ############################################################################### |
| 428 | 442 | |
| 429 | 443 | cd $savedPwd; unset savedPwd |
| 430 | 444 | file delete -force $clientDir |
| 431 | -puts [appendArgs "Now in server directory \"" [pwd] \".] | |
| 445 | +if {! $::QUIET} { | |
| 446 | + puts [appendArgs "Now in server directory \"" [pwd] \".] | |
| 447 | +} | |
| 432 | 448 | |
| 433 | 449 | ############################################################################### |
| 434 | 450 | |
| 435 | 451 | set stopped [test_stop_server $stopArg $pid $outTmpFile] |
| 436 | 452 | |
| 437 | -puts [appendArgs \ | |
| 453 | +if {! $::QUIET} { | |
| 454 | + puts [appendArgs \ | |
| 438 | 455 | [expr {$stopped ? "Stopped" : "Could not stop"}] \ |
| 439 | 456 | " Fossil server, pid \"" $pid "\", using argument \"" \ |
| 440 | 457 | $stopArg \".] |
| 458 | +} | |
| 441 | 459 | |
| 442 | 460 | ############################################################################### |
| 443 | 461 | |
| 444 | 462 | fossil unversioned list |
| 445 | 463 | test unversioned-57 {[regexp \ |
| 446 | 464 | |
| 447 | 465 | ADDED test/update.test |
| --- test/unversioned.test | |
| +++ test/unversioned.test | |
| @@ -26,10 +26,13 @@ | |
| 26 | } |
| 27 | |
| 28 | require_no_open_checkout |
| 29 | |
| 30 | test_setup; set rootDir [file normalize [pwd]] |
| 31 | |
| 32 | fossil test-th-eval --open-config {repository} |
| 33 | set repository [normalize_result] |
| 34 | |
| 35 | if {[string length $repository] == 0} { |
| @@ -46,13 +49,20 @@ | |
| 46 | set env(VISUAL) [appendArgs \ |
| 47 | [info nameofexecutable] " " [file join $path fake-editor.tcl]] |
| 48 | |
| 49 | ############################################################################### |
| 50 | |
| 51 | fossil unversioned |
| 52 | test unversioned-1 {[normalize_result] eq \ |
| 53 | [string map [list %fossil% [file nativename $fossilexe]] {Usage: %fossil%\ |
| 54 | unversioned add|cat|edit|export|list|revert|remove|sync|touch}]} |
| 55 | |
| 56 | ############################################################################### |
| 57 | |
| 58 | fossil unversioned list |
| @@ -312,26 +322,30 @@ | |
| 312 | fossil user capabilities uvtester oy |
| 313 | |
| 314 | ############################################################################### |
| 315 | |
| 316 | foreach {pid port outTmpFile} [test_start_server $repository stopArg] {} |
| 317 | puts [appendArgs "Started Fossil server, pid \"" $pid \" ", port \"" $port \".] |
| 318 | set remote [appendArgs http://uvtester: $password @localhost: $port /] |
| 319 | |
| 320 | ############################################################################### |
| 321 | |
| 322 | set clientDir [file join $tempPath [appendArgs \ |
| 323 | uvtest_ [string trim [clock seconds] -] _ [getSeqNo]]] |
| 324 | |
| 325 | set savedPwd [pwd] |
| 326 | file mkdir $clientDir; cd $clientDir |
| 327 | puts [appendArgs "Now in client directory \"" [pwd] \".] |
| 328 | write_file unversioned-client1.txt "This is unversioned client file #1." |
| 329 | |
| 330 | ############################################################################### |
| 331 | |
| 332 | fossil_maybe_answer y clone $remote uvrepo.fossil |
| 333 | fossil open -f uvrepo.fossil |
| 334 | |
| 335 | ############################################################################### |
| 336 | |
| 337 | fossil unversioned list |
| @@ -426,20 +440,24 @@ | |
| 426 | |
| 427 | ############################################################################### |
| 428 | |
| 429 | cd $savedPwd; unset savedPwd |
| 430 | file delete -force $clientDir |
| 431 | puts [appendArgs "Now in server directory \"" [pwd] \".] |
| 432 | |
| 433 | ############################################################################### |
| 434 | |
| 435 | set stopped [test_stop_server $stopArg $pid $outTmpFile] |
| 436 | |
| 437 | puts [appendArgs \ |
| 438 | [expr {$stopped ? "Stopped" : "Could not stop"}] \ |
| 439 | " Fossil server, pid \"" $pid "\", using argument \"" \ |
| 440 | $stopArg \".] |
| 441 | |
| 442 | ############################################################################### |
| 443 | |
| 444 | fossil unversioned list |
| 445 | test unversioned-57 {[regexp \ |
| 446 | |
| 447 | DDED test/update.test |
| --- test/unversioned.test | |
| +++ test/unversioned.test | |
| @@ -26,10 +26,13 @@ | |
| 26 | } |
| 27 | |
| 28 | require_no_open_checkout |
| 29 | |
| 30 | test_setup; set rootDir [file normalize [pwd]] |
| 31 | |
| 32 | # Avoid delays from the backoffice. |
| 33 | fossil set backoffice-disable 1 |
| 34 | |
| 35 | fossil test-th-eval --open-config {repository} |
| 36 | set repository [normalize_result] |
| 37 | |
| 38 | if {[string length $repository] == 0} { |
| @@ -46,13 +49,20 @@ | |
| 49 | set env(VISUAL) [appendArgs \ |
| 50 | [info nameofexecutable] " " [file join $path fake-editor.tcl]] |
| 51 | |
| 52 | ############################################################################### |
| 53 | |
| 54 | # Under cygwin, the printed name with Usage: strips the extension |
| 55 | if { $::is_cygwin && [file extension $fossilexe] eq ".exe" } { |
| 56 | set fossilexeref [string range $fossilexe 0 end-4] |
| 57 | } else { |
| 58 | set fossilexeref $fossilexe |
| 59 | } |
| 60 | |
| 61 | fossil unversioned -expectError |
| 62 | test unversioned-1 {[normalize_result] eq \ |
| 63 | [string map [list %fossil% [file nativename $fossilexeref]] {Usage: %fossil%\ |
| 64 | unversioned add|cat|edit|export|list|revert|remove|sync|touch}]} |
| 65 | |
| 66 | ############################################################################### |
| 67 | |
| 68 | fossil unversioned list |
| @@ -312,26 +322,30 @@ | |
| 322 | fossil user capabilities uvtester oy |
| 323 | |
| 324 | ############################################################################### |
| 325 | |
| 326 | foreach {pid port outTmpFile} [test_start_server $repository stopArg] {} |
| 327 | if {! $::QUIET} { |
| 328 | puts [appendArgs "Started Fossil server, pid \"" $pid \" ", port \"" $port \".] |
| 329 | } |
| 330 | set remote [appendArgs http://uvtester: $password @localhost: $port /] |
| 331 | |
| 332 | ############################################################################### |
| 333 | |
| 334 | set clientDir [file join $tempPath [appendArgs \ |
| 335 | uvtest_ [string trim [clock seconds] -] _ [getSeqNo]]] |
| 336 | |
| 337 | set savedPwd [pwd] |
| 338 | file mkdir $clientDir; cd $clientDir |
| 339 | if {! $::QUIET} { |
| 340 | puts [appendArgs "Now in client directory \"" [pwd] \".] |
| 341 | } |
| 342 | write_file unversioned-client1.txt "This is unversioned client file #1." |
| 343 | |
| 344 | ############################################################################### |
| 345 | |
| 346 | fossil clone --save-http-password $remote uvrepo.fossil |
| 347 | fossil open -f uvrepo.fossil |
| 348 | |
| 349 | ############################################################################### |
| 350 | |
| 351 | fossil unversioned list |
| @@ -426,20 +440,24 @@ | |
| 440 | |
| 441 | ############################################################################### |
| 442 | |
| 443 | cd $savedPwd; unset savedPwd |
| 444 | file delete -force $clientDir |
| 445 | if {! $::QUIET} { |
| 446 | puts [appendArgs "Now in server directory \"" [pwd] \".] |
| 447 | } |
| 448 | |
| 449 | ############################################################################### |
| 450 | |
| 451 | set stopped [test_stop_server $stopArg $pid $outTmpFile] |
| 452 | |
| 453 | if {! $::QUIET} { |
| 454 | puts [appendArgs \ |
| 455 | [expr {$stopped ? "Stopped" : "Could not stop"}] \ |
| 456 | " Fossil server, pid \"" $pid "\", using argument \"" \ |
| 457 | $stopArg \".] |
| 458 | } |
| 459 | |
| 460 | ############################################################################### |
| 461 | |
| 462 | fossil unversioned list |
| 463 | test unversioned-57 {[regexp \ |
| 464 | |
| 465 | DDED test/update.test |
+125
| --- a/test/update.test | ||
| +++ b/test/update.test | ||
| @@ -0,0 +1,125 @@ | ||
| 1 | +# | |
| 2 | +# Copyright (c) 2024 Preben Guldnerg <[email protected]> | |
| 3 | +# | |
| 4 | +# This program is free software; you can redistribute it and/or | |
| 5 | +# modify it under the terms of the Simplified BSD License (also | |
| 6 | +# known as the "2-Clause License" or "FreeBSD License".) | |
| 7 | +# | |
| 8 | +# This program is distributed in the hope that it will be useful, | |
| 9 | +# but without any warranty; without even the implied warranty of | |
| 10 | +# merchantability or fitness for a particular purpose. | |
| 11 | +# | |
| 12 | +# Author contact information: | |
| 13 | +# [email protected] | |
| 14 | +# http://www.hwaci.com/drh/ | |
| 15 | +# | |
| 16 | +############################################################################ | |
| 17 | +# | |
| 18 | +# Tests for the "update" command. | |
| 19 | +# | |
| 20 | + | |
| 21 | +# Track number of tests we have set up in test_update_setup. This helps ensure | |
| 22 | +# that generated files are ordered in `fossil update --verbose` mode. | |
| 23 | +set UPDATE_TEST 0 | |
| 24 | + | |
| 25 | +proc test_update_setup {desc} { | |
| 26 | + global UPDATE_TEST | |
| 27 | + incr UPDATE_TEST | |
| 28 | + fossil revert | |
| 29 | + fossil eben Guldnerg <[email protected]> | |
| 30 | +# | |
| 31 | +# This program is free software; you can redistribute it and/or | |
| 32 | +# modify it under the terms of the Simplified BSD License (also | |
| 33 | +# known as the "2-Clause License" or "FreeBSD License".) | |
| 34 | +# | |
| 35 | +# This program is distributed in the hope that it will be useful, | |
| 36 | +# but without any warranty; without even the implied warranty of | |
| 37 | +# merchantability or fitness for a particular purpose. | |
| 38 | +# | |
| 39 | +# Author contact information: | |
| 40 | +# [email protected] | |
| 41 | +# http://www.hwaci.com/drh/ | |
| 42 | +# | |
| 43 | +############################################################################ | |
| 44 | +# | |
| 45 | +# Tests for the "update | |
| 46 | + test "update-changes-$testname" {$changes == $::RESULT} | |
| 47 | +} | |
| 48 | + | |
| 49 | +# Use a sequence number for file content that is not important for the test. | |
| 50 | +set UPDATE_SEQ_NO 0 | |
| 51 | +proc write_seq_to_file {fname} { | |
| 52 | + global UPDATE_SEQ_NO | |
| 53 | + incr UPDATE_SEQ_NO | |
| 54 | + write_file $fname "$UPDATE_SEQ_NO\n" | |
| 55 | +} | |
| 56 | + | |
| 57 | +# Make sure we are not in an open repository and initialize new repository | |
| 58 | +test_setup | |
| 59 | + | |
| 60 | +############################################################################### | |
| 61 | + | |
| 62 | +fossil update --verbose | |
| 63 | +test update-already-up-to-date { | |
| 64 | + [regexp {^-{79}\ncheckout: .*\nchanges: +None. Already up-to-date.$} $RESULT] | |
| 65 | +} | |
| 66 | + | |
| 67 | +# Remaining tests are carried out in the order update_cmd() performs checks. | |
| 68 | +# | |
| 69 | +# Common approach for tests below: | |
| 70 | +# 1. Set the testname | |
| 71 | +# 2. Set the file name, done by calling update_setup | |
| 72 | +# 3. Set message and changes, the expected message message and subsequent changes | |
| 73 | +# 3. Optionally set up and commit a common base for the next steps | |
| 74 | +# 4. Commit a change to the repository (new tip) | |
| 75 | +# 5. Update to the previous version | |
| 76 | +# 6. Make changes | |
| 77 | +# 7. Call test_update to attempt and update to tip | |
| 78 | + | |
| 79 | + | |
| 80 | +set testname "conflict-standard" | |
| 81 | +set fname [test_update_setup $testname] | |
| 82 | +set message "CONFLICT $fname" | |
| 83 | +set changes "EDITED $fname" | |
| 84 | +write_seq_to_file $fname | |
| 85 | +fossil add $fname | |
| 86 | +fossil commit -m "Add $fname" | |
| 87 | +fossil up previous | |
| 88 | +write_seq_to_file $fname | |
| 89 | +fossil add $fname | |
| 90 | +test_update $testname $message $changes -expectError | |
| 91 | + | |
| 92 | +set testname "add-overwrites" | |
| 93 | +set fname [test_update_setup $testname] | |
| 94 | +set message "ADD $fname - overwrites an unmanaged file, original copy backe | |
| 95 | +fossil add $fname | |
| 96 | +fossil commit -m "Add $fname" | |
| 97 | +write_seq_to_file $fname | |
| 98 | +name" | |
| 99 | +fossil up previous | |
| 100 | + | |
| 101 | + fossil changes | |
| 102 | + test "update-changes-$testname" {$changes == $::RESULT} | |
| 103 | +} | |
| 104 | + | |
| 105 | +# Use a sequence number for file content that is not important for the test. | |
| 106 | +set UPDATE_SEQ_NO 0 | |
| 107 | +proc write_seq_to_file {fname} { | |
| 108 | + global UPDATE_SEQ_NO | |
| 109 | + incr UPDATE_SEQ_NO | |
| 110 | + write_file $fname "$UPDATE_SEQ_NO\n" | |
| 111 | +} | |
| 112 | + | |
| 113 | +# Make sure we are not in an open repository and initialize new repository | |
| 114 | +test_setup | |
| 115 | + | |
| 116 | +############################################################################### | |
| 117 | + | |
| 118 | +fossil update --verbose | |
| 119 | +test update-already-up-to-date { | |
| 120 | + [regexp {^-{79}\ncheckout: .*\nchanges: +None. Already up-to-date.$} $RESULT] | |
| 121 | +} | |
| 122 | + | |
| 123 | +# Remaining tests are carried out in the order update_cmd() performs checks. | |
| 124 | +# | |
| 125 | +# Common approaile $fname |
| --- a/test/update.test | |
| +++ b/test/update.test | |
| @@ -0,0 +1,125 @@ | |
| --- a/test/update.test | |
| +++ b/test/update.test | |
| @@ -0,0 +1,125 @@ | |
| 1 | # |
| 2 | # Copyright (c) 2024 Preben Guldnerg <[email protected]> |
| 3 | # |
| 4 | # This program is free software; you can redistribute it and/or |
| 5 | # modify it under the terms of the Simplified BSD License (also |
| 6 | # known as the "2-Clause License" or "FreeBSD License".) |
| 7 | # |
| 8 | # This program is distributed in the hope that it will be useful, |
| 9 | # but without any warranty; without even the implied warranty of |
| 10 | # merchantability or fitness for a particular purpose. |
| 11 | # |
| 12 | # Author contact information: |
| 13 | # [email protected] |
| 14 | # http://www.hwaci.com/drh/ |
| 15 | # |
| 16 | ############################################################################ |
| 17 | # |
| 18 | # Tests for the "update" command. |
| 19 | # |
| 20 | |
| 21 | # Track number of tests we have set up in test_update_setup. This helps ensure |
| 22 | # that generated files are ordered in `fossil update --verbose` mode. |
| 23 | set UPDATE_TEST 0 |
| 24 | |
| 25 | proc test_update_setup {desc} { |
| 26 | global UPDATE_TEST |
| 27 | incr UPDATE_TEST |
| 28 | fossil revert |
| 29 | fossil eben Guldnerg <[email protected]> |
| 30 | # |
| 31 | # This program is free software; you can redistribute it and/or |
| 32 | # modify it under the terms of the Simplified BSD License (also |
| 33 | # known as the "2-Clause License" or "FreeBSD License".) |
| 34 | # |
| 35 | # This program is distributed in the hope that it will be useful, |
| 36 | # but without any warranty; without even the implied warranty of |
| 37 | # merchantability or fitness for a particular purpose. |
| 38 | # |
| 39 | # Author contact information: |
| 40 | # [email protected] |
| 41 | # http://www.hwaci.com/drh/ |
| 42 | # |
| 43 | ############################################################################ |
| 44 | # |
| 45 | # Tests for the "update |
| 46 | test "update-changes-$testname" {$changes == $::RESULT} |
| 47 | } |
| 48 | |
| 49 | # Use a sequence number for file content that is not important for the test. |
| 50 | set UPDATE_SEQ_NO 0 |
| 51 | proc write_seq_to_file {fname} { |
| 52 | global UPDATE_SEQ_NO |
| 53 | incr UPDATE_SEQ_NO |
| 54 | write_file $fname "$UPDATE_SEQ_NO\n" |
| 55 | } |
| 56 | |
| 57 | # Make sure we are not in an open repository and initialize new repository |
| 58 | test_setup |
| 59 | |
| 60 | ############################################################################### |
| 61 | |
| 62 | fossil update --verbose |
| 63 | test update-already-up-to-date { |
| 64 | [regexp {^-{79}\ncheckout: .*\nchanges: +None. Already up-to-date.$} $RESULT] |
| 65 | } |
| 66 | |
| 67 | # Remaining tests are carried out in the order update_cmd() performs checks. |
| 68 | # |
| 69 | # Common approach for tests below: |
| 70 | # 1. Set the testname |
| 71 | # 2. Set the file name, done by calling update_setup |
| 72 | # 3. Set message and changes, the expected message message and subsequent changes |
| 73 | # 3. Optionally set up and commit a common base for the next steps |
| 74 | # 4. Commit a change to the repository (new tip) |
| 75 | # 5. Update to the previous version |
| 76 | # 6. Make changes |
| 77 | # 7. Call test_update to attempt and update to tip |
| 78 | |
| 79 | |
| 80 | set testname "conflict-standard" |
| 81 | set fname [test_update_setup $testname] |
| 82 | set message "CONFLICT $fname" |
| 83 | set changes "EDITED $fname" |
| 84 | write_seq_to_file $fname |
| 85 | fossil add $fname |
| 86 | fossil commit -m "Add $fname" |
| 87 | fossil up previous |
| 88 | write_seq_to_file $fname |
| 89 | fossil add $fname |
| 90 | test_update $testname $message $changes -expectError |
| 91 | |
| 92 | set testname "add-overwrites" |
| 93 | set fname [test_update_setup $testname] |
| 94 | set message "ADD $fname - overwrites an unmanaged file, original copy backe |
| 95 | fossil add $fname |
| 96 | fossil commit -m "Add $fname" |
| 97 | write_seq_to_file $fname |
| 98 | name" |
| 99 | fossil up previous |
| 100 | |
| 101 | fossil changes |
| 102 | test "update-changes-$testname" {$changes == $::RESULT} |
| 103 | } |
| 104 | |
| 105 | # Use a sequence number for file content that is not important for the test. |
| 106 | set UPDATE_SEQ_NO 0 |
| 107 | proc write_seq_to_file {fname} { |
| 108 | global UPDATE_SEQ_NO |
| 109 | incr UPDATE_SEQ_NO |
| 110 | write_file $fname "$UPDATE_SEQ_NO\n" |
| 111 | } |
| 112 | |
| 113 | # Make sure we are not in an open repository and initialize new repository |
| 114 | test_setup |
| 115 | |
| 116 | ############################################################################### |
| 117 | |
| 118 | fossil update --verbose |
| 119 | test update-already-up-to-date { |
| 120 | [regexp {^-{79}\ncheckout: .*\nchanges: +None. Already up-to-date.$} $RESULT] |
| 121 | } |
| 122 | |
| 123 | # Remaining tests are carried out in the order update_cmd() performs checks. |
| 124 | # |
| 125 | # Common approaile $fname |