Fossil SCM

When testing, sort glob results for consistent test ordering across OSes.

preben 2023-11-17 17:44 testing-improvements
Commit 7fc504d100eaccbd22c004759885e3fd78237c49d08efa4adce28eb4b52ceb1c
--- 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/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
--- 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

Keyboard Shortcuts

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