##// END OF EJS Templates
test-run-tests.t: add extra data to tests for keyword tests...
Augie Fackler -
r21995:20bfcb48 default
parent child Browse files
Show More
@@ -1,223 +1,249 b''
1 This file tests the behavior of run-tests.py itself.
1 This file tests the behavior of run-tests.py itself.
2
2
3 Smoke test
3 Smoke test
4 ============
4 ============
5
5
6 $ $TESTDIR/run-tests.py
6 $ $TESTDIR/run-tests.py
7
7
8 # Ran 0 tests, 0 skipped, 0 warned, 0 failed.
8 # Ran 0 tests, 0 skipped, 0 warned, 0 failed.
9
9
10 a succesful test
10 a succesful test
11 =======================
11 =======================
12
12
13 $ cat > test-success.t << EOF
13 $ cat > test-success.t << EOF
14 > $ echo babar
14 > $ echo babar
15 > babar
15 > babar
16 > $ echo xyzzy
17 > xyzzy
16 > EOF
18 > EOF
17
19
18 $ $TESTDIR/run-tests.py --with-hg=`which hg`
20 $ $TESTDIR/run-tests.py --with-hg=`which hg`
19 .
21 .
20 # Ran 1 tests, 0 skipped, 0 warned, 0 failed.
22 # Ran 1 tests, 0 skipped, 0 warned, 0 failed.
21
23
22 failing test
24 failing test
23 ==================
25 ==================
24
26
25 $ cat > test-failure.t << EOF
27 $ cat > test-failure.t << EOF
26 > $ echo babar
28 > $ echo babar
27 > rataxes
29 > rataxes
30 > This is a noop statement so that
31 > this test is still more bytes than success.
28 > EOF
32 > EOF
29
33
30 $ $TESTDIR/run-tests.py --with-hg=`which hg`
34 $ $TESTDIR/run-tests.py --with-hg=`which hg`
31
35
32 --- $TESTTMP/test-failure.t
36 --- $TESTTMP/test-failure.t
33 +++ $TESTTMP/test-failure.t.err
37 +++ $TESTTMP/test-failure.t.err
34 @@ -1,2 +1,2 @@
38 @@ -1,4 +1,4 @@
35 $ echo babar
39 $ echo babar
36 - rataxes
40 - rataxes
37 + babar
41 + babar
42 This is a noop statement so that
43 this test is still more bytes than success.
38
44
39 ERROR: test-failure.t output changed
45 ERROR: test-failure.t output changed
40 !.
46 !.
41 Failed test-failure.t: output changed
47 Failed test-failure.t: output changed
42 # Ran 2 tests, 0 skipped, 0 warned, 1 failed.
48 # Ran 2 tests, 0 skipped, 0 warned, 1 failed.
43 python hash seed: * (glob)
49 python hash seed: * (glob)
44 [1]
50 [1]
45
51
46 test for --retest
52 test for --retest
47 ====================
53 ====================
48
54
49 $ $TESTDIR/run-tests.py --with-hg=`which hg` --retest
55 $ $TESTDIR/run-tests.py --with-hg=`which hg` --retest
50
56
51 --- $TESTTMP/test-failure.t
57 --- $TESTTMP/test-failure.t
52 +++ $TESTTMP/test-failure.t.err
58 +++ $TESTTMP/test-failure.t.err
53 @@ -1,2 +1,2 @@
59 @@ -1,4 +1,4 @@
54 $ echo babar
60 $ echo babar
55 - rataxes
61 - rataxes
56 + babar
62 + babar
63 This is a noop statement so that
64 this test is still more bytes than success.
57
65
58 ERROR: test-failure.t output changed
66 ERROR: test-failure.t output changed
59 !
67 !
60 Failed test-failure.t: output changed
68 Failed test-failure.t: output changed
61 # Ran 1 tests, 1 skipped, 0 warned, 1 failed.
69 # Ran 1 tests, 1 skipped, 0 warned, 1 failed.
62 python hash seed: * (glob)
70 python hash seed: * (glob)
63 [1]
71 [1]
64
72
65 Selecting Tests To Run
73 Selecting Tests To Run
66 ======================
74 ======================
67
75
68 successful
76 successful
69
77
70 $ $TESTDIR/run-tests.py --with-hg=`which hg` test-success.t
78 $ $TESTDIR/run-tests.py --with-hg=`which hg` test-success.t
71 .
79 .
72 # Ran 1 tests, 0 skipped, 0 warned, 0 failed.
80 # Ran 1 tests, 0 skipped, 0 warned, 0 failed.
73
81
74 failed
82 failed
75
83
76 $ $TESTDIR/run-tests.py --with-hg=`which hg` test-failure.t
84 $ $TESTDIR/run-tests.py --with-hg=`which hg` test-failure.t
77
85
78 --- $TESTTMP/test-failure.t
86 --- $TESTTMP/test-failure.t
79 +++ $TESTTMP/test-failure.t.err
87 +++ $TESTTMP/test-failure.t.err
80 @@ -1,2 +1,2 @@
88 @@ -1,4 +1,4 @@
81 $ echo babar
89 $ echo babar
82 - rataxes
90 - rataxes
83 + babar
91 + babar
92 This is a noop statement so that
93 this test is still more bytes than success.
84
94
85 ERROR: test-failure.t output changed
95 ERROR: test-failure.t output changed
86 !
96 !
87 Failed test-failure.t: output changed
97 Failed test-failure.t: output changed
88 # Ran 1 tests, 0 skipped, 0 warned, 1 failed.
98 # Ran 1 tests, 0 skipped, 0 warned, 1 failed.
89 python hash seed: * (glob)
99 python hash seed: * (glob)
90 [1]
100 [1]
91
101
92 Running In Debug Mode
102 Running In Debug Mode
93 ======================
103 ======================
94
104
95 $ $TESTDIR/run-tests.py --with-hg=`which hg` --debug
105 $ $TESTDIR/run-tests.py --with-hg=`which hg` --debug
96 + echo SALT* 0 0 (glob)
106 + echo SALT* 0 0 (glob)
97 SALT* 0 0 (glob)
107 SALT* 0 0 (glob)
98 + echo babar
108 + echo babar
99 babar
109 babar
100 + echo SALT* 2 0 (glob)
110 + echo SALT* 4 0 (glob)
101 SALT* 2 0 (glob)
111 SALT* 4 0 (glob)
102 .+ echo SALT* 0 0 (glob)
112 .+ echo SALT* 0 0 (glob)
103 SALT* 0 0 (glob)
113 SALT* 0 0 (glob)
104 + echo babar
114 + echo babar
105 babar
115 babar
106 + echo SALT* 2 0 (glob)
116 + echo SALT* 2 0 (glob)
107 SALT* 2 0 (glob)
117 SALT* 2 0 (glob)
118 + echo xyzzy
119 xyzzy
120 + echo SALT* 4 0 (glob)
121 SALT* 4 0 (glob)
108 .
122 .
109 # Ran 2 tests, 0 skipped, 0 warned, 0 failed.
123 # Ran 2 tests, 0 skipped, 0 warned, 0 failed.
110
124
111 Parallel runs
125 Parallel runs
112 ==============
126 ==============
113
127
114 (duplicate the failing test to get predictable output)
128 (duplicate the failing test to get predictable output)
115 $ cp test-failure.t test-failure-copy.t
129 $ cp test-failure.t test-failure-copy.t
116
130
117 $ $TESTDIR/run-tests.py --with-hg=`which hg` --jobs 2 test-failure*.t
131 $ $TESTDIR/run-tests.py --with-hg=`which hg` --jobs 2 test-failure*.t
118
132
119 --- $TESTTMP/test-failure*.t (glob)
133 --- $TESTTMP/test-failure*.t (glob)
120 +++ $TESTTMP/test-failure*.t.err (glob)
134 +++ $TESTTMP/test-failure*.t.err (glob)
121 @@ -1,2 +1,2 @@
135 @@ -1,4 +1,4 @@
122 $ echo babar
136 $ echo babar
123 - rataxes
137 - rataxes
124 + babar
138 + babar
139 This is a noop statement so that
140 this test is still more bytes than success.
125
141
126 ERROR: test-failure*.t output changed (glob)
142 ERROR: test-failure*.t output changed (glob)
127 !
143 !
128 --- $TESTTMP/test-failure*.t (glob)
144 --- $TESTTMP/test-failure*.t (glob)
129 +++ $TESTTMP/test-failure*.t.err (glob)
145 +++ $TESTTMP/test-failure*.t.err (glob)
130 @@ -1,2 +1,2 @@
146 @@ -1,4 +1,4 @@
131 $ echo babar
147 $ echo babar
132 - rataxes
148 - rataxes
133 + babar
149 + babar
150 This is a noop statement so that
151 this test is still more bytes than success.
134
152
135 ERROR: test-failure*.t output changed (glob)
153 ERROR: test-failure*.t output changed (glob)
136 !
154 !
137 Failed test-failure*.t: output changed (glob)
155 Failed test-failure*.t: output changed (glob)
138 Failed test-failure*.t: output changed (glob)
156 Failed test-failure*.t: output changed (glob)
139 # Ran 2 tests, 0 skipped, 0 warned, 2 failed.
157 # Ran 2 tests, 0 skipped, 0 warned, 2 failed.
140 python hash seed: * (glob)
158 python hash seed: * (glob)
141 [1]
159 [1]
142
160
143 (delete the duplicated test file)
161 (delete the duplicated test file)
144 $ rm test-failure-copy.t
162 $ rm test-failure-copy.t
145
163
146
164
147 Interactive run
165 Interactive run
148 ===============
166 ===============
149
167
150 (backup the failing test)
168 (backup the failing test)
151 $ cp test-failure.t backup
169 $ cp test-failure.t backup
152
170
153 Refuse the fix
171 Refuse the fix
154
172
155 $ echo 'n' | $TESTDIR/run-tests.py --with-hg=`which hg` -i
173 $ echo 'n' | $TESTDIR/run-tests.py --with-hg=`which hg` -i
156
174
157 --- $TESTTMP/test-failure.t
175 --- $TESTTMP/test-failure.t
158 +++ $TESTTMP/test-failure.t.err
176 +++ $TESTTMP/test-failure.t.err
159 @@ -1,2 +1,2 @@
177 @@ -1,4 +1,4 @@
160 $ echo babar
178 $ echo babar
161 - rataxes
179 - rataxes
162 + babar
180 + babar
181 This is a noop statement so that
182 this test is still more bytes than success.
163 Accept this change? [n]
183 Accept this change? [n]
164 ERROR: test-failure.t output changed
184 ERROR: test-failure.t output changed
165 !.
185 !.
166 Failed test-failure.t: output changed
186 Failed test-failure.t: output changed
167 # Ran 2 tests, 0 skipped, 0 warned, 1 failed.
187 # Ran 2 tests, 0 skipped, 0 warned, 1 failed.
168 python hash seed: * (glob)
188 python hash seed: * (glob)
169 [1]
189 [1]
170
190
171 $ cat test-failure.t
191 $ cat test-failure.t
172 $ echo babar
192 $ echo babar
173 rataxes
193 rataxes
194 This is a noop statement so that
195 this test is still more bytes than success.
174
196
175 Accept the fix
197 Accept the fix
176
198
177 $ echo 'y' | $TESTDIR/run-tests.py --with-hg=`which hg` -i
199 $ echo 'y' | $TESTDIR/run-tests.py --with-hg=`which hg` -i
178
200
179 --- $TESTTMP/test-failure.t
201 --- $TESTTMP/test-failure.t
180 +++ $TESTTMP/test-failure.t.err
202 +++ $TESTTMP/test-failure.t.err
181 @@ -1,2 +1,2 @@
203 @@ -1,4 +1,4 @@
182 $ echo babar
204 $ echo babar
183 - rataxes
205 - rataxes
184 + babar
206 + babar
207 This is a noop statement so that
208 this test is still more bytes than success.
185 Accept this change? [n] ..
209 Accept this change? [n] ..
186 # Ran 2 tests, 0 skipped, 0 warned, 0 failed.
210 # Ran 2 tests, 0 skipped, 0 warned, 0 failed.
187
211
188 $ cat test-failure.t
212 $ cat test-failure.t
189 $ echo babar
213 $ echo babar
190 babar
214 babar
215 This is a noop statement so that
216 this test is still more bytes than success.
191
217
192 (reinstall)
218 (reinstall)
193 $ mv backup test-failure.t
219 $ mv backup test-failure.t
194
220
195 No Diff
221 No Diff
196 ===============
222 ===============
197
223
198 $ $TESTDIR/run-tests.py --with-hg=`which hg` --nodiff
224 $ $TESTDIR/run-tests.py --with-hg=`which hg` --nodiff
199 !.
225 !.
200 Failed test-failure.t: output changed
226 Failed test-failure.t: output changed
201 # Ran 2 tests, 0 skipped, 0 warned, 1 failed.
227 # Ran 2 tests, 0 skipped, 0 warned, 1 failed.
202 python hash seed: * (glob)
228 python hash seed: * (glob)
203 [1]
229 [1]
204
230
205 test for --time
231 test for --time
206 ==================
232 ==================
207
233
208 $ $TESTDIR/run-tests.py --with-hg=`which hg` test-success.t --time
234 $ $TESTDIR/run-tests.py --with-hg=`which hg` test-success.t --time
209 .
235 .
210 # Ran 1 tests, 0 skipped, 0 warned, 0 failed.
236 # Ran 1 tests, 0 skipped, 0 warned, 0 failed.
211 # Producing time report
237 # Producing time report
212 cuser csys real Test
238 cuser csys real Test
213 \s*[\d\.]{5} \s*[\d\.]{5} \s*[\d\.]{5} test-success.t (re)
239 \s*[\d\.]{5} \s*[\d\.]{5} \s*[\d\.]{5} test-success.t (re)
214
240
215 test for --time with --job enabled
241 test for --time with --job enabled
216 ====================================
242 ====================================
217
243
218 $ $TESTDIR/run-tests.py --with-hg=`which hg` test-success.t --time --jobs 2
244 $ $TESTDIR/run-tests.py --with-hg=`which hg` test-success.t --time --jobs 2
219 .
245 .
220 # Ran 1 tests, 0 skipped, 0 warned, 0 failed.
246 # Ran 1 tests, 0 skipped, 0 warned, 0 failed.
221 # Producing time report
247 # Producing time report
222 cuser csys real Test
248 cuser csys real Test
223 \s*[\d\.]{5} \s*[\d\.]{5} \s*[\d\.]{5} test-success.t (re)
249 \s*[\d\.]{5} \s*[\d\.]{5} \s*[\d\.]{5} test-success.t (re)
General Comments 0
You need to be logged in to leave comments. Login now