Fossil SCM

Merge current state of testing-improvements. make clean output is now easy to review.

preben 2024-01-12 15:48 trunk merge
Commit e5bcfd1efe9b638f3b639ebabe75275f0c8421dd6752821ec63250cb3997faed
--- test/commit-warning.test
+++ test/commit-warning.test
@@ -172,13 +172,10 @@
172172
test_block_in_checkout pre-commit-warnings-fossil-1 {
173173
fossil test-commit-warning --no-settings
174174
} {
175175
test pre-commit-warnings-fossil-1 {[normalize_result] eq \
176176
[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
180177
1\tcompat/zlib/contrib/blast/test.pk\tbinary data
181178
1\tcompat/zlib/contrib/dotzlib/DotZLib.build\tCR/LF line endings
182179
1\tcompat/zlib/contrib/dotzlib/DotZLib.chm\tbinary data
183180
1\tcompat/zlib/contrib/dotzlib/DotZLib.sln\tCR/LF line endings
184181
1\tcompat/zlib/contrib/dotzlib/DotZLib/AssemblyInfo.cs\tCR/LF line endings
@@ -192,19 +189,10 @@
192189
1\tcompat/zlib/contrib/dotzlib/DotZLib/Inflater.cs\tinvalid UTF-8
193190
1\tcompat/zlib/contrib/dotzlib/DotZLib/UnitTests.cs\tCR/LF line endings
194191
1\tcompat/zlib/contrib/dotzlib/LICENSE_1_0.txt\tCR/LF line endings
195192
1\tcompat/zlib/contrib/dotzlib/readme.txt\tCR/LF line endings
196193
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
206194
1\tcompat/zlib/contrib/puff/zeros.raw\tbinary data
207195
1\tcompat/zlib/contrib/testzlib/testzlib.c\tCR/LF line endings
208196
1\tcompat/zlib/contrib/testzlib/testzlib.txt\tCR/LF line endings
209197
1\tcompat/zlib/contrib/vstudio/readme.txt\tCR/LF line endings
210198
1\tcompat/zlib/contrib/vstudio/vc10/miniunz.vcxproj\tCR/LF line endings
@@ -243,18 +231,18 @@
243231
1\tcompat/zlib/contrib/vstudio/vc9/zlibvc.sln\tCR/LF line endings
244232
1\tcompat/zlib/contrib/vstudio/vc9/zlibvc.vcproj\tCR/LF line endings
245233
1\tcompat/zlib/win32/zlib.def\tCR/LF line endings
246234
1\tcompat/zlib/zlib.3.pdf\tbinary data
247235
1\tcompat/zlib/zlib.map\tCR/LF line endings
236
+1\textsrc/pikchr.wasm\tbinary data
248237
1\tskins/blitz/arrow_project.png\tbinary data
249238
1\tskins/blitz/dir.png\tbinary data
250239
1\tskins/blitz/file.png\tbinary data
251240
1\tskins/blitz/fossil_100.png\tbinary data
252241
1\tskins/blitz/fossil_80_reversed_darkcyan.png\tbinary data
253242
1\tskins/blitz/fossil_80_reversed_darkcyan_text.png\tbinary data
254243
1\tskins/blitz/rss_20.png\tbinary data
255
-1\tskins/bootstrap/css.txt\tlong lines
256244
1\tsrc/alerts/bflat2.wav\tbinary data
257245
1\tsrc/alerts/bflat3.wav\tbinary data
258246
1\tsrc/alerts/bloop.wav\tbinary data
259247
1\tsrc/alerts/plunk.wav\tbinary data
260248
1\tsrc/sounds/0.wav\tbinary data
261249
--- 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
--- test/delta1.test
+++ test/delta1.test
@@ -25,11 +25,11 @@
2525
# For each test, copy the file intact to "./t1". Make
2626
# some random changes in "./t2". Then call test-delta on the
2727
# two files to make sure that deltas between these two files
2828
# work properly.
2929
#
30
-set filelist [glob $testdir/*]
30
+set filelist [lsort [glob $testdir/*]]
3131
foreach f $filelist {
3232
if {[file isdir $f]} continue
3333
set base [file root [file tail $f]]
3434
set f1 [read_file $f]
3535
write_file t1 $f1
3636
--- 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
--- test/fake-editor.tcl
+++ test/fake-editor.tcl
@@ -49,10 +49,15 @@
4949
}
5050
5151
###############################################################################
5252
5353
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
+}
5459
5560
if {[file exists $fileName]} {
5661
set data [readFile $fileName]
5762
} else {
5863
set data ""
5964
--- 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 @@
177177
}
178178
179179
#### VERSION AKA HAI
180180
181181
# 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
+
182190
test_setup
183191
184192
# Stop backoffice from running during this test as it can cause hangs.
185193
fossil settings backoffice-disable 1
186194
@@ -887,11 +895,10 @@
887895
fossil_json HAI -expectError
888896
test json-RC-4102-CLI-exit {$CODE != 0}
889897
test_json_envelope json-RC-4102-CLI-exit {fossil timestamp command procTimeUs \
890898
procTimeMs resultCode resultText} {payload}
891899
test json-RC-4102 {[dict get $JR resultCode] eq "FOSSIL-4102"}
892
-fossil open .rep.fossil
893900
894901
# FOSSIL-4103 FSL_JSON_E_DB_NOT_VALID
895902
# Fossil repository db file is not valid.
896903
write_file nope.fossil {
897904
This is not a fossil repo. It ought to be a SQLite db with a well-known schema,
@@ -908,5 +915,11 @@
908915
}
909916
910917
###############################################################################
911918
912919
test_cleanup
920
+
921
+if { $_fossil_user eq "" } {
922
+ unset ::env(FOSSIL_USER)
923
+} else {
924
+ set ::env(FOSSIL_USER) $_fossil_user
925
+}
913926
--- 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
--- test/merge1.test
+++ test/merge1.test
@@ -98,13 +98,13 @@
9898
222 - The second line program line in code - 2222
9999
333 - This is a test of the merging algohm - 3333
100100
444 - If all goes well, we will be pleased - 4444
101101
555 - we think it well and other stuff too - 5555
102102
}
103
-fossil 3-way-merge t1 t3 t2 a32
103
+fossil 3-way-merge t1 t3 t2 a32 -expectError
104104
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
106106
test merge1-2.2 {[same_file t23 a23]}
107107
108108
write_file_indented t1 {
109109
111 - This is line one of the demo program - 1111
110110
222 - The second line program line in code - 2222
@@ -183,13 +183,13 @@
183183
222 - The second line program line in code - 2222
184184
333 - This is a test of the merging algohm - 3333
185185
444 - If all goes well, we will be pleased - 4444
186186
555 - we think it well and other stuff too - 5555
187187
}
188
-fossil 3-way-merge t1 t3 t2 a32
188
+fossil 3-way-merge t1 t3 t2 a32 -expectError
189189
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
191191
test merge1-4.2 {[same_file t23 a23]}
192192
193193
write_file_indented t1 {
194194
111 - This is line one of the demo program - 1111
195195
222 - The second line program line in code - 2222
@@ -330,11 +330,11 @@
330330
KLMN
331331
OPQR
332332
STUV
333333
XYZ.
334334
}
335
-fossil 3-way-merge t1 t2 t3 a23
335
+fossil 3-way-merge t1 t2 t3 a23 -expectError
336336
test merge1-7.1 {[same_file t23 a23]}
337337
338338
write_file_indented t2 {
339339
abcd
340340
efgh 2
@@ -398,11 +398,11 @@
398398
KLMN
399399
OPQR
400400
STUV
401401
XYZ.
402402
}
403
-fossil 3-way-merge t1 t2 t3 a23
403
+fossil 3-way-merge t1 t2 t3 a23 -expectError
404404
test merge1-7.2 {[same_file t23 a23]}
405405
406406
###############################################################################
407407
408408
test_cleanup
409409
--- 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
--- test/merge2.test
+++ test/merge2.test
@@ -18,11 +18,11 @@
1818
# Tests of the delta mechanism.
1919
#
2020
2121
test_setup ""
2222
23
-set filelist [glob $testdir/*]
23
+set filelist [lsort [glob $testdir/*]]
2424
foreach f $filelist {
2525
if {[file isdir $f]} continue
2626
set base [file root [file tail $f]]
2727
if {[string match "utf16*" $base]} continue
2828
set f1 [read_file $f]
2929
--- 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 @@
1818
# Tests of the 3-way merge
1919
#
2020
2121
test_setup ""
2222
23
-proc merge-test {testid basis v1 v2 result} {
23
+proc merge-test {testid basis v1 v2 result {fossil_args ""}} {
2424
write_file t1 [join [string trim $basis] \n]\n
2525
write_file t2 [join [string trim $v1] \n]\n
2626
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
2828
set x [read_file t4]
2929
regsub -all \
3030
{<<<<<<< BEGIN MERGE CONFLICT: local copy shown first <+ \(line \d+\)} \
3131
$x {MINE:} x
3232
regsub -all \
@@ -74,56 +74,56 @@
7474
1 2 3b 4b 5b 6 7 8 9
7575
} {
7676
1 2 3 4 5c 6 7 8 9
7777
} {
7878
1 2 MINE: 3b 4b 5b COM: 3 4 5 YOURS: 3 4 5c END 6 7 8 9
79
-}
79
+} -expectError
8080
merge-test 4 {
8181
1 2 3 4 5 6 7 8 9
8282
} {
8383
1 2 3b 4b 5b 6b 7 8 9
8484
} {
8585
1 2 3 4 5c 6 7 8 9
8686
} {
8787
1 2 MINE: 3b 4b 5b 6b COM: 3 4 5 6 YOURS: 3 4 5c 6 END 7 8 9
88
-}
88
+} -expectError
8989
merge-test 5 {
9090
1 2 3 4 5 6 7 8 9
9191
} {
9292
1 2 3b 4b 5b 6b 7 8 9
9393
} {
9494
1 2 3 4 5c 6c 7c 8 9
9595
} {
9696
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
9898
merge-test 6 {
9999
1 2 3 4 5 6 7 8 9
100100
} {
101101
1 2 3b 4b 5b 6b 7 8b 9
102102
} {
103103
1 2 3 4 5c 6c 7c 8 9
104104
} {
105105
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
107107
merge-test 7 {
108108
1 2 3 4 5 6 7 8 9
109109
} {
110110
1 2 3b 4b 5b 6b 7 8b 9
111111
} {
112112
1 2 3 4 5c 6c 7c 8c 9
113113
} {
114114
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
116116
merge-test 8 {
117117
1 2 3 4 5 6 7 8 9
118118
} {
119119
1 2 3b 4b 5b 6b 7 8b 9b
120120
} {
121121
1 2 3 4 5c 6c 7c 8c 9
122122
} {
123123
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
125125
merge-test 9 {
126126
1 2 3 4 5 6 7 8 9
127127
} {
128128
1 2 3b 4b 5 6 7 8b 9b
129129
} {
@@ -147,11 +147,11 @@
147147
1 2 3b 4b 5 6 7 8b 9b
148148
} {
149149
1 2 3b 4c 5 6c 7c 8 9
150150
} {
151151
1 2 MINE: 3b 4b COM: 3 4 YOURS: 3b 4c END 5 6c 7c 8b 9b
152
-}
152
+} -expectError
153153
merge-test 12 {
154154
1 2 3 4 5 6 7 8 9
155155
} {
156156
1 2 3b4b 5 6 7 8b 9b
157157
} {
@@ -202,20 +202,20 @@
202202
1 6 7 8 9
203203
} {
204204
1 2 3 4 9
205205
} {
206206
1 MINE: 6 7 8 COM: 2 3 4 5 6 7 8 YOURS: 2 3 4 END 9
207
-}
207
+} -expectError
208208
merge-test 25 {
209209
1 2 3 4 5 6 7 8 9
210210
} {
211211
1 7 8 9
212212
} {
213213
1 2 3 9
214214
} {
215215
1 MINE: 7 8 COM: 2 3 4 5 6 7 8 YOURS: 2 3 END 9
216
-}
216
+} -expectError
217217
218218
merge-test 30 {
219219
1 2 3 4 5 6 7 8 9
220220
} {
221221
1 2 3 4 5 6 7 9
@@ -257,20 +257,20 @@
257257
1 2 3 4 9
258258
} {
259259
1 6 7 8 9
260260
} {
261261
1 MINE: 2 3 4 COM: 2 3 4 5 6 7 8 YOURS: 6 7 8 END 9
262
-}
262
+} -expectError
263263
merge-test 35 {
264264
1 2 3 4 5 6 7 8 9
265265
} {
266266
1 2 3 9
267267
} {
268268
1 7 8 9
269269
} {
270270
1 MINE: 2 3 COM: 2 3 4 5 6 7 8 YOURS: 7 8 END 9
271
-}
271
+} -expectError
272272
273273
merge-test 40 {
274274
2 3 4 5 6 7 8
275275
} {
276276
3 4 5 6 7 8
@@ -312,20 +312,20 @@
312312
6 7 8
313313
} {
314314
2 3 4
315315
} {
316316
MINE: 6 7 8 COM: 2 3 4 5 6 7 8 YOURS: 2 3 4 END
317
-}
317
+} -expectError
318318
merge-test 45 {
319319
2 3 4 5 6 7 8
320320
} {
321321
7 8
322322
} {
323323
2 3
324324
} {
325325
MINE: 7 8 COM: 2 3 4 5 6 7 8 YOURS: 2 3 END
326
-}
326
+} -expectError
327327
328328
merge-test 50 {
329329
2 3 4 5 6 7 8
330330
} {
331331
2 3 4 5 6 7
@@ -366,20 +366,20 @@
366366
2 3 4
367367
} {
368368
6 7 8
369369
} {
370370
MINE: 2 3 4 COM: 2 3 4 5 6 7 8 YOURS: 6 7 8 END
371
-}
371
+} -expectError
372372
merge-test 55 {
373373
2 3 4 5 6 7 8
374374
} {
375375
2 3
376376
} {
377377
7 8
378378
} {
379379
MINE: 2 3 COM: 2 3 4 5 6 7 8 YOURS: 7 8 END
380
-}
380
+} -expectError
381381
382382
merge-test 60 {
383383
1 2 3 4 5 6 7 8 9
384384
} {
385385
1 2b 3 4 5 6 7 8 9
@@ -421,20 +421,20 @@
421421
1 2b 3b 4b 5b 6 7 8 9
422422
} {
423423
1 2 3 4 9
424424
} {
425425
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
427427
merge-test 65 {
428428
1 2 3 4 5 6 7 8 9
429429
} {
430430
1 2b 3b 4b 5b 6b 7 8 9
431431
} {
432432
1 2 3 9
433433
} {
434434
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
436436
437437
merge-test 70 {
438438
1 2 3 4 5 6 7 8 9
439439
} {
440440
1 2 3 4 5 6 7 9
@@ -476,20 +476,20 @@
476476
1 2 3 4 9
477477
} {
478478
1 2b 3b 4b 5b 6 7 8 9
479479
} {
480480
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
482482
merge-test 75 {
483483
1 2 3 4 5 6 7 8 9
484484
} {
485485
1 2 3 9
486486
} {
487487
1 2b 3b 4b 5b 6b 7 8 9
488488
} {
489489
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
491491
492492
merge-test 80 {
493493
2 3 4 5 6 7 8
494494
} {
495495
2b 3 4 5 6 7 8
@@ -531,20 +531,20 @@
531531
2b 3b 4b 5b 6 7 8
532532
} {
533533
2 3 4
534534
} {
535535
MINE: 2b 3b 4b 5b 6 7 8 COM: 2 3 4 5 6 7 8 YOURS: 2 3 4 END
536
-}
536
+} -expectError
537537
merge-test 85 {
538538
2 3 4 5 6 7 8
539539
} {
540540
2b 3b 4b 5b 6b 7 8
541541
} {
542542
2 3
543543
} {
544544
MINE: 2b 3b 4b 5b 6b 7 8 COM: 2 3 4 5 6 7 8 YOURS: 2 3 END
545
-}
545
+} -expectError
546546
547547
merge-test 90 {
548548
2 3 4 5 6 7 8
549549
} {
550550
2 3 4 5 6 7
@@ -586,20 +586,20 @@
586586
2 3 4
587587
} {
588588
2b 3b 4b 5b 6 7 8
589589
} {
590590
MINE: 2 3 4 COM: 2 3 4 5 6 7 8 YOURS: 2b 3b 4b 5b 6 7 8 END
591
-}
591
+} -expectError
592592
merge-test 95 {
593593
2 3 4 5 6 7 8
594594
} {
595595
2 3
596596
} {
597597
2b 3b 4b 5b 6b 7 8
598598
} {
599599
MINE: 2 3 COM: 2 3 4 5 6 7 8 YOURS: 2b 3b 4b 5b 6b 7 8 END
600
-}
600
+} -expectError
601601
602602
merge-test 100 {
603603
1 2 3 4 5 6 7 8 9
604604
} {
605605
1 2b 3 4 5 7 8 9 a b c d e
@@ -632,19 +632,19 @@
632632
1 2 3 4 5 7 8 9b
633633
} {
634634
1 2 3 4 5 7 8 9b a b c d e
635635
} {
636636
1 2 3 4 5 7 8 MINE: 9b COM: 9 YOURS: 9b a b c d e END
637
-}
637
+} -expectError
638638
merge-test 104 {
639639
1 2 3 4 5 6 7 8 9
640640
} {
641641
1 2 3 4 5 7 8 9b a b c d e
642642
} {
643643
1 2 3 4 5 7 8 9b
644644
} {
645645
1 2 3 4 5 7 8 MINE: 9b a b c d e COM: 9 YOURS: 9b END
646
-}
646
+} -expectError
647647
648648
###############################################################################
649649
650650
test_cleanup
651651
--- 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
--- test/merge4.test
+++ test/merge4.test
@@ -18,16 +18,16 @@
1818
# Tests of the 3-way merge
1919
#
2020
2121
test_setup ""
2222
23
-proc merge-test {testid basis v1 v2 result1 result2} {
23
+proc merge-test {testid basis v1 v2 result1 result2 {fossil_args ""}} {
2424
write_file t1 [join [string trim $basis] \n]\n
2525
write_file t2 [join [string trim $v1] \n]\n
2626
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
2929
set x [read_file t4]
3030
regsub -all {<<<<<<< BEGIN MERGE CONFLICT.*<< \(line \d+\)} $x {>} x
3131
regsub -all {\|\|\|\|\|\|\|.*======= \(line \d+\)} $x {=} x
3232
regsub -all {>>>>>>> END MERGE CONFLICT.*>>>>} $x {<} x
3333
set x [split [string trim $x] \n]
@@ -61,11 +61,11 @@
6161
1 2 3 4c 5c 6c 7 8 9
6262
} {
6363
1 > 2b 3b 4b 5 6b 7b 8b = 2 3 4c 5c 6c 7 8 < 9
6464
} {
6565
1 > 2 3 4c 5c 6c 7 8 = 2b 3b 4b 5 6b 7b 8b < 9
66
-}
66
+} -expectError
6767
merge-test 1001 {
6868
1 2 3 4 5 6 7 8 9
6969
} {
7070
1 2b 3b 4 5 6 7b 8b 9
7171
} {
@@ -83,11 +83,11 @@
8383
2 3 4c 5c 6c 7 8
8484
} {
8585
> 2b 3b 4b 5 6b 7b 8b = 2 3 4c 5c 6c 7 8 <
8686
} {
8787
> 2 3 4c 5c 6c 7 8 = 2b 3b 4b 5 6b 7b 8b <
88
-}
88
+} -expectError
8989
merge-test 1003 {
9090
2 3 4 5 6 7 8
9191
} {
9292
2b 3b 4 5 6 7b 8b
9393
} {
9494
--- 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
--- test/merge5.test
+++ test/merge5.test
@@ -16,11 +16,13 @@
1616
############################################################################
1717
#
1818
# Tests of the "merge" command
1919
#
2020
21
-puts "Skipping Merge5 tests"
21
+if {! $::QUIET} {
22
+ puts "Skipping Merge5 tests"
23
+}
2224
protOut {
2325
fossil sqlite3 --no-repository reacts badly to SQL dumped from
2426
repositories created from fossil older than version 2.0.
2527
}
2628
test merge5-sqlite3-issue false knownBug
2729
--- 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
--- test/merge_renames.test
+++ test/merge_renames.test
@@ -262,19 +262,19 @@
262262
fossil add f1
263263
fossil commit -b b2 -m "add f1"
264264
265265
fossil update trunk
266266
fossil merge b1
267
-fossil merge b2
267
+fossil merge b2 -expectError
268268
test_status_list merge_renames-8-1 $RESULT {
269269
MERGE f1
270270
WARNING: 1 merge conflicts
271271
}
272272
273273
fossil revert
274274
fossil merge --integrate b1
275
-fossil merge b2
275
+fossil merge b2 -expectError
276276
test_status_list merge_renames-8-2 $RESULT {
277277
MERGE f1
278278
WARNING: 1 merge conflicts
279279
}
280280
@@ -322,11 +322,11 @@
322322
fossil undo
323323
test_status_list merge_renames-9-5 $RESULT {
324324
UNDO f1
325325
UNDO f2
326326
}
327
-fossil merge -n b
327
+fossil merge -n b -expectError
328328
test_status_list merge_renames-9-6 $RESULT "
329329
$expectedMerge
330330
REMINDER: this was a dry run - no files were actually changed.
331331
"
332332
test merge_renames-9-7 {[fossil changes] eq ""}
333333
--- 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
--- test/merge_warn.test
+++ test/merge_warn.test
@@ -40,11 +40,11 @@
4040
fossil commit -m "add f4"
4141
4242
fossil update trunk
4343
write_file f1 "f1.1"
4444
write_file f3 "f3.1"
45
-fossil merge --integrate mrg
45
+fossil merge --integrate mrg -expectError
4646
test_status_list merge_warn-1 $RESULT {
4747
WARNING: 1 unmanaged files were overwritten
4848
WARNING: 2 merge conflicts
4949
DELETE f1
5050
MERGE f2
5151
5252
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
--- 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 }
--- test/set-manifest.test
+++ test/set-manifest.test
@@ -46,21 +46,21 @@
4646
#### Verify classic behavior of the manifest setting
4747
4848
# Setting is off by default, and there are no extra files.
4949
fossil settings manifest
5050
test "set-manifest-1" {[regexp {^manifest *$} $RESULT]}
51
-set filelist [glob -nocomplain manifest*]
51
+set filelist [lsort [glob -nocomplain manifest*]]
5252
test "set-manifest-1-n" {[llength $filelist] == 0}
5353
5454
# Classic behavior: TRUE value creates manifest and manifest.uuid
5555
set truths [list true on 1]
5656
foreach v $truths {
5757
fossil settings manifest $v
5858
test "set-manifest-2-$v" {$RESULT eq ""}
5959
fossil settings manifest
6060
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*]]
6262
test "set-manifest-2-$v-n" {[llength $filelist] == 2}
6363
foreach f $filelist {
6464
test "set-manifest-2-$v-f-$f" {[file isfile $f]}
6565
}
6666
}
@@ -88,21 +88,21 @@
8888
foreach v $falses {
8989
fossil settings manifest $v
9090
test "set-manifest-3-$v" {$RESULT eq ""}
9191
fossil settings manifest
9292
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*]]
9494
test "set-manifest-3-$v-n" {[llength $filelist] == 0}
9595
}
9696
9797
9898
# Classic behavior: unset removes manifest and manifest.uuid
9999
fossil unset manifest
100100
test "set-manifest-4" {$RESULT eq ""}
101101
fossil settings manifest
102102
test "set-manifest-4-a" {[regexp {^manifest *$} $RESULT]}
103
-set filelist [glob -nocomplain manifest*]
103
+set filelist [lsort [glob -nocomplain manifest*]]
104104
test "set-manifest-4-n" {[llength $filelist] == 0}
105105
106106
107107
##### Tags Manifest feature extends the manifest setting
108108
@@ -112,11 +112,11 @@
112112
foreach v $truths {
113113
fossil settings manifest $v
114114
test "set-manifest-5-$v" {$RESULT eq ""}
115115
fossil settings manifest
116116
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*]]
118118
test "set-manifest-5-$v-n" {[llength $filelist] == [string length $v]}
119119
foreach f $filelist {
120120
test "set-manifest-5-$v-f-$f" {[file isfile $f]}
121121
}
122122
}
123123
--- 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
--- test/settings-repo.test
+++ test/settings-repo.test
@@ -40,11 +40,15 @@
4040
foreach name $all_settings {
4141
#
4242
# HACK: Make 100% sure that there are no non-default setting values
4343
# present anywhere.
4444
#
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
+ }
4650
fossil unset $name --exact
4751
4852
#
4953
# NOTE: Query for the hard-coded default value of this setting and
5054
# save it.
@@ -53,62 +57,62 @@
5357
set defaults($name) [normalize_result]
5458
}
5559
5660
###############################################################################
5761
58
-fossil settings bad-setting some_value
62
+fossil settings bad-setting some_value -expectError
5963
6064
test settings-set-bad-local {
6165
[normalize_result] eq "no such setting: bad-setting"
6266
}
6367
64
-fossil settings bad-setting some_value --global
68
+fossil settings bad-setting some_value --global -expectError
6569
6670
test settings-set-bad-global {
6771
[normalize_result] eq "no such setting: bad-setting"
6872
}
6973
7074
###############################################################################
7175
72
-fossil unset bad-setting
76
+fossil unset bad-setting -expectError
7377
7478
test settings-unset-bad-local {
7579
[normalize_result] eq "no such setting: bad-setting"
7680
}
7781
78
-fossil unset bad-setting --global
82
+fossil unset bad-setting --global -expectError
7983
8084
test settings-unset-bad-global {
8185
[normalize_result] eq "no such setting: bad-setting"
8286
}
8387
8488
###############################################################################
8589
86
-fossil settings ssl some_value
90
+fossil settings ssl some_value -expectError
8791
8892
test settings-set-ambiguous-local {
8993
[normalize_result] eq
9094
"ambiguous setting \"ssl\" - might be: ssl-ca-location ssl-identity"
9195
}
9296
93
-fossil settings ssl some_value --global
97
+fossil settings ssl some_value --global -expectError
9498
9599
test settings-set-ambiguous-global {
96100
[normalize_result] eq
97101
"ambiguous setting \"ssl\" - might be: ssl-ca-location ssl-identity"
98102
}
99103
100104
###############################################################################
101105
102
-fossil unset ssl
106
+fossil unset ssl -expectError
103107
104108
test settings-unset-ambiguous-local {
105109
[normalize_result] eq
106110
"ambiguous setting \"ssl\" - might be: ssl-ca-location ssl-identity"
107111
}
108112
109
-fossil unset ssl --global
113
+fossil unset ssl --global -expectError
110114
111115
test settings-unset-ambiguous-global {
112116
[normalize_result] eq
113117
"ambiguous setting \"ssl\" - might be: ssl-ca-location ssl-identity"
114118
}
115119
--- 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
--- test/settings.test
+++ test/settings.test
@@ -92,11 +92,15 @@
9292
test settings-query-local-$name {
9393
[regexp -- [string map [list %name% $name] $pattern(1)] $data] ||
9494
[regexp -- [string map [list %name% $name] $pattern(2)] $data]
9595
}
9696
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
+ }
98102
set data [normalize_result]
99103
100104
if {$name eq "manifest"} {
101105
test settings-query-global-$name {
102106
$data eq "cannot set 'manifest' globally"
@@ -109,20 +113,20 @@
109113
}
110114
}
111115
112116
###############################################################################
113117
114
-fossil settings bad-setting
118
+fossil settings bad-setting -expectError
115119
116120
test settings-query-bad-local {
117121
[normalize_result] eq "no such setting: bad-setting"
118122
}
119123
120
-fossil settings bad-setting --global
124
+fossil settings bad-setting --global -expectError
121125
122126
test settings-query-bad-global {
123127
[normalize_result] eq "no such setting: bad-setting"
124128
}
125129
126130
###############################################################################
127131
128132
test_cleanup
129133
--- 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 @@
206206
# fossil: ./src/delta.c:231: checksum: Assertion '...' failed.
207207
# Should be triggered by this stash-WY-1 test.
208208
fossil checkout --force c1
209209
fossil clean
210210
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"} {
212212
REVERT f1
213213
DELETE f1new
214214
} -changes {
215215
} -addremove {
216216
} -exists {f1 f2 f3} -notexists {f1new} -knownbugs {-code -result}
217217
--- 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
--- test/symlinks.test
+++ test/symlinks.test
@@ -23,17 +23,10 @@
2323
if {$is_windows} {
2424
puts "Symlinks are not supported on Windows."
2525
test_cleanup_then_return
2626
}
2727
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
-
3528
require_no_open_checkout
3629
3730
###############################################################################
3831
3932
test_setup; set rootDir [file normalize [pwd]]
@@ -68,11 +61,11 @@
6861
6962
fossil add [file join $rootDir symdirA f1.txt]
7063
test symlinks-skip-dir-traversal {[normalize_result] eq \
7164
"SKIP symdirA/f1.txt"}
7265
73
-fossil commit -m "c1"
66
+fossil commit -m "c1" -expectError
7467
7568
test symlinks-empty-commit {[normalize_result] eq \
7669
"nothing has changed; use --allow-empty to override"}
7770
7871
###############################################################################
@@ -80,13 +73,10 @@
8073
fossil ls
8174
test symlinks-dir-5 {[normalize_result] eq ""}
8275
8376
###############################################################################
8477
85
-fossil set allow
86
-puts $RESULT
87
-
8878
fossil extras
8979
test symlinks-dir-6 {[normalize_result] eq \
9080
"subdirA/f1.txt\nsubdirA/f2.txt\nsymdirA"}
9181
9282
###############################################################################
9383
--- 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 @@
3535
set testfiledir [file normalize [file dirname [info script]]]
3636
set testrundir [pwd]
3737
set testdir [file normalize [file dirname $argv0]]
3838
set fossilexe [file normalize [lindex $argv 0]]
3939
set is_windows [expr {$::tcl_platform(platform) eq "windows"}]
40
+set is_cygwin [regexp {^CYGWIN} $::tcl_platform(os)]
4041
4142
if {$::is_windows} {
4243
if {[string length [file extension $fossilexe]] == 0} {
4344
append fossilexe .exe
4445
}
@@ -447,10 +448,12 @@
447448
$::env(FOSSIL_TEST_DANGEROUS_IGNORE_OPEN_CHECKOUT) eq "YES_DO_IT"} {
448449
return
449450
}
450451
catch {exec $::fossilexe info} res
451452
if {[regexp {local-root:} $res]} {
453
+ global skipped_tests testfile
454
+ lappend skipped_tests $testfile
452455
set projectName <unknown>
453456
set localRoot <unknown>
454457
regexp -line -- {^project-name: (.*)$} $res dummy projectName
455458
set projectName [string trim $projectName]
456459
regexp -line -- {^local-root: (.*)$} $res dummy localRoot
@@ -484,16 +487,22 @@
484487
}
485488
error "Could not delete \"$path\", error: $error"
486489
}
487490
488491
proc test_cleanup_then_return {} {
492
+ global skipped_tests testfile
493
+ lappend skipped_tests $testfile
489494
uplevel 1 [list test_cleanup]
490495
return -code return
491496
}
492497
493498
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
+ }
495504
if {![info exists ::tempRepoPath]} {return}
496505
if {![file exists $::tempRepoPath]} {return}
497506
if {![file isdirectory $::tempRepoPath]} {return}
498507
set tempPathEnd [expr {[string length $::tempPath] - 1}]
499508
if {[string length $::tempPath] == 0 || \
@@ -518,11 +527,11 @@
518527
if {![info exists ::tempKeepHome]} {delete_temporary_home}
519528
}
520529
521530
proc delete_temporary_home {} {
522531
if {$::KEEP} {return}; # All cleanup disabled?
523
- if {$::is_windows} {
532
+ if {$::is_windows || $::is_cygwin} {
524533
robust_delete [file join $::tempHomePath _fossil]
525534
} else {
526535
robust_delete [file join $::tempHomePath .fossil]
527536
}
528537
robust_delete $::tempHomePath
@@ -845,10 +854,11 @@
845854
}
846855
}
847856
}
848857
set bad_test {}
849858
set ignored_test {}
859
+set skipped_tests {}
850860
851861
# Return a random string N characters long.
852862
#
853863
set vocabulary 01234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
854864
append vocabulary " ()*^!.eeeeeeeeaaaaattiioo "
@@ -1009,11 +1019,11 @@
10091019
set data [subst [read_file $dataFileName]]
10101020
10111021
write_file $inFileName $data
10121022
10131023
fossil http --in $inFileName --out $outFileName --ipaddr 127.0.0.1 \
1014
- $repository --localauth --th-trace
1024
+ $repository --localauth --th-trace -expectError
10151025
10161026
set result [expr {[file exists $outFileName] ? [read_file $outFileName] : ""}]
10171027
10181028
if {1} {
10191029
catch {file delete $inFileName}
@@ -1105,10 +1115,15 @@
11051115
}
11061116
11071117
11081118
protInit $fossilexe
11091119
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
+
11101125
foreach testfile $argv {
11111126
protOut "***** $testfile ******"
11121127
if { [catch {source $testdir/$testfile.test} testerror testopts] } {
11131128
test test-framework-$testfile 0
11141129
protOut "!!!!! $testfile: $testerror"
@@ -1116,10 +1131,11 @@
11161131
} else {
11171132
test test-framework-$testfile 1
11181133
}
11191134
protOut "***** End of $testfile: [llength $bad_test] errors so far ******"
11201135
}
1136
+cd $startPwd
11211137
unset ::tempKeepHome; delete_temporary_home
11221138
11231139
# Clean up the file descriptor
11241140
close $possibly_fd0
11251141
@@ -1134,6 +1150,13 @@
11341150
if {$nErr>0 || !$::QUIET} {
11351151
protOut "***** Ignored results: $nErr ignored errors out of $test_count tests" 1
11361152
}
11371153
if {$nErr>0} {
11381154
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
11391162
}
11401163
--- 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 @@
3030
if {[normalize_result] ne "1"} {
3131
puts "Fossil was not compiled with Tcl support."
3232
test_cleanup_then_return
3333
}
3434
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
-
4335
###############################################################################
4436
45
-test_setup ""
37
+test_setup
4638
4739
###############################################################################
4840
4941
set env(TH1_ENABLE_DOCS) 1; # TH1 docs must be enabled for this test.
5042
set env(TH1_ENABLE_TCL) 1; # Tcl integration must be enabled for this test.
5143
5244
###############################################################################
5345
54
-run_in_checkout {
55
- set data [fossil info]
56
-}
46
+set data [fossil info]
5747
5848
regexp -line -- {^repository: (.*)$} $data dummy repository
5949
6050
if {[string length $repository] == 0 || ![file exists $repository]} {
6151
error "unable to locate repository"
6252
}
6353
6454
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"
6564
6665
###############################################################################
6766
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]
7269
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]}
7471
test th1-docs-1b {[regexp {>\[[0-9a-f]{40,64}\]<} $RESULT]}
7572
test th1-docs-1c {[regexp { contains \d+ files\.} $RESULT]}
7673
7774
###############################################################################
7875
7976
--- 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
--- test/th1-hooks.test
+++ test/th1-hooks.test
@@ -146,11 +146,11 @@
146146
+++ some stuff here +++
147147
<h1><b>command_hook timeline command_notify timeline</b></h1>}}
148148
149149
###############################################################################
150150
151
-fossil timeline custom3; # NOTE: Bad "WHEN" argument.
151
+fossil timeline custom3 -expectError; # NOTE: Bad "WHEN" argument.
152152
153153
test th1-cmd-hooks-1c {[normalize_result] eq \
154154
{<h1><b>command_hook timeline</b></h1>
155155
unknown check-in or invalid date: custom3}}
156156
@@ -196,11 +196,11 @@
196196
test th1-custom-cmd-3a {[string trim $RESULT] eq \
197197
{<h1><b>command_hook test3</b></h1>}}
198198
199199
###############################################################################
200200
201
-fossil test4
201
+fossil test4 -expectError
202202
203203
test th1-custom-cmd-4a {[first_data_line] eq \
204204
{<h1><b>command_hook test4</b></h1>}}
205205
206206
test th1-custom-cmd-4b {[regexp -- \
207207
--- 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
--- test/th1-tcl.test
+++ test/th1-tcl.test
@@ -129,11 +129,18 @@
129129
###############################################################################
130130
131131
fossil test-th-render --open-config \
132132
[file nativename [file join $path th1-tcl9.txt]]
133133
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 \
135142
[list test-th-render --open-config [file nativename [file join $path \
136143
th1-tcl9.txt]]]]}
137144
138145
###############################################################################
139146
140147
--- 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 @@
730730
fossil test-th-eval "trace {}"
731731
test th1-trace-1 {$RESULT eq {}}
732732
733733
###############################################################################
734734
735
-fossil test-th-eval --th-trace "trace {}"
735
+fossil test-th-eval --th-trace "trace {}" -expectError
736736
set normalized_result [normalize_result]
737737
738738
regsub -- {\n/\*\*\*\*\* Subprocess \d+ exit\(\d+\) \*\*\*\*\*/} \
739739
$normalized_result {} normalized_result
740740
@@ -758,11 +758,11 @@
758758
fossil test-th-eval "trace {this is a trace message.}"
759759
test th1-trace-3 {$RESULT eq {}}
760760
761761
###############################################################################
762762
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
764764
set normalized_result [normalize_result]
765765
766766
regsub -- {\n/\*\*\*\*\* Subprocess \d+ exit\(\d+\) \*\*\*\*\*/} \
767767
$normalized_result {} normalized_result
768768
@@ -1023,11 +1023,11 @@
10231023
fossil test-th-eval "globalState vfs"
10241024
test th1-globalState-14 {[string length $RESULT] == 0}
10251025
10261026
###############################################################################
10271027
1028
-if {$is_windows} {
1028
+if {$is_windows || $is_cygwin} {
10291029
set altVfs win32-longpath
10301030
} else {
10311031
set altVfs unix-dotfile
10321032
}
10331033
10341034
--- 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
--- test/unversioned.test
+++ test/unversioned.test
@@ -26,10 +26,13 @@
2626
}
2727
2828
require_no_open_checkout
2929
3030
test_setup; set rootDir [file normalize [pwd]]
31
+
32
+# Avoid delays from the backoffice.
33
+fossil set backoffice-disable 1
3134
3235
fossil test-th-eval --open-config {repository}
3336
set repository [normalize_result]
3437
3538
if {[string length $repository] == 0} {
@@ -46,13 +49,20 @@
4649
set env(VISUAL) [appendArgs \
4750
[info nameofexecutable] " " [file join $path fake-editor.tcl]]
4851
4952
###############################################################################
5053
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
5262
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%\
5464
unversioned add|cat|edit|export|list|revert|remove|sync|touch}]}
5565
5666
###############################################################################
5767
5868
fossil unversioned list
@@ -312,26 +322,30 @@
312322
fossil user capabilities uvtester oy
313323
314324
###############################################################################
315325
316326
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
+}
318330
set remote [appendArgs http://uvtester: $password @localhost: $port /]
319331
320332
###############################################################################
321333
322334
set clientDir [file join $tempPath [appendArgs \
323335
uvtest_ [string trim [clock seconds] -] _ [getSeqNo]]]
324336
325337
set savedPwd [pwd]
326338
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
+}
328342
write_file unversioned-client1.txt "This is unversioned client file #1."
329343
330344
###############################################################################
331345
332
-fossil_maybe_answer y clone $remote uvrepo.fossil
346
+fossil clone --save-http-password $remote uvrepo.fossil
333347
fossil open -f uvrepo.fossil
334348
335349
###############################################################################
336350
337351
fossil unversioned list
@@ -426,20 +440,24 @@
426440
427441
###############################################################################
428442
429443
cd $savedPwd; unset savedPwd
430444
file delete -force $clientDir
431
-puts [appendArgs "Now in server directory \"" [pwd] \".]
445
+if {! $::QUIET} {
446
+ puts [appendArgs "Now in server directory \"" [pwd] \".]
447
+}
432448
433449
###############################################################################
434450
435451
set stopped [test_stop_server $stopArg $pid $outTmpFile]
436452
437
-puts [appendArgs \
453
+if {! $::QUIET} {
454
+ puts [appendArgs \
438455
[expr {$stopped ? "Stopped" : "Could not stop"}] \
439456
" Fossil server, pid \"" $pid "\", using argument \"" \
440457
$stopArg \".]
458
+}
441459
442460
###############################################################################
443461
444462
fossil unversioned list
445463
test unversioned-57 {[regexp \
446464
447465
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
--- 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

Keyboard Shortcuts

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