Show More
@@ -1,46 +1,52 b'' | |||||
1 | from __future__ import print_function |
|
1 | from __future__ import absolute_import, print_function | |
2 |
|
2 | |||
3 | import unittest |
|
3 | import unittest | |
4 |
|
4 | |||
5 | class TestResult(unittest._TextTestResult): |
|
5 | class TestResult(unittest._TextTestResult): | |
6 |
|
6 | |||
7 | def __init__(self, options, *args, **kwargs): |
|
7 | def __init__(self, options, *args, **kwargs): | |
8 | super(TestResult, self).__init__(*args, **kwargs) |
|
8 | super(TestResult, self).__init__(*args, **kwargs) | |
9 | self._options = options |
|
9 | self._options = options | |
10 |
|
10 | |||
11 | # unittest.TestResult didn't have skipped until 2.7. We need to |
|
11 | # unittest.TestResult didn't have skipped until 2.7. We need to | |
12 | # polyfill it. |
|
12 | # polyfill it. | |
13 | self.skipped = [] |
|
13 | self.skipped = [] | |
14 |
|
14 | |||
15 | # We have a custom "ignored" result that isn't present in any Python |
|
15 | # We have a custom "ignored" result that isn't present in any Python | |
16 | # unittest implementation. It is very similar to skipped. It may make |
|
16 | # unittest implementation. It is very similar to skipped. It may make | |
17 | # sense to map it into skip some day. |
|
17 | # sense to map it into skip some day. | |
18 | self.ignored = [] |
|
18 | self.ignored = [] | |
19 |
|
19 | |||
20 | self.times = [] |
|
20 | self.times = [] | |
21 | self._firststarttime = None |
|
21 | self._firststarttime = None | |
22 | # Data stored for the benefit of generating xunit reports. |
|
22 | # Data stored for the benefit of generating xunit reports. | |
23 | self.successes = [] |
|
23 | self.successes = [] | |
24 | self.faildata = {} |
|
24 | self.faildata = {} | |
25 |
|
25 | |||
26 | def addFailure(self, test, reason): |
|
26 | def addFailure(self, test, reason): | |
27 | print("FAILURE!", test, reason) |
|
27 | print("FAILURE!", test, reason) | |
28 |
|
28 | |||
29 | def addSuccess(self, test): |
|
29 | def addSuccess(self, test): | |
30 | print("SUCCESS!", test) |
|
30 | print("SUCCESS!", test) | |
31 |
|
31 | |||
32 | def addError(self, test, err): |
|
32 | def addError(self, test, err): | |
33 | print("ERR!", test, err) |
|
33 | print("ERR!", test, err) | |
34 |
|
34 | |||
35 | # Polyfill. |
|
35 | # Polyfill. | |
36 | def addSkip(self, test, reason): |
|
36 | def addSkip(self, test, reason): | |
37 | print("SKIP!", test, reason) |
|
37 | print("SKIP!", test, reason) | |
38 |
|
38 | |||
39 | def addIgnore(self, test, reason): |
|
39 | def addIgnore(self, test, reason): | |
40 | print("IGNORE!", test, reason) |
|
40 | print("IGNORE!", test, reason) | |
41 |
|
41 | |||
|
42 | def onStart(self, test): | |||
|
43 | print("ON_START!", test) | |||
|
44 | ||||
|
45 | def onEnd(self): | |||
|
46 | print("ON_END!") | |||
|
47 | ||||
42 | def addOutputMismatch(self, test, ret, got, expected): |
|
48 | def addOutputMismatch(self, test, ret, got, expected): | |
43 | return False |
|
49 | return False | |
44 |
|
50 | |||
45 | def stopTest(self, test, interrupted=False): |
|
51 | def stopTest(self, test, interrupted=False): | |
46 | super(TestResult, self).stopTest(test) |
|
52 | super(TestResult, self).stopTest(test) |
@@ -1,1821 +1,1823 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 | Avoid interference from actual test env: |
|
3 | Avoid interference from actual test env: | |
4 |
|
4 | |||
5 | $ . "$TESTDIR/helper-runtests.sh" |
|
5 | $ . "$TESTDIR/helper-runtests.sh" | |
6 |
|
6 | |||
7 | Smoke test with install |
|
7 | Smoke test with install | |
8 | ============ |
|
8 | ============ | |
9 | $ $PYTHON $TESTDIR/run-tests.py $HGTEST_RUN_TESTS_PURE -l |
|
9 | $ $PYTHON $TESTDIR/run-tests.py $HGTEST_RUN_TESTS_PURE -l | |
10 |
|
10 | |||
11 | # Ran 0 tests, 0 skipped, 0 failed. |
|
11 | # Ran 0 tests, 0 skipped, 0 failed. | |
12 |
|
12 | |||
13 | Define a helper to avoid the install step |
|
13 | Define a helper to avoid the install step | |
14 | ============= |
|
14 | ============= | |
15 | $ rt() |
|
15 | $ rt() | |
16 | > { |
|
16 | > { | |
17 | > $PYTHON $TESTDIR/run-tests.py --with-hg=`which hg` "$@" |
|
17 | > $PYTHON $TESTDIR/run-tests.py --with-hg=`which hg` "$@" | |
18 | > } |
|
18 | > } | |
19 |
|
19 | |||
20 | error paths |
|
20 | error paths | |
21 |
|
21 | |||
22 | #if symlink |
|
22 | #if symlink | |
23 | $ ln -s `which true` hg |
|
23 | $ ln -s `which true` hg | |
24 | $ $PYTHON $TESTDIR/run-tests.py --with-hg=./hg |
|
24 | $ $PYTHON $TESTDIR/run-tests.py --with-hg=./hg | |
25 | warning: --with-hg should specify an hg script |
|
25 | warning: --with-hg should specify an hg script | |
26 |
|
26 | |||
27 | # Ran 0 tests, 0 skipped, 0 failed. |
|
27 | # Ran 0 tests, 0 skipped, 0 failed. | |
28 | $ rm hg |
|
28 | $ rm hg | |
29 | #endif |
|
29 | #endif | |
30 |
|
30 | |||
31 | #if execbit |
|
31 | #if execbit | |
32 | $ touch hg |
|
32 | $ touch hg | |
33 | $ $PYTHON $TESTDIR/run-tests.py --with-hg=./hg |
|
33 | $ $PYTHON $TESTDIR/run-tests.py --with-hg=./hg | |
34 | usage: run-tests.py [options] [tests] |
|
34 | usage: run-tests.py [options] [tests] | |
35 | run-tests.py: error: --with-hg must specify an executable hg script |
|
35 | run-tests.py: error: --with-hg must specify an executable hg script | |
36 | [2] |
|
36 | [2] | |
37 | $ rm hg |
|
37 | $ rm hg | |
38 | #endif |
|
38 | #endif | |
39 |
|
39 | |||
40 | Features for testing optional lines |
|
40 | Features for testing optional lines | |
41 | =================================== |
|
41 | =================================== | |
42 |
|
42 | |||
43 | $ cat > hghaveaddon.py <<EOF |
|
43 | $ cat > hghaveaddon.py <<EOF | |
44 | > import hghave |
|
44 | > import hghave | |
45 | > @hghave.check("custom", "custom hghave feature") |
|
45 | > @hghave.check("custom", "custom hghave feature") | |
46 | > def has_custom(): |
|
46 | > def has_custom(): | |
47 | > return True |
|
47 | > return True | |
48 | > @hghave.check("missing", "missing hghave feature") |
|
48 | > @hghave.check("missing", "missing hghave feature") | |
49 | > def has_missing(): |
|
49 | > def has_missing(): | |
50 | > return False |
|
50 | > return False | |
51 | > EOF |
|
51 | > EOF | |
52 |
|
52 | |||
53 | an empty test |
|
53 | an empty test | |
54 | ======================= |
|
54 | ======================= | |
55 |
|
55 | |||
56 | $ touch test-empty.t |
|
56 | $ touch test-empty.t | |
57 | $ rt |
|
57 | $ rt | |
58 | . |
|
58 | . | |
59 | # Ran 1 tests, 0 skipped, 0 failed. |
|
59 | # Ran 1 tests, 0 skipped, 0 failed. | |
60 | $ rm test-empty.t |
|
60 | $ rm test-empty.t | |
61 |
|
61 | |||
62 | a succesful test |
|
62 | a succesful test | |
63 | ======================= |
|
63 | ======================= | |
64 |
|
64 | |||
65 | $ cat > test-success.t << EOF |
|
65 | $ cat > test-success.t << EOF | |
66 | > $ echo babar |
|
66 | > $ echo babar | |
67 | > babar |
|
67 | > babar | |
68 | > $ echo xyzzy |
|
68 | > $ echo xyzzy | |
69 | > dont_print (?) |
|
69 | > dont_print (?) | |
70 | > nothing[42]line (re) (?) |
|
70 | > nothing[42]line (re) (?) | |
71 | > never*happens (glob) (?) |
|
71 | > never*happens (glob) (?) | |
72 | > more_nothing (?) |
|
72 | > more_nothing (?) | |
73 | > xyzzy |
|
73 | > xyzzy | |
74 | > nor this (?) |
|
74 | > nor this (?) | |
75 | > $ printf 'abc\ndef\nxyz\n' |
|
75 | > $ printf 'abc\ndef\nxyz\n' | |
76 | > 123 (?) |
|
76 | > 123 (?) | |
77 | > abc |
|
77 | > abc | |
78 | > def (?) |
|
78 | > def (?) | |
79 | > 456 (?) |
|
79 | > 456 (?) | |
80 | > xyz |
|
80 | > xyz | |
81 | > $ printf 'zyx\nwvu\ntsr\n' |
|
81 | > $ printf 'zyx\nwvu\ntsr\n' | |
82 | > abc (?) |
|
82 | > abc (?) | |
83 | > zyx (custom !) |
|
83 | > zyx (custom !) | |
84 | > wvu |
|
84 | > wvu | |
85 | > no_print (no-custom !) |
|
85 | > no_print (no-custom !) | |
86 | > tsr (no-missing !) |
|
86 | > tsr (no-missing !) | |
87 | > missing (missing !) |
|
87 | > missing (missing !) | |
88 | > EOF |
|
88 | > EOF | |
89 |
|
89 | |||
90 | $ rt |
|
90 | $ rt | |
91 | . |
|
91 | . | |
92 | # Ran 1 tests, 0 skipped, 0 failed. |
|
92 | # Ran 1 tests, 0 skipped, 0 failed. | |
93 |
|
93 | |||
94 | failing test |
|
94 | failing test | |
95 | ================== |
|
95 | ================== | |
96 |
|
96 | |||
97 | test churn with globs |
|
97 | test churn with globs | |
98 | $ cat > test-failure.t <<EOF |
|
98 | $ cat > test-failure.t <<EOF | |
99 | > $ echo "bar-baz"; echo "bar-bad"; echo foo |
|
99 | > $ echo "bar-baz"; echo "bar-bad"; echo foo | |
100 | > bar*bad (glob) |
|
100 | > bar*bad (glob) | |
101 | > bar*baz (glob) |
|
101 | > bar*baz (glob) | |
102 | > | fo (re) |
|
102 | > | fo (re) | |
103 | > EOF |
|
103 | > EOF | |
104 | $ rt test-failure.t |
|
104 | $ rt test-failure.t | |
105 |
|
105 | |||
106 | --- $TESTTMP/test-failure.t |
|
106 | --- $TESTTMP/test-failure.t | |
107 | +++ $TESTTMP/test-failure.t.err |
|
107 | +++ $TESTTMP/test-failure.t.err | |
108 | @@ -1,4 +1,4 @@ |
|
108 | @@ -1,4 +1,4 @@ | |
109 | $ echo "bar-baz"; echo "bar-bad"; echo foo |
|
109 | $ echo "bar-baz"; echo "bar-bad"; echo foo | |
110 | + bar*baz (glob) |
|
110 | + bar*baz (glob) | |
111 | bar*bad (glob) |
|
111 | bar*bad (glob) | |
112 | - bar*baz (glob) |
|
112 | - bar*baz (glob) | |
113 | - | fo (re) |
|
113 | - | fo (re) | |
114 | + foo |
|
114 | + foo | |
115 |
|
115 | |||
116 | ERROR: test-failure.t output changed |
|
116 | ERROR: test-failure.t output changed | |
117 | ! |
|
117 | ! | |
118 | Failed test-failure.t: output changed |
|
118 | Failed test-failure.t: output changed | |
119 | # Ran 1 tests, 0 skipped, 1 failed. |
|
119 | # Ran 1 tests, 0 skipped, 1 failed. | |
120 | python hash seed: * (glob) |
|
120 | python hash seed: * (glob) | |
121 | [1] |
|
121 | [1] | |
122 |
|
122 | |||
123 | test how multiple globs gets matched with lines in output |
|
123 | test how multiple globs gets matched with lines in output | |
124 | $ cat > test-failure-globs.t <<EOF |
|
124 | $ cat > test-failure-globs.t <<EOF | |
125 | > $ echo "context"; echo "context"; \ |
|
125 | > $ echo "context"; echo "context"; \ | |
126 | > echo "key: 1"; echo "value: not a"; \ |
|
126 | > echo "key: 1"; echo "value: not a"; \ | |
127 | > echo "key: 2"; echo "value: not b"; \ |
|
127 | > echo "key: 2"; echo "value: not b"; \ | |
128 | > echo "key: 3"; echo "value: c"; \ |
|
128 | > echo "key: 3"; echo "value: c"; \ | |
129 | > echo "key: 4"; echo "value: d" |
|
129 | > echo "key: 4"; echo "value: d" | |
130 | > context |
|
130 | > context | |
131 | > context |
|
131 | > context | |
132 | > key: 1 |
|
132 | > key: 1 | |
133 | > value: a |
|
133 | > value: a | |
134 | > key: 2 |
|
134 | > key: 2 | |
135 | > value: b |
|
135 | > value: b | |
136 | > key: 3 |
|
136 | > key: 3 | |
137 | > value: * (glob) |
|
137 | > value: * (glob) | |
138 | > key: 4 |
|
138 | > key: 4 | |
139 | > value: * (glob) |
|
139 | > value: * (glob) | |
140 | > EOF |
|
140 | > EOF | |
141 | $ rt test-failure-globs.t |
|
141 | $ rt test-failure-globs.t | |
142 |
|
142 | |||
143 | --- $TESTTMP/test-failure-globs.t |
|
143 | --- $TESTTMP/test-failure-globs.t | |
144 | +++ $TESTTMP/test-failure-globs.t.err |
|
144 | +++ $TESTTMP/test-failure-globs.t.err | |
145 | @@ -2,9 +2,9 @@ |
|
145 | @@ -2,9 +2,9 @@ | |
146 | context |
|
146 | context | |
147 | context |
|
147 | context | |
148 | key: 1 |
|
148 | key: 1 | |
149 | - value: a |
|
149 | - value: a | |
150 | + value: not a |
|
150 | + value: not a | |
151 | key: 2 |
|
151 | key: 2 | |
152 | - value: b |
|
152 | - value: b | |
153 | + value: not b |
|
153 | + value: not b | |
154 | key: 3 |
|
154 | key: 3 | |
155 | value: * (glob) |
|
155 | value: * (glob) | |
156 | key: 4 |
|
156 | key: 4 | |
157 |
|
157 | |||
158 | ERROR: test-failure-globs.t output changed |
|
158 | ERROR: test-failure-globs.t output changed | |
159 | ! |
|
159 | ! | |
160 | Failed test-failure-globs.t: output changed |
|
160 | Failed test-failure-globs.t: output changed | |
161 | # Ran 1 tests, 0 skipped, 1 failed. |
|
161 | # Ran 1 tests, 0 skipped, 1 failed. | |
162 | python hash seed: * (glob) |
|
162 | python hash seed: * (glob) | |
163 | [1] |
|
163 | [1] | |
164 | $ rm test-failure-globs.t |
|
164 | $ rm test-failure-globs.t | |
165 |
|
165 | |||
166 | test diff colorisation |
|
166 | test diff colorisation | |
167 |
|
167 | |||
168 | #if no-windows pygments |
|
168 | #if no-windows pygments | |
169 | $ rt test-failure.t --color always |
|
169 | $ rt test-failure.t --color always | |
170 |
|
170 | |||
171 | \x1b[38;5;124m--- $TESTTMP/test-failure.t\x1b[39m (esc) |
|
171 | \x1b[38;5;124m--- $TESTTMP/test-failure.t\x1b[39m (esc) | |
172 | \x1b[38;5;34m+++ $TESTTMP/test-failure.t.err\x1b[39m (esc) |
|
172 | \x1b[38;5;34m+++ $TESTTMP/test-failure.t.err\x1b[39m (esc) | |
173 | \x1b[38;5;90;01m@@ -1,4 +1,4 @@\x1b[39;00m (esc) |
|
173 | \x1b[38;5;90;01m@@ -1,4 +1,4 @@\x1b[39;00m (esc) | |
174 | $ echo "bar-baz"; echo "bar-bad"; echo foo |
|
174 | $ echo "bar-baz"; echo "bar-bad"; echo foo | |
175 | \x1b[38;5;34m+ bar*baz (glob)\x1b[39m (esc) |
|
175 | \x1b[38;5;34m+ bar*baz (glob)\x1b[39m (esc) | |
176 | bar*bad (glob) |
|
176 | bar*bad (glob) | |
177 | \x1b[38;5;124m- bar*baz (glob)\x1b[39m (esc) |
|
177 | \x1b[38;5;124m- bar*baz (glob)\x1b[39m (esc) | |
178 | \x1b[38;5;124m- | fo (re)\x1b[39m (esc) |
|
178 | \x1b[38;5;124m- | fo (re)\x1b[39m (esc) | |
179 | \x1b[38;5;34m+ foo\x1b[39m (esc) |
|
179 | \x1b[38;5;34m+ foo\x1b[39m (esc) | |
180 |
|
180 | |||
181 | \x1b[38;5;88mERROR: \x1b[39m\x1b[38;5;9mtest-failure.t\x1b[39m\x1b[38;5;88m output changed\x1b[39m (esc) |
|
181 | \x1b[38;5;88mERROR: \x1b[39m\x1b[38;5;9mtest-failure.t\x1b[39m\x1b[38;5;88m output changed\x1b[39m (esc) | |
182 | ! |
|
182 | ! | |
183 | \x1b[38;5;88mFailed \x1b[39m\x1b[38;5;9mtest-failure.t\x1b[39m\x1b[38;5;88m: output changed\x1b[39m (esc) |
|
183 | \x1b[38;5;88mFailed \x1b[39m\x1b[38;5;9mtest-failure.t\x1b[39m\x1b[38;5;88m: output changed\x1b[39m (esc) | |
184 | # Ran 1 tests, 0 skipped, 1 failed. |
|
184 | # Ran 1 tests, 0 skipped, 1 failed. | |
185 | python hash seed: * (glob) |
|
185 | python hash seed: * (glob) | |
186 | [1] |
|
186 | [1] | |
187 |
|
187 | |||
188 | $ rt test-failure.t 2> tmp.log |
|
188 | $ rt test-failure.t 2> tmp.log | |
189 | [1] |
|
189 | [1] | |
190 | $ cat tmp.log |
|
190 | $ cat tmp.log | |
191 |
|
191 | |||
192 | --- $TESTTMP/test-failure.t |
|
192 | --- $TESTTMP/test-failure.t | |
193 | +++ $TESTTMP/test-failure.t.err |
|
193 | +++ $TESTTMP/test-failure.t.err | |
194 | @@ -1,4 +1,4 @@ |
|
194 | @@ -1,4 +1,4 @@ | |
195 | $ echo "bar-baz"; echo "bar-bad"; echo foo |
|
195 | $ echo "bar-baz"; echo "bar-bad"; echo foo | |
196 | + bar*baz (glob) |
|
196 | + bar*baz (glob) | |
197 | bar*bad (glob) |
|
197 | bar*bad (glob) | |
198 | - bar*baz (glob) |
|
198 | - bar*baz (glob) | |
199 | - | fo (re) |
|
199 | - | fo (re) | |
200 | + foo |
|
200 | + foo | |
201 |
|
201 | |||
202 | ERROR: test-failure.t output changed |
|
202 | ERROR: test-failure.t output changed | |
203 | ! |
|
203 | ! | |
204 | Failed test-failure.t: output changed |
|
204 | Failed test-failure.t: output changed | |
205 | # Ran 1 tests, 0 skipped, 1 failed. |
|
205 | # Ran 1 tests, 0 skipped, 1 failed. | |
206 | python hash seed: * (glob) |
|
206 | python hash seed: * (glob) | |
207 | #endif |
|
207 | #endif | |
208 |
|
208 | |||
209 | $ cat > test-failure.t << EOF |
|
209 | $ cat > test-failure.t << EOF | |
210 | > $ true |
|
210 | > $ true | |
211 | > should go away (true !) |
|
211 | > should go away (true !) | |
212 | > $ true |
|
212 | > $ true | |
213 | > should stay (false !) |
|
213 | > should stay (false !) | |
214 | > |
|
214 | > | |
215 | > Should remove first line, not second or third |
|
215 | > Should remove first line, not second or third | |
216 | > $ echo 'testing' |
|
216 | > $ echo 'testing' | |
217 | > baz*foo (glob) (true !) |
|
217 | > baz*foo (glob) (true !) | |
218 | > foobar*foo (glob) (false !) |
|
218 | > foobar*foo (glob) (false !) | |
219 | > te*ting (glob) (true !) |
|
219 | > te*ting (glob) (true !) | |
220 | > |
|
220 | > | |
221 | > Should keep first two lines, remove third and last |
|
221 | > Should keep first two lines, remove third and last | |
222 | > $ echo 'testing' |
|
222 | > $ echo 'testing' | |
223 | > test.ng (re) (true !) |
|
223 | > test.ng (re) (true !) | |
224 | > foo.ar (re) (false !) |
|
224 | > foo.ar (re) (false !) | |
225 | > b.r (re) (true !) |
|
225 | > b.r (re) (true !) | |
226 | > missing (?) |
|
226 | > missing (?) | |
227 | > awol (true !) |
|
227 | > awol (true !) | |
228 | > |
|
228 | > | |
229 | > The "missing" line should stay, even though awol is dropped |
|
229 | > The "missing" line should stay, even though awol is dropped | |
230 | > $ echo 'testing' |
|
230 | > $ echo 'testing' | |
231 | > test.ng (re) (true !) |
|
231 | > test.ng (re) (true !) | |
232 | > foo.ar (?) |
|
232 | > foo.ar (?) | |
233 | > awol |
|
233 | > awol | |
234 | > missing (?) |
|
234 | > missing (?) | |
235 | > EOF |
|
235 | > EOF | |
236 | $ rt test-failure.t |
|
236 | $ rt test-failure.t | |
237 |
|
237 | |||
238 | --- $TESTTMP/test-failure.t |
|
238 | --- $TESTTMP/test-failure.t | |
239 | +++ $TESTTMP/test-failure.t.err |
|
239 | +++ $TESTTMP/test-failure.t.err | |
240 | @@ -1,11 +1,9 @@ |
|
240 | @@ -1,11 +1,9 @@ | |
241 | $ true |
|
241 | $ true | |
242 | - should go away (true !) |
|
242 | - should go away (true !) | |
243 | $ true |
|
243 | $ true | |
244 | should stay (false !) |
|
244 | should stay (false !) | |
245 |
|
245 | |||
246 | Should remove first line, not second or third |
|
246 | Should remove first line, not second or third | |
247 | $ echo 'testing' |
|
247 | $ echo 'testing' | |
248 | - baz*foo (glob) (true !) |
|
248 | - baz*foo (glob) (true !) | |
249 | foobar*foo (glob) (false !) |
|
249 | foobar*foo (glob) (false !) | |
250 | te*ting (glob) (true !) |
|
250 | te*ting (glob) (true !) | |
251 |
|
251 | |||
252 | foo.ar (re) (false !) |
|
252 | foo.ar (re) (false !) | |
253 | missing (?) |
|
253 | missing (?) | |
254 | @@ -13,13 +11,10 @@ |
|
254 | @@ -13,13 +11,10 @@ | |
255 | $ echo 'testing' |
|
255 | $ echo 'testing' | |
256 | test.ng (re) (true !) |
|
256 | test.ng (re) (true !) | |
257 | foo.ar (re) (false !) |
|
257 | foo.ar (re) (false !) | |
258 | - b.r (re) (true !) |
|
258 | - b.r (re) (true !) | |
259 | missing (?) |
|
259 | missing (?) | |
260 | - awol (true !) |
|
260 | - awol (true !) | |
261 |
|
261 | |||
262 | The "missing" line should stay, even though awol is dropped |
|
262 | The "missing" line should stay, even though awol is dropped | |
263 | $ echo 'testing' |
|
263 | $ echo 'testing' | |
264 | test.ng (re) (true !) |
|
264 | test.ng (re) (true !) | |
265 | foo.ar (?) |
|
265 | foo.ar (?) | |
266 | - awol |
|
266 | - awol | |
267 | missing (?) |
|
267 | missing (?) | |
268 |
|
268 | |||
269 | ERROR: test-failure.t output changed |
|
269 | ERROR: test-failure.t output changed | |
270 | ! |
|
270 | ! | |
271 | Failed test-failure.t: output changed |
|
271 | Failed test-failure.t: output changed | |
272 | # Ran 1 tests, 0 skipped, 1 failed. |
|
272 | # Ran 1 tests, 0 skipped, 1 failed. | |
273 | python hash seed: * (glob) |
|
273 | python hash seed: * (glob) | |
274 | [1] |
|
274 | [1] | |
275 |
|
275 | |||
276 | basic failing test |
|
276 | basic failing test | |
277 | $ cat > test-failure.t << EOF |
|
277 | $ cat > test-failure.t << EOF | |
278 | > $ echo babar |
|
278 | > $ echo babar | |
279 | > rataxes |
|
279 | > rataxes | |
280 | > This is a noop statement so that |
|
280 | > This is a noop statement so that | |
281 | > this test is still more bytes than success. |
|
281 | > this test is still more bytes than success. | |
282 | > pad pad pad pad............................................................ |
|
282 | > pad pad pad pad............................................................ | |
283 | > pad pad pad pad............................................................ |
|
283 | > pad pad pad pad............................................................ | |
284 | > pad pad pad pad............................................................ |
|
284 | > pad pad pad pad............................................................ | |
285 | > pad pad pad pad............................................................ |
|
285 | > pad pad pad pad............................................................ | |
286 | > pad pad pad pad............................................................ |
|
286 | > pad pad pad pad............................................................ | |
287 | > pad pad pad pad............................................................ |
|
287 | > pad pad pad pad............................................................ | |
288 | > EOF |
|
288 | > EOF | |
289 |
|
289 | |||
290 | >>> fh = open('test-failure-unicode.t', 'wb') |
|
290 | >>> fh = open('test-failure-unicode.t', 'wb') | |
291 | >>> fh.write(u' $ echo babar\u03b1\n'.encode('utf-8')) and None |
|
291 | >>> fh.write(u' $ echo babar\u03b1\n'.encode('utf-8')) and None | |
292 | >>> fh.write(u' l\u03b5\u03b5t\n'.encode('utf-8')) and None |
|
292 | >>> fh.write(u' l\u03b5\u03b5t\n'.encode('utf-8')) and None | |
293 |
|
293 | |||
294 | $ rt |
|
294 | $ rt | |
295 |
|
295 | |||
296 | --- $TESTTMP/test-failure.t |
|
296 | --- $TESTTMP/test-failure.t | |
297 | +++ $TESTTMP/test-failure.t.err |
|
297 | +++ $TESTTMP/test-failure.t.err | |
298 | @@ -1,5 +1,5 @@ |
|
298 | @@ -1,5 +1,5 @@ | |
299 | $ echo babar |
|
299 | $ echo babar | |
300 | - rataxes |
|
300 | - rataxes | |
301 | + babar |
|
301 | + babar | |
302 | This is a noop statement so that |
|
302 | This is a noop statement so that | |
303 | this test is still more bytes than success. |
|
303 | this test is still more bytes than success. | |
304 | pad pad pad pad............................................................ |
|
304 | pad pad pad pad............................................................ | |
305 |
|
305 | |||
306 | ERROR: test-failure.t output changed |
|
306 | ERROR: test-failure.t output changed | |
307 | !. |
|
307 | !. | |
308 | --- $TESTTMP/test-failure-unicode.t |
|
308 | --- $TESTTMP/test-failure-unicode.t | |
309 | +++ $TESTTMP/test-failure-unicode.t.err |
|
309 | +++ $TESTTMP/test-failure-unicode.t.err | |
310 | @@ -1,2 +1,2 @@ |
|
310 | @@ -1,2 +1,2 @@ | |
311 | $ echo babar\xce\xb1 (esc) |
|
311 | $ echo babar\xce\xb1 (esc) | |
312 | - l\xce\xb5\xce\xb5t (esc) |
|
312 | - l\xce\xb5\xce\xb5t (esc) | |
313 | + babar\xce\xb1 (esc) |
|
313 | + babar\xce\xb1 (esc) | |
314 |
|
314 | |||
315 | ERROR: test-failure-unicode.t output changed |
|
315 | ERROR: test-failure-unicode.t output changed | |
316 | ! |
|
316 | ! | |
317 | Failed test-failure.t: output changed |
|
317 | Failed test-failure.t: output changed | |
318 | Failed test-failure-unicode.t: output changed |
|
318 | Failed test-failure-unicode.t: output changed | |
319 | # Ran 3 tests, 0 skipped, 2 failed. |
|
319 | # Ran 3 tests, 0 skipped, 2 failed. | |
320 | python hash seed: * (glob) |
|
320 | python hash seed: * (glob) | |
321 | [1] |
|
321 | [1] | |
322 |
|
322 | |||
323 | test --outputdir |
|
323 | test --outputdir | |
324 | $ mkdir output |
|
324 | $ mkdir output | |
325 | $ rt --outputdir output |
|
325 | $ rt --outputdir output | |
326 |
|
326 | |||
327 | --- $TESTTMP/test-failure.t |
|
327 | --- $TESTTMP/test-failure.t | |
328 | +++ $TESTTMP/output/test-failure.t.err |
|
328 | +++ $TESTTMP/output/test-failure.t.err | |
329 | @@ -1,5 +1,5 @@ |
|
329 | @@ -1,5 +1,5 @@ | |
330 | $ echo babar |
|
330 | $ echo babar | |
331 | - rataxes |
|
331 | - rataxes | |
332 | + babar |
|
332 | + babar | |
333 | This is a noop statement so that |
|
333 | This is a noop statement so that | |
334 | this test is still more bytes than success. |
|
334 | this test is still more bytes than success. | |
335 | pad pad pad pad............................................................ |
|
335 | pad pad pad pad............................................................ | |
336 |
|
336 | |||
337 | ERROR: test-failure.t output changed |
|
337 | ERROR: test-failure.t output changed | |
338 | !. |
|
338 | !. | |
339 | --- $TESTTMP/test-failure-unicode.t |
|
339 | --- $TESTTMP/test-failure-unicode.t | |
340 | +++ $TESTTMP/output/test-failure-unicode.t.err |
|
340 | +++ $TESTTMP/output/test-failure-unicode.t.err | |
341 | @@ -1,2 +1,2 @@ |
|
341 | @@ -1,2 +1,2 @@ | |
342 | $ echo babar\xce\xb1 (esc) |
|
342 | $ echo babar\xce\xb1 (esc) | |
343 | - l\xce\xb5\xce\xb5t (esc) |
|
343 | - l\xce\xb5\xce\xb5t (esc) | |
344 | + babar\xce\xb1 (esc) |
|
344 | + babar\xce\xb1 (esc) | |
345 |
|
345 | |||
346 | ERROR: test-failure-unicode.t output changed |
|
346 | ERROR: test-failure-unicode.t output changed | |
347 | ! |
|
347 | ! | |
348 | Failed test-failure.t: output changed |
|
348 | Failed test-failure.t: output changed | |
349 | Failed test-failure-unicode.t: output changed |
|
349 | Failed test-failure-unicode.t: output changed | |
350 | # Ran 3 tests, 0 skipped, 2 failed. |
|
350 | # Ran 3 tests, 0 skipped, 2 failed. | |
351 | python hash seed: * (glob) |
|
351 | python hash seed: * (glob) | |
352 | [1] |
|
352 | [1] | |
353 | $ ls -a output |
|
353 | $ ls -a output | |
354 | . |
|
354 | . | |
355 | .. |
|
355 | .. | |
356 | .testtimes |
|
356 | .testtimes | |
357 | test-failure-unicode.t.err |
|
357 | test-failure-unicode.t.err | |
358 | test-failure.t.err |
|
358 | test-failure.t.err | |
359 |
|
359 | |||
360 | test --xunit support |
|
360 | test --xunit support | |
361 | $ rt --xunit=xunit.xml |
|
361 | $ rt --xunit=xunit.xml | |
362 |
|
362 | |||
363 | --- $TESTTMP/test-failure.t |
|
363 | --- $TESTTMP/test-failure.t | |
364 | +++ $TESTTMP/test-failure.t.err |
|
364 | +++ $TESTTMP/test-failure.t.err | |
365 | @@ -1,5 +1,5 @@ |
|
365 | @@ -1,5 +1,5 @@ | |
366 | $ echo babar |
|
366 | $ echo babar | |
367 | - rataxes |
|
367 | - rataxes | |
368 | + babar |
|
368 | + babar | |
369 | This is a noop statement so that |
|
369 | This is a noop statement so that | |
370 | this test is still more bytes than success. |
|
370 | this test is still more bytes than success. | |
371 | pad pad pad pad............................................................ |
|
371 | pad pad pad pad............................................................ | |
372 |
|
372 | |||
373 | ERROR: test-failure.t output changed |
|
373 | ERROR: test-failure.t output changed | |
374 | !. |
|
374 | !. | |
375 | --- $TESTTMP/test-failure-unicode.t |
|
375 | --- $TESTTMP/test-failure-unicode.t | |
376 | +++ $TESTTMP/test-failure-unicode.t.err |
|
376 | +++ $TESTTMP/test-failure-unicode.t.err | |
377 | @@ -1,2 +1,2 @@ |
|
377 | @@ -1,2 +1,2 @@ | |
378 | $ echo babar\xce\xb1 (esc) |
|
378 | $ echo babar\xce\xb1 (esc) | |
379 | - l\xce\xb5\xce\xb5t (esc) |
|
379 | - l\xce\xb5\xce\xb5t (esc) | |
380 | + babar\xce\xb1 (esc) |
|
380 | + babar\xce\xb1 (esc) | |
381 |
|
381 | |||
382 | ERROR: test-failure-unicode.t output changed |
|
382 | ERROR: test-failure-unicode.t output changed | |
383 | ! |
|
383 | ! | |
384 | Failed test-failure.t: output changed |
|
384 | Failed test-failure.t: output changed | |
385 | Failed test-failure-unicode.t: output changed |
|
385 | Failed test-failure-unicode.t: output changed | |
386 | # Ran 3 tests, 0 skipped, 2 failed. |
|
386 | # Ran 3 tests, 0 skipped, 2 failed. | |
387 | python hash seed: * (glob) |
|
387 | python hash seed: * (glob) | |
388 | [1] |
|
388 | [1] | |
389 | $ cat xunit.xml |
|
389 | $ cat xunit.xml | |
390 | <?xml version="1.0" encoding="utf-8"?> |
|
390 | <?xml version="1.0" encoding="utf-8"?> | |
391 | <testsuite errors="0" failures="2" name="run-tests" skipped="0" tests="3"> |
|
391 | <testsuite errors="0" failures="2" name="run-tests" skipped="0" tests="3"> | |
392 | <testcase name="test-success.t" time="*"/> (glob) |
|
392 | <testcase name="test-success.t" time="*"/> (glob) | |
393 | <testcase name="test-failure-unicode.t" time="*"> (glob) |
|
393 | <testcase name="test-failure-unicode.t" time="*"> (glob) | |
394 | <failure message="output changed" type="output-mismatch"> |
|
394 | <failure message="output changed" type="output-mismatch"> | |
395 | <![CDATA[--- $TESTTMP/test-failure-unicode.t |
|
395 | <![CDATA[--- $TESTTMP/test-failure-unicode.t | |
396 | +++ $TESTTMP/test-failure-unicode.t.err |
|
396 | +++ $TESTTMP/test-failure-unicode.t.err | |
397 | @@ -1,2 +1,2 @@ |
|
397 | @@ -1,2 +1,2 @@ | |
398 | $ echo babar\xce\xb1 (esc) |
|
398 | $ echo babar\xce\xb1 (esc) | |
399 | - l\xce\xb5\xce\xb5t (esc) |
|
399 | - l\xce\xb5\xce\xb5t (esc) | |
400 | + babar\xce\xb1 (esc) |
|
400 | + babar\xce\xb1 (esc) | |
401 | ]]> </failure> |
|
401 | ]]> </failure> | |
402 | </testcase> |
|
402 | </testcase> | |
403 | <testcase name="test-failure.t" time="*"> (glob) |
|
403 | <testcase name="test-failure.t" time="*"> (glob) | |
404 | <failure message="output changed" type="output-mismatch"> |
|
404 | <failure message="output changed" type="output-mismatch"> | |
405 | <![CDATA[--- $TESTTMP/test-failure.t |
|
405 | <![CDATA[--- $TESTTMP/test-failure.t | |
406 | +++ $TESTTMP/test-failure.t.err |
|
406 | +++ $TESTTMP/test-failure.t.err | |
407 | @@ -1,5 +1,5 @@ |
|
407 | @@ -1,5 +1,5 @@ | |
408 | $ echo babar |
|
408 | $ echo babar | |
409 | - rataxes |
|
409 | - rataxes | |
410 | + babar |
|
410 | + babar | |
411 | This is a noop statement so that |
|
411 | This is a noop statement so that | |
412 | this test is still more bytes than success. |
|
412 | this test is still more bytes than success. | |
413 | pad pad pad pad............................................................ |
|
413 | pad pad pad pad............................................................ | |
414 | ]]> </failure> |
|
414 | ]]> </failure> | |
415 | </testcase> |
|
415 | </testcase> | |
416 | </testsuite> |
|
416 | </testsuite> | |
417 |
|
417 | |||
418 | $ cat .testtimes |
|
418 | $ cat .testtimes | |
419 | test-empty.t * (glob) |
|
419 | test-empty.t * (glob) | |
420 | test-failure-globs.t * (glob) |
|
420 | test-failure-globs.t * (glob) | |
421 | test-failure-unicode.t * (glob) |
|
421 | test-failure-unicode.t * (glob) | |
422 | test-failure.t * (glob) |
|
422 | test-failure.t * (glob) | |
423 | test-success.t * (glob) |
|
423 | test-success.t * (glob) | |
424 |
|
424 | |||
425 | $ rt --list-tests |
|
425 | $ rt --list-tests | |
426 | test-failure-unicode.t |
|
426 | test-failure-unicode.t | |
427 | test-failure.t |
|
427 | test-failure.t | |
428 | test-success.t |
|
428 | test-success.t | |
429 |
|
429 | |||
430 | $ rt --list-tests --json |
|
430 | $ rt --list-tests --json | |
431 | test-failure-unicode.t |
|
431 | test-failure-unicode.t | |
432 | test-failure.t |
|
432 | test-failure.t | |
433 | test-success.t |
|
433 | test-success.t | |
434 | $ cat report.json |
|
434 | $ cat report.json | |
435 | testreport ={ |
|
435 | testreport ={ | |
436 | "test-failure-unicode.t": { |
|
436 | "test-failure-unicode.t": { | |
437 | "result": "success" |
|
437 | "result": "success" | |
438 | }, |
|
438 | }, | |
439 | "test-failure.t": { |
|
439 | "test-failure.t": { | |
440 | "result": "success" |
|
440 | "result": "success" | |
441 | }, |
|
441 | }, | |
442 | "test-success.t": { |
|
442 | "test-success.t": { | |
443 | "result": "success" |
|
443 | "result": "success" | |
444 | } |
|
444 | } | |
445 | } (no-eol) |
|
445 | } (no-eol) | |
446 |
|
446 | |||
447 | $ rt --list-tests --xunit=xunit.xml |
|
447 | $ rt --list-tests --xunit=xunit.xml | |
448 | test-failure-unicode.t |
|
448 | test-failure-unicode.t | |
449 | test-failure.t |
|
449 | test-failure.t | |
450 | test-success.t |
|
450 | test-success.t | |
451 | $ cat xunit.xml |
|
451 | $ cat xunit.xml | |
452 | <?xml version="1.0" encoding="utf-8"?> |
|
452 | <?xml version="1.0" encoding="utf-8"?> | |
453 | <testsuite errors="0" failures="0" name="run-tests" skipped="0" tests="0"> |
|
453 | <testsuite errors="0" failures="0" name="run-tests" skipped="0" tests="0"> | |
454 | <testcase name="test-failure-unicode.t"/> |
|
454 | <testcase name="test-failure-unicode.t"/> | |
455 | <testcase name="test-failure.t"/> |
|
455 | <testcase name="test-failure.t"/> | |
456 | <testcase name="test-success.t"/> |
|
456 | <testcase name="test-success.t"/> | |
457 | </testsuite> |
|
457 | </testsuite> | |
458 |
|
458 | |||
459 | $ rt --list-tests test-failure* --json --xunit=xunit.xml --outputdir output |
|
459 | $ rt --list-tests test-failure* --json --xunit=xunit.xml --outputdir output | |
460 | test-failure-unicode.t |
|
460 | test-failure-unicode.t | |
461 | test-failure.t |
|
461 | test-failure.t | |
462 | $ cat output/report.json |
|
462 | $ cat output/report.json | |
463 | testreport ={ |
|
463 | testreport ={ | |
464 | "test-failure-unicode.t": { |
|
464 | "test-failure-unicode.t": { | |
465 | "result": "success" |
|
465 | "result": "success" | |
466 | }, |
|
466 | }, | |
467 | "test-failure.t": { |
|
467 | "test-failure.t": { | |
468 | "result": "success" |
|
468 | "result": "success" | |
469 | } |
|
469 | } | |
470 | } (no-eol) |
|
470 | } (no-eol) | |
471 | $ cat xunit.xml |
|
471 | $ cat xunit.xml | |
472 | <?xml version="1.0" encoding="utf-8"?> |
|
472 | <?xml version="1.0" encoding="utf-8"?> | |
473 | <testsuite errors="0" failures="0" name="run-tests" skipped="0" tests="0"> |
|
473 | <testsuite errors="0" failures="0" name="run-tests" skipped="0" tests="0"> | |
474 | <testcase name="test-failure-unicode.t"/> |
|
474 | <testcase name="test-failure-unicode.t"/> | |
475 | <testcase name="test-failure.t"/> |
|
475 | <testcase name="test-failure.t"/> | |
476 | </testsuite> |
|
476 | </testsuite> | |
477 |
|
477 | |||
478 | $ rm test-failure-unicode.t |
|
478 | $ rm test-failure-unicode.t | |
479 |
|
479 | |||
480 | test for --retest |
|
480 | test for --retest | |
481 | ==================== |
|
481 | ==================== | |
482 |
|
482 | |||
483 | $ rt --retest |
|
483 | $ rt --retest | |
484 |
|
484 | |||
485 | --- $TESTTMP/test-failure.t |
|
485 | --- $TESTTMP/test-failure.t | |
486 | +++ $TESTTMP/test-failure.t.err |
|
486 | +++ $TESTTMP/test-failure.t.err | |
487 | @@ -1,5 +1,5 @@ |
|
487 | @@ -1,5 +1,5 @@ | |
488 | $ echo babar |
|
488 | $ echo babar | |
489 | - rataxes |
|
489 | - rataxes | |
490 | + babar |
|
490 | + babar | |
491 | This is a noop statement so that |
|
491 | This is a noop statement so that | |
492 | this test is still more bytes than success. |
|
492 | this test is still more bytes than success. | |
493 | pad pad pad pad............................................................ |
|
493 | pad pad pad pad............................................................ | |
494 |
|
494 | |||
495 | ERROR: test-failure.t output changed |
|
495 | ERROR: test-failure.t output changed | |
496 | ! |
|
496 | ! | |
497 | Failed test-failure.t: output changed |
|
497 | Failed test-failure.t: output changed | |
498 | # Ran 2 tests, 1 skipped, 1 failed. |
|
498 | # Ran 2 tests, 1 skipped, 1 failed. | |
499 | python hash seed: * (glob) |
|
499 | python hash seed: * (glob) | |
500 | [1] |
|
500 | [1] | |
501 |
|
501 | |||
502 | --retest works with --outputdir |
|
502 | --retest works with --outputdir | |
503 | $ rm -r output |
|
503 | $ rm -r output | |
504 | $ mkdir output |
|
504 | $ mkdir output | |
505 | $ mv test-failure.t.err output |
|
505 | $ mv test-failure.t.err output | |
506 | $ rt --retest --outputdir output |
|
506 | $ rt --retest --outputdir output | |
507 |
|
507 | |||
508 | --- $TESTTMP/test-failure.t |
|
508 | --- $TESTTMP/test-failure.t | |
509 | +++ $TESTTMP/output/test-failure.t.err |
|
509 | +++ $TESTTMP/output/test-failure.t.err | |
510 | @@ -1,5 +1,5 @@ |
|
510 | @@ -1,5 +1,5 @@ | |
511 | $ echo babar |
|
511 | $ echo babar | |
512 | - rataxes |
|
512 | - rataxes | |
513 | + babar |
|
513 | + babar | |
514 | This is a noop statement so that |
|
514 | This is a noop statement so that | |
515 | this test is still more bytes than success. |
|
515 | this test is still more bytes than success. | |
516 | pad pad pad pad............................................................ |
|
516 | pad pad pad pad............................................................ | |
517 |
|
517 | |||
518 | ERROR: test-failure.t output changed |
|
518 | ERROR: test-failure.t output changed | |
519 | ! |
|
519 | ! | |
520 | Failed test-failure.t: output changed |
|
520 | Failed test-failure.t: output changed | |
521 | # Ran 2 tests, 1 skipped, 1 failed. |
|
521 | # Ran 2 tests, 1 skipped, 1 failed. | |
522 | python hash seed: * (glob) |
|
522 | python hash seed: * (glob) | |
523 | [1] |
|
523 | [1] | |
524 |
|
524 | |||
525 | Selecting Tests To Run |
|
525 | Selecting Tests To Run | |
526 | ====================== |
|
526 | ====================== | |
527 |
|
527 | |||
528 | successful |
|
528 | successful | |
529 |
|
529 | |||
530 | $ rt test-success.t |
|
530 | $ rt test-success.t | |
531 | . |
|
531 | . | |
532 | # Ran 1 tests, 0 skipped, 0 failed. |
|
532 | # Ran 1 tests, 0 skipped, 0 failed. | |
533 |
|
533 | |||
534 | success w/ keyword |
|
534 | success w/ keyword | |
535 | $ rt -k xyzzy |
|
535 | $ rt -k xyzzy | |
536 | . |
|
536 | . | |
537 | # Ran 2 tests, 1 skipped, 0 failed. |
|
537 | # Ran 2 tests, 1 skipped, 0 failed. | |
538 |
|
538 | |||
539 | failed |
|
539 | failed | |
540 |
|
540 | |||
541 | $ rt test-failure.t |
|
541 | $ rt test-failure.t | |
542 |
|
542 | |||
543 | --- $TESTTMP/test-failure.t |
|
543 | --- $TESTTMP/test-failure.t | |
544 | +++ $TESTTMP/test-failure.t.err |
|
544 | +++ $TESTTMP/test-failure.t.err | |
545 | @@ -1,5 +1,5 @@ |
|
545 | @@ -1,5 +1,5 @@ | |
546 | $ echo babar |
|
546 | $ echo babar | |
547 | - rataxes |
|
547 | - rataxes | |
548 | + babar |
|
548 | + babar | |
549 | This is a noop statement so that |
|
549 | This is a noop statement so that | |
550 | this test is still more bytes than success. |
|
550 | this test is still more bytes than success. | |
551 | pad pad pad pad............................................................ |
|
551 | pad pad pad pad............................................................ | |
552 |
|
552 | |||
553 | ERROR: test-failure.t output changed |
|
553 | ERROR: test-failure.t output changed | |
554 | ! |
|
554 | ! | |
555 | Failed test-failure.t: output changed |
|
555 | Failed test-failure.t: output changed | |
556 | # Ran 1 tests, 0 skipped, 1 failed. |
|
556 | # Ran 1 tests, 0 skipped, 1 failed. | |
557 | python hash seed: * (glob) |
|
557 | python hash seed: * (glob) | |
558 | [1] |
|
558 | [1] | |
559 |
|
559 | |||
560 | failure w/ keyword |
|
560 | failure w/ keyword | |
561 | $ rt -k rataxes |
|
561 | $ rt -k rataxes | |
562 |
|
562 | |||
563 | --- $TESTTMP/test-failure.t |
|
563 | --- $TESTTMP/test-failure.t | |
564 | +++ $TESTTMP/test-failure.t.err |
|
564 | +++ $TESTTMP/test-failure.t.err | |
565 | @@ -1,5 +1,5 @@ |
|
565 | @@ -1,5 +1,5 @@ | |
566 | $ echo babar |
|
566 | $ echo babar | |
567 | - rataxes |
|
567 | - rataxes | |
568 | + babar |
|
568 | + babar | |
569 | This is a noop statement so that |
|
569 | This is a noop statement so that | |
570 | this test is still more bytes than success. |
|
570 | this test is still more bytes than success. | |
571 | pad pad pad pad............................................................ |
|
571 | pad pad pad pad............................................................ | |
572 |
|
572 | |||
573 | ERROR: test-failure.t output changed |
|
573 | ERROR: test-failure.t output changed | |
574 | ! |
|
574 | ! | |
575 | Failed test-failure.t: output changed |
|
575 | Failed test-failure.t: output changed | |
576 | # Ran 2 tests, 1 skipped, 1 failed. |
|
576 | # Ran 2 tests, 1 skipped, 1 failed. | |
577 | python hash seed: * (glob) |
|
577 | python hash seed: * (glob) | |
578 | [1] |
|
578 | [1] | |
579 |
|
579 | |||
580 | Verify that when a process fails to start we show a useful message |
|
580 | Verify that when a process fails to start we show a useful message | |
581 | ================================================================== |
|
581 | ================================================================== | |
582 |
|
582 | |||
583 | $ cat > test-serve-fail.t <<EOF |
|
583 | $ cat > test-serve-fail.t <<EOF | |
584 | > $ echo 'abort: child process failed to start blah' |
|
584 | > $ echo 'abort: child process failed to start blah' | |
585 | > EOF |
|
585 | > EOF | |
586 | $ rt test-serve-fail.t |
|
586 | $ rt test-serve-fail.t | |
587 |
|
587 | |||
588 | --- $TESTTMP/test-serve-fail.t |
|
588 | --- $TESTTMP/test-serve-fail.t | |
589 | +++ $TESTTMP/test-serve-fail.t.err |
|
589 | +++ $TESTTMP/test-serve-fail.t.err | |
590 | @@ -1* +1,2 @@ (glob) |
|
590 | @@ -1* +1,2 @@ (glob) | |
591 | $ echo 'abort: child process failed to start blah' |
|
591 | $ echo 'abort: child process failed to start blah' | |
592 | + abort: child process failed to start blah |
|
592 | + abort: child process failed to start blah | |
593 |
|
593 | |||
594 | ERROR: test-serve-fail.t output changed |
|
594 | ERROR: test-serve-fail.t output changed | |
595 | ! |
|
595 | ! | |
596 | Failed test-serve-fail.t: server failed to start (HGPORT=*) (glob) |
|
596 | Failed test-serve-fail.t: server failed to start (HGPORT=*) (glob) | |
597 | # Ran 1 tests, 0 skipped, 1 failed. |
|
597 | # Ran 1 tests, 0 skipped, 1 failed. | |
598 | python hash seed: * (glob) |
|
598 | python hash seed: * (glob) | |
599 | [1] |
|
599 | [1] | |
600 | $ rm test-serve-fail.t |
|
600 | $ rm test-serve-fail.t | |
601 |
|
601 | |||
602 | Verify that we can try other ports |
|
602 | Verify that we can try other ports | |
603 | =================================== |
|
603 | =================================== | |
604 |
|
604 | |||
605 | Extensions aren't inherited by the invoked run-tests.py. An extension |
|
605 | Extensions aren't inherited by the invoked run-tests.py. An extension | |
606 | introducing a repository requirement could cause this to fail. So we force |
|
606 | introducing a repository requirement could cause this to fail. So we force | |
607 | HGRCPATH to get a clean environment. |
|
607 | HGRCPATH to get a clean environment. | |
608 |
|
608 | |||
609 | $ HGRCPATH= hg init inuse |
|
609 | $ HGRCPATH= hg init inuse | |
610 | $ hg serve -R inuse -p $HGPORT -d --pid-file=blocks.pid |
|
610 | $ hg serve -R inuse -p $HGPORT -d --pid-file=blocks.pid | |
611 | $ cat blocks.pid >> $DAEMON_PIDS |
|
611 | $ cat blocks.pid >> $DAEMON_PIDS | |
612 | $ cat > test-serve-inuse.t <<EOF |
|
612 | $ cat > test-serve-inuse.t <<EOF | |
613 | > $ hg serve -R `pwd`/inuse -p \$HGPORT -d --pid-file=hg.pid |
|
613 | > $ hg serve -R `pwd`/inuse -p \$HGPORT -d --pid-file=hg.pid | |
614 | > $ cat hg.pid >> \$DAEMON_PIDS |
|
614 | > $ cat hg.pid >> \$DAEMON_PIDS | |
615 | > EOF |
|
615 | > EOF | |
616 | $ rt test-serve-inuse.t |
|
616 | $ rt test-serve-inuse.t | |
617 | . |
|
617 | . | |
618 | # Ran 1 tests, 0 skipped, 0 failed. |
|
618 | # Ran 1 tests, 0 skipped, 0 failed. | |
619 | $ rm test-serve-inuse.t |
|
619 | $ rm test-serve-inuse.t | |
620 | $ killdaemons.py $DAEMON_PIDS |
|
620 | $ killdaemons.py $DAEMON_PIDS | |
621 |
|
621 | |||
622 | Running In Debug Mode |
|
622 | Running In Debug Mode | |
623 | ====================== |
|
623 | ====================== | |
624 |
|
624 | |||
625 | $ rt --debug 2>&1 | grep -v pwd |
|
625 | $ rt --debug 2>&1 | grep -v pwd | |
626 | + echo *SALT* 0 0 (glob) |
|
626 | + echo *SALT* 0 0 (glob) | |
627 | *SALT* 0 0 (glob) |
|
627 | *SALT* 0 0 (glob) | |
628 | + echo babar |
|
628 | + echo babar | |
629 | babar |
|
629 | babar | |
630 | + echo *SALT* 10 0 (glob) |
|
630 | + echo *SALT* 10 0 (glob) | |
631 | *SALT* 10 0 (glob) |
|
631 | *SALT* 10 0 (glob) | |
632 | *+ echo *SALT* 0 0 (glob) |
|
632 | *+ echo *SALT* 0 0 (glob) | |
633 | *SALT* 0 0 (glob) |
|
633 | *SALT* 0 0 (glob) | |
634 | + echo babar |
|
634 | + echo babar | |
635 | babar |
|
635 | babar | |
636 | + echo *SALT* 2 0 (glob) |
|
636 | + echo *SALT* 2 0 (glob) | |
637 | *SALT* 2 0 (glob) |
|
637 | *SALT* 2 0 (glob) | |
638 | + echo xyzzy |
|
638 | + echo xyzzy | |
639 | xyzzy |
|
639 | xyzzy | |
640 | + echo *SALT* 9 0 (glob) |
|
640 | + echo *SALT* 9 0 (glob) | |
641 | *SALT* 9 0 (glob) |
|
641 | *SALT* 9 0 (glob) | |
642 | + printf *abc\ndef\nxyz\n* (glob) |
|
642 | + printf *abc\ndef\nxyz\n* (glob) | |
643 | abc |
|
643 | abc | |
644 | def |
|
644 | def | |
645 | xyz |
|
645 | xyz | |
646 | + echo *SALT* 15 0 (glob) |
|
646 | + echo *SALT* 15 0 (glob) | |
647 | *SALT* 15 0 (glob) |
|
647 | *SALT* 15 0 (glob) | |
648 | + printf *zyx\nwvu\ntsr\n* (glob) |
|
648 | + printf *zyx\nwvu\ntsr\n* (glob) | |
649 | zyx |
|
649 | zyx | |
650 | wvu |
|
650 | wvu | |
651 | tsr |
|
651 | tsr | |
652 | + echo *SALT* 22 0 (glob) |
|
652 | + echo *SALT* 22 0 (glob) | |
653 | *SALT* 22 0 (glob) |
|
653 | *SALT* 22 0 (glob) | |
654 | . |
|
654 | . | |
655 | # Ran 2 tests, 0 skipped, 0 failed. |
|
655 | # Ran 2 tests, 0 skipped, 0 failed. | |
656 |
|
656 | |||
657 | Parallel runs |
|
657 | Parallel runs | |
658 | ============== |
|
658 | ============== | |
659 |
|
659 | |||
660 | (duplicate the failing test to get predictable output) |
|
660 | (duplicate the failing test to get predictable output) | |
661 | $ cp test-failure.t test-failure-copy.t |
|
661 | $ cp test-failure.t test-failure-copy.t | |
662 |
|
662 | |||
663 | $ rt --jobs 2 test-failure*.t -n |
|
663 | $ rt --jobs 2 test-failure*.t -n | |
664 | !! |
|
664 | !! | |
665 | Failed test-failure*.t: output changed (glob) |
|
665 | Failed test-failure*.t: output changed (glob) | |
666 | Failed test-failure*.t: output changed (glob) |
|
666 | Failed test-failure*.t: output changed (glob) | |
667 | # Ran 2 tests, 0 skipped, 2 failed. |
|
667 | # Ran 2 tests, 0 skipped, 2 failed. | |
668 | python hash seed: * (glob) |
|
668 | python hash seed: * (glob) | |
669 | [1] |
|
669 | [1] | |
670 |
|
670 | |||
671 | failures in parallel with --first should only print one failure |
|
671 | failures in parallel with --first should only print one failure | |
672 | $ rt --jobs 2 --first test-failure*.t |
|
672 | $ rt --jobs 2 --first test-failure*.t | |
673 |
|
673 | |||
674 | --- $TESTTMP/test-failure*.t (glob) |
|
674 | --- $TESTTMP/test-failure*.t (glob) | |
675 | +++ $TESTTMP/test-failure*.t.err (glob) |
|
675 | +++ $TESTTMP/test-failure*.t.err (glob) | |
676 | @@ -1,5 +1,5 @@ |
|
676 | @@ -1,5 +1,5 @@ | |
677 | $ echo babar |
|
677 | $ echo babar | |
678 | - rataxes |
|
678 | - rataxes | |
679 | + babar |
|
679 | + babar | |
680 | This is a noop statement so that |
|
680 | This is a noop statement so that | |
681 | this test is still more bytes than success. |
|
681 | this test is still more bytes than success. | |
682 | pad pad pad pad............................................................ |
|
682 | pad pad pad pad............................................................ | |
683 |
|
683 | |||
684 | Failed test-failure*.t: output changed (glob) |
|
684 | Failed test-failure*.t: output changed (glob) | |
685 | Failed test-failure*.t: output changed (glob) |
|
685 | Failed test-failure*.t: output changed (glob) | |
686 | # Ran 2 tests, 0 skipped, 2 failed. |
|
686 | # Ran 2 tests, 0 skipped, 2 failed. | |
687 | python hash seed: * (glob) |
|
687 | python hash seed: * (glob) | |
688 | [1] |
|
688 | [1] | |
689 |
|
689 | |||
690 |
|
690 | |||
691 | (delete the duplicated test file) |
|
691 | (delete the duplicated test file) | |
692 | $ rm test-failure-copy.t |
|
692 | $ rm test-failure-copy.t | |
693 |
|
693 | |||
694 |
|
694 | |||
695 | Interactive run |
|
695 | Interactive run | |
696 | =============== |
|
696 | =============== | |
697 |
|
697 | |||
698 | (backup the failing test) |
|
698 | (backup the failing test) | |
699 | $ cp test-failure.t backup |
|
699 | $ cp test-failure.t backup | |
700 |
|
700 | |||
701 | Refuse the fix |
|
701 | Refuse the fix | |
702 |
|
702 | |||
703 | $ echo 'n' | rt -i |
|
703 | $ echo 'n' | rt -i | |
704 |
|
704 | |||
705 | --- $TESTTMP/test-failure.t |
|
705 | --- $TESTTMP/test-failure.t | |
706 | +++ $TESTTMP/test-failure.t.err |
|
706 | +++ $TESTTMP/test-failure.t.err | |
707 | @@ -1,5 +1,5 @@ |
|
707 | @@ -1,5 +1,5 @@ | |
708 | $ echo babar |
|
708 | $ echo babar | |
709 | - rataxes |
|
709 | - rataxes | |
710 | + babar |
|
710 | + babar | |
711 | This is a noop statement so that |
|
711 | This is a noop statement so that | |
712 | this test is still more bytes than success. |
|
712 | this test is still more bytes than success. | |
713 | pad pad pad pad............................................................ |
|
713 | pad pad pad pad............................................................ | |
714 | Accept this change? [n] |
|
714 | Accept this change? [n] | |
715 | ERROR: test-failure.t output changed |
|
715 | ERROR: test-failure.t output changed | |
716 | !. |
|
716 | !. | |
717 | Failed test-failure.t: output changed |
|
717 | Failed test-failure.t: output changed | |
718 | # Ran 2 tests, 0 skipped, 1 failed. |
|
718 | # Ran 2 tests, 0 skipped, 1 failed. | |
719 | python hash seed: * (glob) |
|
719 | python hash seed: * (glob) | |
720 | [1] |
|
720 | [1] | |
721 |
|
721 | |||
722 | $ cat test-failure.t |
|
722 | $ cat test-failure.t | |
723 | $ echo babar |
|
723 | $ echo babar | |
724 | rataxes |
|
724 | rataxes | |
725 | This is a noop statement so that |
|
725 | This is a noop statement so that | |
726 | this test is still more bytes than success. |
|
726 | this test is still more bytes than success. | |
727 | pad pad pad pad............................................................ |
|
727 | pad pad pad pad............................................................ | |
728 | pad pad pad pad............................................................ |
|
728 | pad pad pad pad............................................................ | |
729 | pad pad pad pad............................................................ |
|
729 | pad pad pad pad............................................................ | |
730 | pad pad pad pad............................................................ |
|
730 | pad pad pad pad............................................................ | |
731 | pad pad pad pad............................................................ |
|
731 | pad pad pad pad............................................................ | |
732 | pad pad pad pad............................................................ |
|
732 | pad pad pad pad............................................................ | |
733 |
|
733 | |||
734 | Interactive with custom view |
|
734 | Interactive with custom view | |
735 |
|
735 | |||
736 | $ echo 'n' | rt -i --view echo |
|
736 | $ echo 'n' | rt -i --view echo | |
737 | $TESTTMP/test-failure.t $TESTTMP/test-failure.t.err |
|
737 | $TESTTMP/test-failure.t $TESTTMP/test-failure.t.err | |
738 | Accept this change? [n]* (glob) |
|
738 | Accept this change? [n]* (glob) | |
739 | ERROR: test-failure.t output changed |
|
739 | ERROR: test-failure.t output changed | |
740 | !. |
|
740 | !. | |
741 | Failed test-failure.t: output changed |
|
741 | Failed test-failure.t: output changed | |
742 | # Ran 2 tests, 0 skipped, 1 failed. |
|
742 | # Ran 2 tests, 0 skipped, 1 failed. | |
743 | python hash seed: * (glob) |
|
743 | python hash seed: * (glob) | |
744 | [1] |
|
744 | [1] | |
745 |
|
745 | |||
746 | View the fix |
|
746 | View the fix | |
747 |
|
747 | |||
748 | $ echo 'y' | rt --view echo |
|
748 | $ echo 'y' | rt --view echo | |
749 | $TESTTMP/test-failure.t $TESTTMP/test-failure.t.err |
|
749 | $TESTTMP/test-failure.t $TESTTMP/test-failure.t.err | |
750 |
|
750 | |||
751 | ERROR: test-failure.t output changed |
|
751 | ERROR: test-failure.t output changed | |
752 | !. |
|
752 | !. | |
753 | Failed test-failure.t: output changed |
|
753 | Failed test-failure.t: output changed | |
754 | # Ran 2 tests, 0 skipped, 1 failed. |
|
754 | # Ran 2 tests, 0 skipped, 1 failed. | |
755 | python hash seed: * (glob) |
|
755 | python hash seed: * (glob) | |
756 | [1] |
|
756 | [1] | |
757 |
|
757 | |||
758 | Accept the fix |
|
758 | Accept the fix | |
759 |
|
759 | |||
760 | $ cat >> test-failure.t <<EOF |
|
760 | $ cat >> test-failure.t <<EOF | |
761 | > $ echo 'saved backup bundle to \$TESTTMP/foo.hg' |
|
761 | > $ echo 'saved backup bundle to \$TESTTMP/foo.hg' | |
762 | > saved backup bundle to \$TESTTMP/foo.hg |
|
762 | > saved backup bundle to \$TESTTMP/foo.hg | |
763 | > $ echo 'saved backup bundle to \$TESTTMP/foo.hg' |
|
763 | > $ echo 'saved backup bundle to \$TESTTMP/foo.hg' | |
764 | > saved backup bundle to $TESTTMP\\foo.hg |
|
764 | > saved backup bundle to $TESTTMP\\foo.hg | |
765 | > $ echo 'saved backup bundle to \$TESTTMP/foo.hg' |
|
765 | > $ echo 'saved backup bundle to \$TESTTMP/foo.hg' | |
766 | > saved backup bundle to \$TESTTMP/*.hg (glob) |
|
766 | > saved backup bundle to \$TESTTMP/*.hg (glob) | |
767 | > EOF |
|
767 | > EOF | |
768 | $ echo 'y' | rt -i 2>&1 |
|
768 | $ echo 'y' | rt -i 2>&1 | |
769 |
|
769 | |||
770 | --- $TESTTMP/test-failure.t |
|
770 | --- $TESTTMP/test-failure.t | |
771 | +++ $TESTTMP/test-failure.t.err |
|
771 | +++ $TESTTMP/test-failure.t.err | |
772 | @@ -1,5 +1,5 @@ |
|
772 | @@ -1,5 +1,5 @@ | |
773 | $ echo babar |
|
773 | $ echo babar | |
774 | - rataxes |
|
774 | - rataxes | |
775 | + babar |
|
775 | + babar | |
776 | This is a noop statement so that |
|
776 | This is a noop statement so that | |
777 | this test is still more bytes than success. |
|
777 | this test is still more bytes than success. | |
778 | pad pad pad pad............................................................ |
|
778 | pad pad pad pad............................................................ | |
779 | @@ -11,6 +11,6 @@ |
|
779 | @@ -11,6 +11,6 @@ | |
780 | $ echo 'saved backup bundle to $TESTTMP/foo.hg' |
|
780 | $ echo 'saved backup bundle to $TESTTMP/foo.hg' | |
781 | saved backup bundle to $TESTTMP/foo.hg |
|
781 | saved backup bundle to $TESTTMP/foo.hg | |
782 | $ echo 'saved backup bundle to $TESTTMP/foo.hg' |
|
782 | $ echo 'saved backup bundle to $TESTTMP/foo.hg' | |
783 | - saved backup bundle to $TESTTMP\foo.hg |
|
783 | - saved backup bundle to $TESTTMP\foo.hg | |
784 | + saved backup bundle to $TESTTMP/foo.hg |
|
784 | + saved backup bundle to $TESTTMP/foo.hg | |
785 | $ echo 'saved backup bundle to $TESTTMP/foo.hg' |
|
785 | $ echo 'saved backup bundle to $TESTTMP/foo.hg' | |
786 | saved backup bundle to $TESTTMP/*.hg (glob) |
|
786 | saved backup bundle to $TESTTMP/*.hg (glob) | |
787 | Accept this change? [n] .. |
|
787 | Accept this change? [n] .. | |
788 | # Ran 2 tests, 0 skipped, 0 failed. |
|
788 | # Ran 2 tests, 0 skipped, 0 failed. | |
789 |
|
789 | |||
790 | $ sed -e 's,(glob)$,&<,g' test-failure.t |
|
790 | $ sed -e 's,(glob)$,&<,g' test-failure.t | |
791 | $ echo babar |
|
791 | $ echo babar | |
792 | babar |
|
792 | babar | |
793 | This is a noop statement so that |
|
793 | This is a noop statement so that | |
794 | this test is still more bytes than success. |
|
794 | this test is still more bytes than success. | |
795 | pad pad pad pad............................................................ |
|
795 | pad pad pad pad............................................................ | |
796 | pad pad pad pad............................................................ |
|
796 | pad pad pad pad............................................................ | |
797 | pad pad pad pad............................................................ |
|
797 | pad pad pad pad............................................................ | |
798 | pad pad pad pad............................................................ |
|
798 | pad pad pad pad............................................................ | |
799 | pad pad pad pad............................................................ |
|
799 | pad pad pad pad............................................................ | |
800 | pad pad pad pad............................................................ |
|
800 | pad pad pad pad............................................................ | |
801 | $ echo 'saved backup bundle to $TESTTMP/foo.hg' |
|
801 | $ echo 'saved backup bundle to $TESTTMP/foo.hg' | |
802 | saved backup bundle to $TESTTMP/foo.hg |
|
802 | saved backup bundle to $TESTTMP/foo.hg | |
803 | $ echo 'saved backup bundle to $TESTTMP/foo.hg' |
|
803 | $ echo 'saved backup bundle to $TESTTMP/foo.hg' | |
804 | saved backup bundle to $TESTTMP/foo.hg |
|
804 | saved backup bundle to $TESTTMP/foo.hg | |
805 | $ echo 'saved backup bundle to $TESTTMP/foo.hg' |
|
805 | $ echo 'saved backup bundle to $TESTTMP/foo.hg' | |
806 | saved backup bundle to $TESTTMP/*.hg (glob)< |
|
806 | saved backup bundle to $TESTTMP/*.hg (glob)< | |
807 |
|
807 | |||
808 | Race condition - test file was modified when test is running |
|
808 | Race condition - test file was modified when test is running | |
809 |
|
809 | |||
810 | $ TESTRACEDIR=`pwd` |
|
810 | $ TESTRACEDIR=`pwd` | |
811 | $ export TESTRACEDIR |
|
811 | $ export TESTRACEDIR | |
812 | $ cat > test-race.t <<EOF |
|
812 | $ cat > test-race.t <<EOF | |
813 | > $ echo 1 |
|
813 | > $ echo 1 | |
814 | > $ echo "# a new line" >> $TESTRACEDIR/test-race.t |
|
814 | > $ echo "# a new line" >> $TESTRACEDIR/test-race.t | |
815 | > EOF |
|
815 | > EOF | |
816 |
|
816 | |||
817 | $ rt -i test-race.t |
|
817 | $ rt -i test-race.t | |
818 |
|
818 | |||
819 | --- $TESTTMP/test-race.t |
|
819 | --- $TESTTMP/test-race.t | |
820 | +++ $TESTTMP/test-race.t.err |
|
820 | +++ $TESTTMP/test-race.t.err | |
821 | @@ -1,2 +1,3 @@ |
|
821 | @@ -1,2 +1,3 @@ | |
822 | $ echo 1 |
|
822 | $ echo 1 | |
823 | + 1 |
|
823 | + 1 | |
824 | $ echo "# a new line" >> $TESTTMP/test-race.t |
|
824 | $ echo "# a new line" >> $TESTTMP/test-race.t | |
825 | Reference output has changed (run again to prompt changes) |
|
825 | Reference output has changed (run again to prompt changes) | |
826 | ERROR: test-race.t output changed |
|
826 | ERROR: test-race.t output changed | |
827 | ! |
|
827 | ! | |
828 | Failed test-race.t: output changed |
|
828 | Failed test-race.t: output changed | |
829 | # Ran 1 tests, 0 skipped, 1 failed. |
|
829 | # Ran 1 tests, 0 skipped, 1 failed. | |
830 | python hash seed: * (glob) |
|
830 | python hash seed: * (glob) | |
831 | [1] |
|
831 | [1] | |
832 |
|
832 | |||
833 | $ rm test-race.t |
|
833 | $ rm test-race.t | |
834 |
|
834 | |||
835 | When "#testcases" is used in .t files |
|
835 | When "#testcases" is used in .t files | |
836 |
|
836 | |||
837 | $ cat >> test-cases.t <<EOF |
|
837 | $ cat >> test-cases.t <<EOF | |
838 | > #testcases a b |
|
838 | > #testcases a b | |
839 | > #if a |
|
839 | > #if a | |
840 | > $ echo 1 |
|
840 | > $ echo 1 | |
841 | > #endif |
|
841 | > #endif | |
842 | > #if b |
|
842 | > #if b | |
843 | > $ echo 2 |
|
843 | > $ echo 2 | |
844 | > #endif |
|
844 | > #endif | |
845 | > EOF |
|
845 | > EOF | |
846 |
|
846 | |||
847 | $ cat <<EOF | rt -i test-cases.t 2>&1 |
|
847 | $ cat <<EOF | rt -i test-cases.t 2>&1 | |
848 | > y |
|
848 | > y | |
849 | > y |
|
849 | > y | |
850 | > EOF |
|
850 | > EOF | |
851 |
|
851 | |||
852 | --- $TESTTMP/test-cases.t |
|
852 | --- $TESTTMP/test-cases.t | |
853 | +++ $TESTTMP/test-cases.t.a.err |
|
853 | +++ $TESTTMP/test-cases.t.a.err | |
854 | @@ -1,6 +1,7 @@ |
|
854 | @@ -1,6 +1,7 @@ | |
855 | #testcases a b |
|
855 | #testcases a b | |
856 | #if a |
|
856 | #if a | |
857 | $ echo 1 |
|
857 | $ echo 1 | |
858 | + 1 |
|
858 | + 1 | |
859 | #endif |
|
859 | #endif | |
860 | #if b |
|
860 | #if b | |
861 | $ echo 2 |
|
861 | $ echo 2 | |
862 | Accept this change? [n] . |
|
862 | Accept this change? [n] . | |
863 | --- $TESTTMP/test-cases.t |
|
863 | --- $TESTTMP/test-cases.t | |
864 | +++ $TESTTMP/test-cases.t.b.err |
|
864 | +++ $TESTTMP/test-cases.t.b.err | |
865 | @@ -5,4 +5,5 @@ |
|
865 | @@ -5,4 +5,5 @@ | |
866 | #endif |
|
866 | #endif | |
867 | #if b |
|
867 | #if b | |
868 | $ echo 2 |
|
868 | $ echo 2 | |
869 | + 2 |
|
869 | + 2 | |
870 | #endif |
|
870 | #endif | |
871 | Accept this change? [n] . |
|
871 | Accept this change? [n] . | |
872 | # Ran 2 tests, 0 skipped, 0 failed. |
|
872 | # Ran 2 tests, 0 skipped, 0 failed. | |
873 |
|
873 | |||
874 | $ cat test-cases.t |
|
874 | $ cat test-cases.t | |
875 | #testcases a b |
|
875 | #testcases a b | |
876 | #if a |
|
876 | #if a | |
877 | $ echo 1 |
|
877 | $ echo 1 | |
878 | 1 |
|
878 | 1 | |
879 | #endif |
|
879 | #endif | |
880 | #if b |
|
880 | #if b | |
881 | $ echo 2 |
|
881 | $ echo 2 | |
882 | 2 |
|
882 | 2 | |
883 | #endif |
|
883 | #endif | |
884 |
|
884 | |||
885 | $ cat >> test-cases.t <<'EOF' |
|
885 | $ cat >> test-cases.t <<'EOF' | |
886 | > #if a |
|
886 | > #if a | |
887 | > $ NAME=A |
|
887 | > $ NAME=A | |
888 | > #else |
|
888 | > #else | |
889 | > $ NAME=B |
|
889 | > $ NAME=B | |
890 | > #endif |
|
890 | > #endif | |
891 | > $ echo $NAME |
|
891 | > $ echo $NAME | |
892 | > A (a !) |
|
892 | > A (a !) | |
893 | > B (b !) |
|
893 | > B (b !) | |
894 | > EOF |
|
894 | > EOF | |
895 | $ rt test-cases.t |
|
895 | $ rt test-cases.t | |
896 | .. |
|
896 | .. | |
897 | # Ran 2 tests, 0 skipped, 0 failed. |
|
897 | # Ran 2 tests, 0 skipped, 0 failed. | |
898 |
|
898 | |||
899 | $ rm test-cases.t |
|
899 | $ rm test-cases.t | |
900 |
|
900 | |||
901 | (reinstall) |
|
901 | (reinstall) | |
902 | $ mv backup test-failure.t |
|
902 | $ mv backup test-failure.t | |
903 |
|
903 | |||
904 | No Diff |
|
904 | No Diff | |
905 | =============== |
|
905 | =============== | |
906 |
|
906 | |||
907 | $ rt --nodiff |
|
907 | $ rt --nodiff | |
908 | !. |
|
908 | !. | |
909 | Failed test-failure.t: output changed |
|
909 | Failed test-failure.t: output changed | |
910 | # Ran 2 tests, 0 skipped, 1 failed. |
|
910 | # Ran 2 tests, 0 skipped, 1 failed. | |
911 | python hash seed: * (glob) |
|
911 | python hash seed: * (glob) | |
912 | [1] |
|
912 | [1] | |
913 |
|
913 | |||
914 | test --tmpdir support |
|
914 | test --tmpdir support | |
915 | $ rt --tmpdir=$TESTTMP/keep test-success.t |
|
915 | $ rt --tmpdir=$TESTTMP/keep test-success.t | |
916 |
|
916 | |||
917 | Keeping testtmp dir: $TESTTMP/keep/child1/test-success.t |
|
917 | Keeping testtmp dir: $TESTTMP/keep/child1/test-success.t | |
918 | Keeping threadtmp dir: $TESTTMP/keep/child1 |
|
918 | Keeping threadtmp dir: $TESTTMP/keep/child1 | |
919 | . |
|
919 | . | |
920 | # Ran 1 tests, 0 skipped, 0 failed. |
|
920 | # Ran 1 tests, 0 skipped, 0 failed. | |
921 |
|
921 | |||
922 | timeouts |
|
922 | timeouts | |
923 | ======== |
|
923 | ======== | |
924 | $ cat > test-timeout.t <<EOF |
|
924 | $ cat > test-timeout.t <<EOF | |
925 | > $ sleep 2 |
|
925 | > $ sleep 2 | |
926 | > $ echo pass |
|
926 | > $ echo pass | |
927 | > pass |
|
927 | > pass | |
928 | > EOF |
|
928 | > EOF | |
929 | > echo '#require slow' > test-slow-timeout.t |
|
929 | > echo '#require slow' > test-slow-timeout.t | |
930 | > cat test-timeout.t >> test-slow-timeout.t |
|
930 | > cat test-timeout.t >> test-slow-timeout.t | |
931 | $ rt --timeout=1 --slowtimeout=3 test-timeout.t test-slow-timeout.t |
|
931 | $ rt --timeout=1 --slowtimeout=3 test-timeout.t test-slow-timeout.t | |
932 | st |
|
932 | st | |
933 | Skipped test-slow-timeout.t: missing feature: allow slow tests (use --allow-slow-tests) |
|
933 | Skipped test-slow-timeout.t: missing feature: allow slow tests (use --allow-slow-tests) | |
934 | Failed test-timeout.t: timed out |
|
934 | Failed test-timeout.t: timed out | |
935 | # Ran 1 tests, 1 skipped, 1 failed. |
|
935 | # Ran 1 tests, 1 skipped, 1 failed. | |
936 | python hash seed: * (glob) |
|
936 | python hash seed: * (glob) | |
937 | [1] |
|
937 | [1] | |
938 | $ rt --timeout=1 --slowtimeout=3 \ |
|
938 | $ rt --timeout=1 --slowtimeout=3 \ | |
939 | > test-timeout.t test-slow-timeout.t --allow-slow-tests |
|
939 | > test-timeout.t test-slow-timeout.t --allow-slow-tests | |
940 | .t |
|
940 | .t | |
941 | Failed test-timeout.t: timed out |
|
941 | Failed test-timeout.t: timed out | |
942 | # Ran 2 tests, 0 skipped, 1 failed. |
|
942 | # Ran 2 tests, 0 skipped, 1 failed. | |
943 | python hash seed: * (glob) |
|
943 | python hash seed: * (glob) | |
944 | [1] |
|
944 | [1] | |
945 | $ rm test-timeout.t test-slow-timeout.t |
|
945 | $ rm test-timeout.t test-slow-timeout.t | |
946 |
|
946 | |||
947 | test for --time |
|
947 | test for --time | |
948 | ================== |
|
948 | ================== | |
949 |
|
949 | |||
950 | $ rt test-success.t --time |
|
950 | $ rt test-success.t --time | |
951 | . |
|
951 | . | |
952 | # Ran 1 tests, 0 skipped, 0 failed. |
|
952 | # Ran 1 tests, 0 skipped, 0 failed. | |
953 | # Producing time report |
|
953 | # Producing time report | |
954 | start end cuser csys real Test |
|
954 | start end cuser csys real Test | |
955 | \s*[\d\.]{5} \s*[\d\.]{5} \s*[\d\.]{5} \s*[\d\.]{5} \s*[\d\.]{5} test-success.t (re) |
|
955 | \s*[\d\.]{5} \s*[\d\.]{5} \s*[\d\.]{5} \s*[\d\.]{5} \s*[\d\.]{5} test-success.t (re) | |
956 |
|
956 | |||
957 | test for --time with --job enabled |
|
957 | test for --time with --job enabled | |
958 | ==================================== |
|
958 | ==================================== | |
959 |
|
959 | |||
960 | $ rt test-success.t --time --jobs 2 |
|
960 | $ rt test-success.t --time --jobs 2 | |
961 | . |
|
961 | . | |
962 | # Ran 1 tests, 0 skipped, 0 failed. |
|
962 | # Ran 1 tests, 0 skipped, 0 failed. | |
963 | # Producing time report |
|
963 | # Producing time report | |
964 | start end cuser csys real Test |
|
964 | start end cuser csys real Test | |
965 | \s*[\d\.]{5} \s*[\d\.]{5} \s*[\d\.]{5} \s*[\d\.]{5} \s*[\d\.]{5} test-success.t (re) |
|
965 | \s*[\d\.]{5} \s*[\d\.]{5} \s*[\d\.]{5} \s*[\d\.]{5} \s*[\d\.]{5} test-success.t (re) | |
966 |
|
966 | |||
967 | Skips |
|
967 | Skips | |
968 | ================ |
|
968 | ================ | |
969 | $ cat > test-skip.t <<EOF |
|
969 | $ cat > test-skip.t <<EOF | |
970 | > $ echo xyzzy |
|
970 | > $ echo xyzzy | |
971 | > #if true |
|
971 | > #if true | |
972 | > #require false |
|
972 | > #require false | |
973 | > #end |
|
973 | > #end | |
974 | > EOF |
|
974 | > EOF | |
975 | $ cat > test-noskip.t <<EOF |
|
975 | $ cat > test-noskip.t <<EOF | |
976 | > #if false |
|
976 | > #if false | |
977 | > #require false |
|
977 | > #require false | |
978 | > #endif |
|
978 | > #endif | |
979 | > EOF |
|
979 | > EOF | |
980 | $ rt --nodiff |
|
980 | $ rt --nodiff | |
981 | !.s. |
|
981 | !.s. | |
982 | Skipped test-skip.t: missing feature: nail clipper |
|
982 | Skipped test-skip.t: missing feature: nail clipper | |
983 | Failed test-failure.t: output changed |
|
983 | Failed test-failure.t: output changed | |
984 | # Ran 3 tests, 1 skipped, 1 failed. |
|
984 | # Ran 3 tests, 1 skipped, 1 failed. | |
985 | python hash seed: * (glob) |
|
985 | python hash seed: * (glob) | |
986 | [1] |
|
986 | [1] | |
987 |
|
987 | |||
988 | $ rm test-noskip.t |
|
988 | $ rm test-noskip.t | |
989 | $ rt --keyword xyzzy |
|
989 | $ rt --keyword xyzzy | |
990 | .s |
|
990 | .s | |
991 | Skipped test-skip.t: missing feature: nail clipper |
|
991 | Skipped test-skip.t: missing feature: nail clipper | |
992 | # Ran 2 tests, 2 skipped, 0 failed. |
|
992 | # Ran 2 tests, 2 skipped, 0 failed. | |
993 |
|
993 | |||
994 | Skips with xml |
|
994 | Skips with xml | |
995 | $ rt --keyword xyzzy \ |
|
995 | $ rt --keyword xyzzy \ | |
996 | > --xunit=xunit.xml |
|
996 | > --xunit=xunit.xml | |
997 | .s |
|
997 | .s | |
998 | Skipped test-skip.t: missing feature: nail clipper |
|
998 | Skipped test-skip.t: missing feature: nail clipper | |
999 | # Ran 2 tests, 2 skipped, 0 failed. |
|
999 | # Ran 2 tests, 2 skipped, 0 failed. | |
1000 | $ cat xunit.xml |
|
1000 | $ cat xunit.xml | |
1001 | <?xml version="1.0" encoding="utf-8"?> |
|
1001 | <?xml version="1.0" encoding="utf-8"?> | |
1002 | <testsuite errors="0" failures="0" name="run-tests" skipped="2" tests="2"> |
|
1002 | <testsuite errors="0" failures="0" name="run-tests" skipped="2" tests="2"> | |
1003 | <testcase name="test-success.t" time="*"/> (glob) |
|
1003 | <testcase name="test-success.t" time="*"/> (glob) | |
1004 | <testcase name="test-skip.t"> |
|
1004 | <testcase name="test-skip.t"> | |
1005 | <skipped> |
|
1005 | <skipped> | |
1006 | <![CDATA[missing feature: nail clipper]]> </skipped> |
|
1006 | <![CDATA[missing feature: nail clipper]]> </skipped> | |
1007 | </testcase> |
|
1007 | </testcase> | |
1008 | </testsuite> |
|
1008 | </testsuite> | |
1009 |
|
1009 | |||
1010 | Missing skips or blacklisted skips don't count as executed: |
|
1010 | Missing skips or blacklisted skips don't count as executed: | |
1011 | $ echo test-failure.t > blacklist |
|
1011 | $ echo test-failure.t > blacklist | |
1012 | $ rt --blacklist=blacklist --json\ |
|
1012 | $ rt --blacklist=blacklist --json\ | |
1013 | > test-failure.t test-bogus.t |
|
1013 | > test-failure.t test-bogus.t | |
1014 | ss |
|
1014 | ss | |
1015 | Skipped test-bogus.t: Doesn't exist |
|
1015 | Skipped test-bogus.t: Doesn't exist | |
1016 | Skipped test-failure.t: blacklisted |
|
1016 | Skipped test-failure.t: blacklisted | |
1017 | # Ran 0 tests, 2 skipped, 0 failed. |
|
1017 | # Ran 0 tests, 2 skipped, 0 failed. | |
1018 | $ cat report.json |
|
1018 | $ cat report.json | |
1019 | testreport ={ |
|
1019 | testreport ={ | |
1020 | "test-bogus.t": { |
|
1020 | "test-bogus.t": { | |
1021 | "result": "skip" |
|
1021 | "result": "skip" | |
1022 | }, |
|
1022 | }, | |
1023 | "test-failure.t": { |
|
1023 | "test-failure.t": { | |
1024 | "result": "skip" |
|
1024 | "result": "skip" | |
1025 | } |
|
1025 | } | |
1026 | } (no-eol) |
|
1026 | } (no-eol) | |
1027 |
|
1027 | |||
1028 | Whitelist trumps blacklist |
|
1028 | Whitelist trumps blacklist | |
1029 | $ echo test-failure.t > whitelist |
|
1029 | $ echo test-failure.t > whitelist | |
1030 | $ rt --blacklist=blacklist --whitelist=whitelist --json\ |
|
1030 | $ rt --blacklist=blacklist --whitelist=whitelist --json\ | |
1031 | > test-failure.t test-bogus.t |
|
1031 | > test-failure.t test-bogus.t | |
1032 | s |
|
1032 | s | |
1033 | --- $TESTTMP/test-failure.t |
|
1033 | --- $TESTTMP/test-failure.t | |
1034 | +++ $TESTTMP/test-failure.t.err |
|
1034 | +++ $TESTTMP/test-failure.t.err | |
1035 | @@ -1,5 +1,5 @@ |
|
1035 | @@ -1,5 +1,5 @@ | |
1036 | $ echo babar |
|
1036 | $ echo babar | |
1037 | - rataxes |
|
1037 | - rataxes | |
1038 | + babar |
|
1038 | + babar | |
1039 | This is a noop statement so that |
|
1039 | This is a noop statement so that | |
1040 | this test is still more bytes than success. |
|
1040 | this test is still more bytes than success. | |
1041 | pad pad pad pad............................................................ |
|
1041 | pad pad pad pad............................................................ | |
1042 |
|
1042 | |||
1043 | ERROR: test-failure.t output changed |
|
1043 | ERROR: test-failure.t output changed | |
1044 | ! |
|
1044 | ! | |
1045 | Skipped test-bogus.t: Doesn't exist |
|
1045 | Skipped test-bogus.t: Doesn't exist | |
1046 | Failed test-failure.t: output changed |
|
1046 | Failed test-failure.t: output changed | |
1047 | # Ran 1 tests, 1 skipped, 1 failed. |
|
1047 | # Ran 1 tests, 1 skipped, 1 failed. | |
1048 | python hash seed: * (glob) |
|
1048 | python hash seed: * (glob) | |
1049 | [1] |
|
1049 | [1] | |
1050 |
|
1050 | |||
1051 | Ensure that --test-list causes only the tests listed in that file to |
|
1051 | Ensure that --test-list causes only the tests listed in that file to | |
1052 | be executed. |
|
1052 | be executed. | |
1053 | $ echo test-success.t >> onlytest |
|
1053 | $ echo test-success.t >> onlytest | |
1054 | $ rt --test-list=onlytest |
|
1054 | $ rt --test-list=onlytest | |
1055 | . |
|
1055 | . | |
1056 | # Ran 1 tests, 0 skipped, 0 failed. |
|
1056 | # Ran 1 tests, 0 skipped, 0 failed. | |
1057 | $ echo test-bogus.t >> anothertest |
|
1057 | $ echo test-bogus.t >> anothertest | |
1058 | $ rt --test-list=onlytest --test-list=anothertest |
|
1058 | $ rt --test-list=onlytest --test-list=anothertest | |
1059 | s. |
|
1059 | s. | |
1060 | Skipped test-bogus.t: Doesn't exist |
|
1060 | Skipped test-bogus.t: Doesn't exist | |
1061 | # Ran 1 tests, 1 skipped, 0 failed. |
|
1061 | # Ran 1 tests, 1 skipped, 0 failed. | |
1062 | $ rm onlytest anothertest |
|
1062 | $ rm onlytest anothertest | |
1063 |
|
1063 | |||
1064 | test for --json |
|
1064 | test for --json | |
1065 | ================== |
|
1065 | ================== | |
1066 |
|
1066 | |||
1067 | $ rt --json |
|
1067 | $ rt --json | |
1068 |
|
1068 | |||
1069 | --- $TESTTMP/test-failure.t |
|
1069 | --- $TESTTMP/test-failure.t | |
1070 | +++ $TESTTMP/test-failure.t.err |
|
1070 | +++ $TESTTMP/test-failure.t.err | |
1071 | @@ -1,5 +1,5 @@ |
|
1071 | @@ -1,5 +1,5 @@ | |
1072 | $ echo babar |
|
1072 | $ echo babar | |
1073 | - rataxes |
|
1073 | - rataxes | |
1074 | + babar |
|
1074 | + babar | |
1075 | This is a noop statement so that |
|
1075 | This is a noop statement so that | |
1076 | this test is still more bytes than success. |
|
1076 | this test is still more bytes than success. | |
1077 | pad pad pad pad............................................................ |
|
1077 | pad pad pad pad............................................................ | |
1078 |
|
1078 | |||
1079 | ERROR: test-failure.t output changed |
|
1079 | ERROR: test-failure.t output changed | |
1080 | !.s |
|
1080 | !.s | |
1081 | Skipped test-skip.t: missing feature: nail clipper |
|
1081 | Skipped test-skip.t: missing feature: nail clipper | |
1082 | Failed test-failure.t: output changed |
|
1082 | Failed test-failure.t: output changed | |
1083 | # Ran 2 tests, 1 skipped, 1 failed. |
|
1083 | # Ran 2 tests, 1 skipped, 1 failed. | |
1084 | python hash seed: * (glob) |
|
1084 | python hash seed: * (glob) | |
1085 | [1] |
|
1085 | [1] | |
1086 |
|
1086 | |||
1087 | $ cat report.json |
|
1087 | $ cat report.json | |
1088 | testreport ={ |
|
1088 | testreport ={ | |
1089 | "test-failure.t": [\{] (re) |
|
1089 | "test-failure.t": [\{] (re) | |
1090 | "csys": "\s*[\d\.]{4,5}", ? (re) |
|
1090 | "csys": "\s*[\d\.]{4,5}", ? (re) | |
1091 | "cuser": "\s*[\d\.]{4,5}", ? (re) |
|
1091 | "cuser": "\s*[\d\.]{4,5}", ? (re) | |
1092 | "diff": "---.+\+\+\+.+", ? (re) |
|
1092 | "diff": "---.+\+\+\+.+", ? (re) | |
1093 | "end": "\s*[\d\.]{4,5}", ? (re) |
|
1093 | "end": "\s*[\d\.]{4,5}", ? (re) | |
1094 | "result": "failure", ? (re) |
|
1094 | "result": "failure", ? (re) | |
1095 | "start": "\s*[\d\.]{4,5}", ? (re) |
|
1095 | "start": "\s*[\d\.]{4,5}", ? (re) | |
1096 | "time": "\s*[\d\.]{4,5}" (re) |
|
1096 | "time": "\s*[\d\.]{4,5}" (re) | |
1097 | }, ? (re) |
|
1097 | }, ? (re) | |
1098 | "test-skip.t": { |
|
1098 | "test-skip.t": { | |
1099 | "csys": "\s*[\d\.]{4,5}", ? (re) |
|
1099 | "csys": "\s*[\d\.]{4,5}", ? (re) | |
1100 | "cuser": "\s*[\d\.]{4,5}", ? (re) |
|
1100 | "cuser": "\s*[\d\.]{4,5}", ? (re) | |
1101 | "diff": "", ? (re) |
|
1101 | "diff": "", ? (re) | |
1102 | "end": "\s*[\d\.]{4,5}", ? (re) |
|
1102 | "end": "\s*[\d\.]{4,5}", ? (re) | |
1103 | "result": "skip", ? (re) |
|
1103 | "result": "skip", ? (re) | |
1104 | "start": "\s*[\d\.]{4,5}", ? (re) |
|
1104 | "start": "\s*[\d\.]{4,5}", ? (re) | |
1105 | "time": "\s*[\d\.]{4,5}" (re) |
|
1105 | "time": "\s*[\d\.]{4,5}" (re) | |
1106 | }, ? (re) |
|
1106 | }, ? (re) | |
1107 | "test-success.t": [\{] (re) |
|
1107 | "test-success.t": [\{] (re) | |
1108 | "csys": "\s*[\d\.]{4,5}", ? (re) |
|
1108 | "csys": "\s*[\d\.]{4,5}", ? (re) | |
1109 | "cuser": "\s*[\d\.]{4,5}", ? (re) |
|
1109 | "cuser": "\s*[\d\.]{4,5}", ? (re) | |
1110 | "diff": "", ? (re) |
|
1110 | "diff": "", ? (re) | |
1111 | "end": "\s*[\d\.]{4,5}", ? (re) |
|
1111 | "end": "\s*[\d\.]{4,5}", ? (re) | |
1112 | "result": "success", ? (re) |
|
1112 | "result": "success", ? (re) | |
1113 | "start": "\s*[\d\.]{4,5}", ? (re) |
|
1113 | "start": "\s*[\d\.]{4,5}", ? (re) | |
1114 | "time": "\s*[\d\.]{4,5}" (re) |
|
1114 | "time": "\s*[\d\.]{4,5}" (re) | |
1115 | } |
|
1115 | } | |
1116 | } (no-eol) |
|
1116 | } (no-eol) | |
1117 | --json with --outputdir |
|
1117 | --json with --outputdir | |
1118 |
|
1118 | |||
1119 | $ rm report.json |
|
1119 | $ rm report.json | |
1120 | $ rm -r output |
|
1120 | $ rm -r output | |
1121 | $ mkdir output |
|
1121 | $ mkdir output | |
1122 | $ rt --json --outputdir output |
|
1122 | $ rt --json --outputdir output | |
1123 |
|
1123 | |||
1124 | --- $TESTTMP/test-failure.t |
|
1124 | --- $TESTTMP/test-failure.t | |
1125 | +++ $TESTTMP/output/test-failure.t.err |
|
1125 | +++ $TESTTMP/output/test-failure.t.err | |
1126 | @@ -1,5 +1,5 @@ |
|
1126 | @@ -1,5 +1,5 @@ | |
1127 | $ echo babar |
|
1127 | $ echo babar | |
1128 | - rataxes |
|
1128 | - rataxes | |
1129 | + babar |
|
1129 | + babar | |
1130 | This is a noop statement so that |
|
1130 | This is a noop statement so that | |
1131 | this test is still more bytes than success. |
|
1131 | this test is still more bytes than success. | |
1132 | pad pad pad pad............................................................ |
|
1132 | pad pad pad pad............................................................ | |
1133 |
|
1133 | |||
1134 | ERROR: test-failure.t output changed |
|
1134 | ERROR: test-failure.t output changed | |
1135 | !.s |
|
1135 | !.s | |
1136 | Skipped test-skip.t: missing feature: nail clipper |
|
1136 | Skipped test-skip.t: missing feature: nail clipper | |
1137 | Failed test-failure.t: output changed |
|
1137 | Failed test-failure.t: output changed | |
1138 | # Ran 2 tests, 1 skipped, 1 failed. |
|
1138 | # Ran 2 tests, 1 skipped, 1 failed. | |
1139 | python hash seed: * (glob) |
|
1139 | python hash seed: * (glob) | |
1140 | [1] |
|
1140 | [1] | |
1141 | $ f report.json |
|
1141 | $ f report.json | |
1142 | report.json: file not found |
|
1142 | report.json: file not found | |
1143 | $ cat output/report.json |
|
1143 | $ cat output/report.json | |
1144 | testreport ={ |
|
1144 | testreport ={ | |
1145 | "test-failure.t": [\{] (re) |
|
1145 | "test-failure.t": [\{] (re) | |
1146 | "csys": "\s*[\d\.]{4,5}", ? (re) |
|
1146 | "csys": "\s*[\d\.]{4,5}", ? (re) | |
1147 | "cuser": "\s*[\d\.]{4,5}", ? (re) |
|
1147 | "cuser": "\s*[\d\.]{4,5}", ? (re) | |
1148 | "diff": "---.+\+\+\+.+", ? (re) |
|
1148 | "diff": "---.+\+\+\+.+", ? (re) | |
1149 | "end": "\s*[\d\.]{4,5}", ? (re) |
|
1149 | "end": "\s*[\d\.]{4,5}", ? (re) | |
1150 | "result": "failure", ? (re) |
|
1150 | "result": "failure", ? (re) | |
1151 | "start": "\s*[\d\.]{4,5}", ? (re) |
|
1151 | "start": "\s*[\d\.]{4,5}", ? (re) | |
1152 | "time": "\s*[\d\.]{4,5}" (re) |
|
1152 | "time": "\s*[\d\.]{4,5}" (re) | |
1153 | }, ? (re) |
|
1153 | }, ? (re) | |
1154 | "test-skip.t": { |
|
1154 | "test-skip.t": { | |
1155 | "csys": "\s*[\d\.]{4,5}", ? (re) |
|
1155 | "csys": "\s*[\d\.]{4,5}", ? (re) | |
1156 | "cuser": "\s*[\d\.]{4,5}", ? (re) |
|
1156 | "cuser": "\s*[\d\.]{4,5}", ? (re) | |
1157 | "diff": "", ? (re) |
|
1157 | "diff": "", ? (re) | |
1158 | "end": "\s*[\d\.]{4,5}", ? (re) |
|
1158 | "end": "\s*[\d\.]{4,5}", ? (re) | |
1159 | "result": "skip", ? (re) |
|
1159 | "result": "skip", ? (re) | |
1160 | "start": "\s*[\d\.]{4,5}", ? (re) |
|
1160 | "start": "\s*[\d\.]{4,5}", ? (re) | |
1161 | "time": "\s*[\d\.]{4,5}" (re) |
|
1161 | "time": "\s*[\d\.]{4,5}" (re) | |
1162 | }, ? (re) |
|
1162 | }, ? (re) | |
1163 | "test-success.t": [\{] (re) |
|
1163 | "test-success.t": [\{] (re) | |
1164 | "csys": "\s*[\d\.]{4,5}", ? (re) |
|
1164 | "csys": "\s*[\d\.]{4,5}", ? (re) | |
1165 | "cuser": "\s*[\d\.]{4,5}", ? (re) |
|
1165 | "cuser": "\s*[\d\.]{4,5}", ? (re) | |
1166 | "diff": "", ? (re) |
|
1166 | "diff": "", ? (re) | |
1167 | "end": "\s*[\d\.]{4,5}", ? (re) |
|
1167 | "end": "\s*[\d\.]{4,5}", ? (re) | |
1168 | "result": "success", ? (re) |
|
1168 | "result": "success", ? (re) | |
1169 | "start": "\s*[\d\.]{4,5}", ? (re) |
|
1169 | "start": "\s*[\d\.]{4,5}", ? (re) | |
1170 | "time": "\s*[\d\.]{4,5}" (re) |
|
1170 | "time": "\s*[\d\.]{4,5}" (re) | |
1171 | } |
|
1171 | } | |
1172 | } (no-eol) |
|
1172 | } (no-eol) | |
1173 | $ ls -a output |
|
1173 | $ ls -a output | |
1174 | . |
|
1174 | . | |
1175 | .. |
|
1175 | .. | |
1176 | .testtimes |
|
1176 | .testtimes | |
1177 | report.json |
|
1177 | report.json | |
1178 | test-failure.t.err |
|
1178 | test-failure.t.err | |
1179 |
|
1179 | |||
1180 | Test that failed test accepted through interactive are properly reported: |
|
1180 | Test that failed test accepted through interactive are properly reported: | |
1181 |
|
1181 | |||
1182 | $ cp test-failure.t backup |
|
1182 | $ cp test-failure.t backup | |
1183 | $ echo y | rt --json -i |
|
1183 | $ echo y | rt --json -i | |
1184 |
|
1184 | |||
1185 | --- $TESTTMP/test-failure.t |
|
1185 | --- $TESTTMP/test-failure.t | |
1186 | +++ $TESTTMP/test-failure.t.err |
|
1186 | +++ $TESTTMP/test-failure.t.err | |
1187 | @@ -1,5 +1,5 @@ |
|
1187 | @@ -1,5 +1,5 @@ | |
1188 | $ echo babar |
|
1188 | $ echo babar | |
1189 | - rataxes |
|
1189 | - rataxes | |
1190 | + babar |
|
1190 | + babar | |
1191 | This is a noop statement so that |
|
1191 | This is a noop statement so that | |
1192 | this test is still more bytes than success. |
|
1192 | this test is still more bytes than success. | |
1193 | pad pad pad pad............................................................ |
|
1193 | pad pad pad pad............................................................ | |
1194 | Accept this change? [n] ..s |
|
1194 | Accept this change? [n] ..s | |
1195 | Skipped test-skip.t: missing feature: nail clipper |
|
1195 | Skipped test-skip.t: missing feature: nail clipper | |
1196 | # Ran 2 tests, 1 skipped, 0 failed. |
|
1196 | # Ran 2 tests, 1 skipped, 0 failed. | |
1197 |
|
1197 | |||
1198 | $ cat report.json |
|
1198 | $ cat report.json | |
1199 | testreport ={ |
|
1199 | testreport ={ | |
1200 | "test-failure.t": [\{] (re) |
|
1200 | "test-failure.t": [\{] (re) | |
1201 | "csys": "\s*[\d\.]{4,5}", ? (re) |
|
1201 | "csys": "\s*[\d\.]{4,5}", ? (re) | |
1202 | "cuser": "\s*[\d\.]{4,5}", ? (re) |
|
1202 | "cuser": "\s*[\d\.]{4,5}", ? (re) | |
1203 | "diff": "", ? (re) |
|
1203 | "diff": "", ? (re) | |
1204 | "end": "\s*[\d\.]{4,5}", ? (re) |
|
1204 | "end": "\s*[\d\.]{4,5}", ? (re) | |
1205 | "result": "success", ? (re) |
|
1205 | "result": "success", ? (re) | |
1206 | "start": "\s*[\d\.]{4,5}", ? (re) |
|
1206 | "start": "\s*[\d\.]{4,5}", ? (re) | |
1207 | "time": "\s*[\d\.]{4,5}" (re) |
|
1207 | "time": "\s*[\d\.]{4,5}" (re) | |
1208 | }, ? (re) |
|
1208 | }, ? (re) | |
1209 | "test-skip.t": { |
|
1209 | "test-skip.t": { | |
1210 | "csys": "\s*[\d\.]{4,5}", ? (re) |
|
1210 | "csys": "\s*[\d\.]{4,5}", ? (re) | |
1211 | "cuser": "\s*[\d\.]{4,5}", ? (re) |
|
1211 | "cuser": "\s*[\d\.]{4,5}", ? (re) | |
1212 | "diff": "", ? (re) |
|
1212 | "diff": "", ? (re) | |
1213 | "end": "\s*[\d\.]{4,5}", ? (re) |
|
1213 | "end": "\s*[\d\.]{4,5}", ? (re) | |
1214 | "result": "skip", ? (re) |
|
1214 | "result": "skip", ? (re) | |
1215 | "start": "\s*[\d\.]{4,5}", ? (re) |
|
1215 | "start": "\s*[\d\.]{4,5}", ? (re) | |
1216 | "time": "\s*[\d\.]{4,5}" (re) |
|
1216 | "time": "\s*[\d\.]{4,5}" (re) | |
1217 | }, ? (re) |
|
1217 | }, ? (re) | |
1218 | "test-success.t": [\{] (re) |
|
1218 | "test-success.t": [\{] (re) | |
1219 | "csys": "\s*[\d\.]{4,5}", ? (re) |
|
1219 | "csys": "\s*[\d\.]{4,5}", ? (re) | |
1220 | "cuser": "\s*[\d\.]{4,5}", ? (re) |
|
1220 | "cuser": "\s*[\d\.]{4,5}", ? (re) | |
1221 | "diff": "", ? (re) |
|
1221 | "diff": "", ? (re) | |
1222 | "end": "\s*[\d\.]{4,5}", ? (re) |
|
1222 | "end": "\s*[\d\.]{4,5}", ? (re) | |
1223 | "result": "success", ? (re) |
|
1223 | "result": "success", ? (re) | |
1224 | "start": "\s*[\d\.]{4,5}", ? (re) |
|
1224 | "start": "\s*[\d\.]{4,5}", ? (re) | |
1225 | "time": "\s*[\d\.]{4,5}" (re) |
|
1225 | "time": "\s*[\d\.]{4,5}" (re) | |
1226 | } |
|
1226 | } | |
1227 | } (no-eol) |
|
1227 | } (no-eol) | |
1228 | $ mv backup test-failure.t |
|
1228 | $ mv backup test-failure.t | |
1229 |
|
1229 | |||
1230 | backslash on end of line with glob matching is handled properly |
|
1230 | backslash on end of line with glob matching is handled properly | |
1231 |
|
1231 | |||
1232 | $ cat > test-glob-backslash.t << EOF |
|
1232 | $ cat > test-glob-backslash.t << EOF | |
1233 | > $ echo 'foo bar \\' |
|
1233 | > $ echo 'foo bar \\' | |
1234 | > foo * \ (glob) |
|
1234 | > foo * \ (glob) | |
1235 | > EOF |
|
1235 | > EOF | |
1236 |
|
1236 | |||
1237 | $ rt test-glob-backslash.t |
|
1237 | $ rt test-glob-backslash.t | |
1238 | . |
|
1238 | . | |
1239 | # Ran 1 tests, 0 skipped, 0 failed. |
|
1239 | # Ran 1 tests, 0 skipped, 0 failed. | |
1240 |
|
1240 | |||
1241 | $ rm -f test-glob-backslash.t |
|
1241 | $ rm -f test-glob-backslash.t | |
1242 |
|
1242 | |||
1243 | Test globbing of local IP addresses |
|
1243 | Test globbing of local IP addresses | |
1244 | $ echo 172.16.18.1 |
|
1244 | $ echo 172.16.18.1 | |
1245 | $LOCALIP (glob) |
|
1245 | $LOCALIP (glob) | |
1246 | $ echo dead:beef::1 |
|
1246 | $ echo dead:beef::1 | |
1247 | $LOCALIP (glob) |
|
1247 | $LOCALIP (glob) | |
1248 |
|
1248 | |||
1249 | Add support for external test formatter |
|
1249 | Add support for external test formatter | |
1250 | ======================================= |
|
1250 | ======================================= | |
1251 |
|
1251 | |||
1252 | $ CUSTOM_TEST_RESULT=basic_test_result $PYTHON $TESTDIR/run-tests.py --with-hg=`which hg` "$@" test-success.t test-failure.t |
|
1252 | $ CUSTOM_TEST_RESULT=basic_test_result $PYTHON $TESTDIR/run-tests.py --with-hg=`which hg` "$@" test-success.t test-failure.t | |
1253 |
|
1253 | |||
1254 | # Ran 2 tests, 0 skipped, 0 failed. |
|
1254 | # Ran 2 tests, 0 skipped, 0 failed. | |
|
1255 | ON_START! <__main__.TestSuite tests=[<__main__.TTest testMethod=test-failure.t>, <__main__.TTest testMethod=test-success.t>]> | |||
1255 |
|
|
1256 | FAILURE! test-failure.t output changed | |
1256 | SUCCESS! test-success.t |
|
1257 | SUCCESS! test-success.t | |
|
1258 | ON_END! | |||
1257 |
|
1259 | |||
1258 |
|
|
1260 | Test reusability for third party tools | |
1259 | ====================================== |
|
1261 | ====================================== | |
1260 |
|
1262 | |||
1261 | $ mkdir "$TESTTMP"/anothertests |
|
1263 | $ mkdir "$TESTTMP"/anothertests | |
1262 | $ cd "$TESTTMP"/anothertests |
|
1264 | $ cd "$TESTTMP"/anothertests | |
1263 |
|
1265 | |||
1264 | test that `run-tests.py` can execute hghave, even if it runs not in |
|
1266 | test that `run-tests.py` can execute hghave, even if it runs not in | |
1265 | Mercurial source tree. |
|
1267 | Mercurial source tree. | |
1266 |
|
1268 | |||
1267 | $ cat > test-hghave.t <<EOF |
|
1269 | $ cat > test-hghave.t <<EOF | |
1268 | > #require true |
|
1270 | > #require true | |
1269 | > $ echo foo |
|
1271 | > $ echo foo | |
1270 | > foo |
|
1272 | > foo | |
1271 | > EOF |
|
1273 | > EOF | |
1272 | $ rt test-hghave.t |
|
1274 | $ rt test-hghave.t | |
1273 | . |
|
1275 | . | |
1274 | # Ran 1 tests, 0 skipped, 0 failed. |
|
1276 | # Ran 1 tests, 0 skipped, 0 failed. | |
1275 |
|
1277 | |||
1276 | test that RUNTESTDIR refers the directory, in which `run-tests.py` now |
|
1278 | test that RUNTESTDIR refers the directory, in which `run-tests.py` now | |
1277 | running is placed. |
|
1279 | running is placed. | |
1278 |
|
1280 | |||
1279 | $ cat > test-runtestdir.t <<EOF |
|
1281 | $ cat > test-runtestdir.t <<EOF | |
1280 | > - $TESTDIR, in which test-run-tests.t is placed |
|
1282 | > - $TESTDIR, in which test-run-tests.t is placed | |
1281 | > - \$TESTDIR, in which test-runtestdir.t is placed (expanded at runtime) |
|
1283 | > - \$TESTDIR, in which test-runtestdir.t is placed (expanded at runtime) | |
1282 | > - \$RUNTESTDIR, in which run-tests.py is placed (expanded at runtime) |
|
1284 | > - \$RUNTESTDIR, in which run-tests.py is placed (expanded at runtime) | |
1283 | > |
|
1285 | > | |
1284 | > #if windows |
|
1286 | > #if windows | |
1285 | > $ test "\$TESTDIR" = "$TESTTMP\anothertests" |
|
1287 | > $ test "\$TESTDIR" = "$TESTTMP\anothertests" | |
1286 | > #else |
|
1288 | > #else | |
1287 | > $ test "\$TESTDIR" = "$TESTTMP"/anothertests |
|
1289 | > $ test "\$TESTDIR" = "$TESTTMP"/anothertests | |
1288 | > #endif |
|
1290 | > #endif | |
1289 | > If this prints a path, that means RUNTESTDIR didn't equal |
|
1291 | > If this prints a path, that means RUNTESTDIR didn't equal | |
1290 | > TESTDIR as it should have. |
|
1292 | > TESTDIR as it should have. | |
1291 | > $ test "\$RUNTESTDIR" = "$TESTDIR" || echo "\$RUNTESTDIR" |
|
1293 | > $ test "\$RUNTESTDIR" = "$TESTDIR" || echo "\$RUNTESTDIR" | |
1292 | > This should print the start of check-code. If this passes but the |
|
1294 | > This should print the start of check-code. If this passes but the | |
1293 | > previous check failed, that means we found a copy of check-code at whatever |
|
1295 | > previous check failed, that means we found a copy of check-code at whatever | |
1294 | > RUNTESTSDIR ended up containing, even though it doesn't match TESTDIR. |
|
1296 | > RUNTESTSDIR ended up containing, even though it doesn't match TESTDIR. | |
1295 | > $ head -n 3 "\$RUNTESTDIR"/../contrib/check-code.py | sed 's@.!.*python@#!USRBINENVPY@' |
|
1297 | > $ head -n 3 "\$RUNTESTDIR"/../contrib/check-code.py | sed 's@.!.*python@#!USRBINENVPY@' | |
1296 | > #!USRBINENVPY |
|
1298 | > #!USRBINENVPY | |
1297 | > # |
|
1299 | > # | |
1298 | > # check-code - a style and portability checker for Mercurial |
|
1300 | > # check-code - a style and portability checker for Mercurial | |
1299 | > EOF |
|
1301 | > EOF | |
1300 | $ rt test-runtestdir.t |
|
1302 | $ rt test-runtestdir.t | |
1301 | . |
|
1303 | . | |
1302 | # Ran 1 tests, 0 skipped, 0 failed. |
|
1304 | # Ran 1 tests, 0 skipped, 0 failed. | |
1303 |
|
1305 | |||
1304 | #if execbit |
|
1306 | #if execbit | |
1305 |
|
1307 | |||
1306 | test that TESTDIR is referred in PATH |
|
1308 | test that TESTDIR is referred in PATH | |
1307 |
|
1309 | |||
1308 | $ cat > custom-command.sh <<EOF |
|
1310 | $ cat > custom-command.sh <<EOF | |
1309 | > #!/bin/sh |
|
1311 | > #!/bin/sh | |
1310 | > echo "hello world" |
|
1312 | > echo "hello world" | |
1311 | > EOF |
|
1313 | > EOF | |
1312 | $ chmod +x custom-command.sh |
|
1314 | $ chmod +x custom-command.sh | |
1313 | $ cat > test-testdir-path.t <<EOF |
|
1315 | $ cat > test-testdir-path.t <<EOF | |
1314 | > $ custom-command.sh |
|
1316 | > $ custom-command.sh | |
1315 | > hello world |
|
1317 | > hello world | |
1316 | > EOF |
|
1318 | > EOF | |
1317 | $ rt test-testdir-path.t |
|
1319 | $ rt test-testdir-path.t | |
1318 | . |
|
1320 | . | |
1319 | # Ran 1 tests, 0 skipped, 0 failed. |
|
1321 | # Ran 1 tests, 0 skipped, 0 failed. | |
1320 |
|
1322 | |||
1321 | #endif |
|
1323 | #endif | |
1322 |
|
1324 | |||
1323 | test support for --allow-slow-tests |
|
1325 | test support for --allow-slow-tests | |
1324 | $ cat > test-very-slow-test.t <<EOF |
|
1326 | $ cat > test-very-slow-test.t <<EOF | |
1325 | > #require slow |
|
1327 | > #require slow | |
1326 | > $ echo pass |
|
1328 | > $ echo pass | |
1327 | > pass |
|
1329 | > pass | |
1328 | > EOF |
|
1330 | > EOF | |
1329 | $ rt test-very-slow-test.t |
|
1331 | $ rt test-very-slow-test.t | |
1330 | s |
|
1332 | s | |
1331 | Skipped test-very-slow-test.t: missing feature: allow slow tests (use --allow-slow-tests) |
|
1333 | Skipped test-very-slow-test.t: missing feature: allow slow tests (use --allow-slow-tests) | |
1332 | # Ran 0 tests, 1 skipped, 0 failed. |
|
1334 | # Ran 0 tests, 1 skipped, 0 failed. | |
1333 | $ rt $HGTEST_RUN_TESTS_PURE --allow-slow-tests test-very-slow-test.t |
|
1335 | $ rt $HGTEST_RUN_TESTS_PURE --allow-slow-tests test-very-slow-test.t | |
1334 | . |
|
1336 | . | |
1335 | # Ran 1 tests, 0 skipped, 0 failed. |
|
1337 | # Ran 1 tests, 0 skipped, 0 failed. | |
1336 |
|
1338 | |||
1337 | support for running a test outside the current directory |
|
1339 | support for running a test outside the current directory | |
1338 | $ mkdir nonlocal |
|
1340 | $ mkdir nonlocal | |
1339 | $ cat > nonlocal/test-is-not-here.t << EOF |
|
1341 | $ cat > nonlocal/test-is-not-here.t << EOF | |
1340 | > $ echo pass |
|
1342 | > $ echo pass | |
1341 | > pass |
|
1343 | > pass | |
1342 | > EOF |
|
1344 | > EOF | |
1343 | $ rt nonlocal/test-is-not-here.t |
|
1345 | $ rt nonlocal/test-is-not-here.t | |
1344 | . |
|
1346 | . | |
1345 | # Ran 1 tests, 0 skipped, 0 failed. |
|
1347 | # Ran 1 tests, 0 skipped, 0 failed. | |
1346 |
|
1348 | |||
1347 | support for automatically discovering test if arg is a folder |
|
1349 | support for automatically discovering test if arg is a folder | |
1348 | $ mkdir tmp && cd tmp |
|
1350 | $ mkdir tmp && cd tmp | |
1349 |
|
1351 | |||
1350 | $ cat > test-uno.t << EOF |
|
1352 | $ cat > test-uno.t << EOF | |
1351 | > $ echo line |
|
1353 | > $ echo line | |
1352 | > line |
|
1354 | > line | |
1353 | > EOF |
|
1355 | > EOF | |
1354 |
|
1356 | |||
1355 | $ cp test-uno.t test-dos.t |
|
1357 | $ cp test-uno.t test-dos.t | |
1356 | $ cd .. |
|
1358 | $ cd .. | |
1357 | $ cp -R tmp tmpp |
|
1359 | $ cp -R tmp tmpp | |
1358 | $ cp tmp/test-uno.t test-solo.t |
|
1360 | $ cp tmp/test-uno.t test-solo.t | |
1359 |
|
1361 | |||
1360 | $ rt tmp/ test-solo.t tmpp |
|
1362 | $ rt tmp/ test-solo.t tmpp | |
1361 | ..... |
|
1363 | ..... | |
1362 | # Ran 5 tests, 0 skipped, 0 failed. |
|
1364 | # Ran 5 tests, 0 skipped, 0 failed. | |
1363 | $ rm -rf tmp tmpp |
|
1365 | $ rm -rf tmp tmpp | |
1364 |
|
1366 | |||
1365 | support for running run-tests.py from another directory |
|
1367 | support for running run-tests.py from another directory | |
1366 | $ mkdir tmp && cd tmp |
|
1368 | $ mkdir tmp && cd tmp | |
1367 |
|
1369 | |||
1368 | $ cat > useful-file.sh << EOF |
|
1370 | $ cat > useful-file.sh << EOF | |
1369 | > important command |
|
1371 | > important command | |
1370 | > EOF |
|
1372 | > EOF | |
1371 |
|
1373 | |||
1372 | $ cat > test-folder.t << EOF |
|
1374 | $ cat > test-folder.t << EOF | |
1373 | > $ cat \$TESTDIR/useful-file.sh |
|
1375 | > $ cat \$TESTDIR/useful-file.sh | |
1374 | > important command |
|
1376 | > important command | |
1375 | > EOF |
|
1377 | > EOF | |
1376 |
|
1378 | |||
1377 | $ cat > test-folder-fail.t << EOF |
|
1379 | $ cat > test-folder-fail.t << EOF | |
1378 | > $ cat \$TESTDIR/useful-file.sh |
|
1380 | > $ cat \$TESTDIR/useful-file.sh | |
1379 | > important commando |
|
1381 | > important commando | |
1380 | > EOF |
|
1382 | > EOF | |
1381 |
|
1383 | |||
1382 | $ cd .. |
|
1384 | $ cd .. | |
1383 | $ rt tmp/test-*.t |
|
1385 | $ rt tmp/test-*.t | |
1384 |
|
1386 | |||
1385 | --- $TESTTMP/anothertests/tmp/test-folder-fail.t |
|
1387 | --- $TESTTMP/anothertests/tmp/test-folder-fail.t | |
1386 | +++ $TESTTMP/anothertests/tmp/test-folder-fail.t.err |
|
1388 | +++ $TESTTMP/anothertests/tmp/test-folder-fail.t.err | |
1387 | @@ -1,2 +1,2 @@ |
|
1389 | @@ -1,2 +1,2 @@ | |
1388 | $ cat $TESTDIR/useful-file.sh |
|
1390 | $ cat $TESTDIR/useful-file.sh | |
1389 | - important commando |
|
1391 | - important commando | |
1390 | + important command |
|
1392 | + important command | |
1391 |
|
1393 | |||
1392 | ERROR: test-folder-fail.t output changed |
|
1394 | ERROR: test-folder-fail.t output changed | |
1393 | !. |
|
1395 | !. | |
1394 | Failed test-folder-fail.t: output changed |
|
1396 | Failed test-folder-fail.t: output changed | |
1395 | # Ran 2 tests, 0 skipped, 1 failed. |
|
1397 | # Ran 2 tests, 0 skipped, 1 failed. | |
1396 | python hash seed: * (glob) |
|
1398 | python hash seed: * (glob) | |
1397 | [1] |
|
1399 | [1] | |
1398 |
|
1400 | |||
1399 | support for bisecting failed tests automatically |
|
1401 | support for bisecting failed tests automatically | |
1400 | $ hg init bisect |
|
1402 | $ hg init bisect | |
1401 | $ cd bisect |
|
1403 | $ cd bisect | |
1402 | $ cat >> test-bisect.t <<EOF |
|
1404 | $ cat >> test-bisect.t <<EOF | |
1403 | > $ echo pass |
|
1405 | > $ echo pass | |
1404 | > pass |
|
1406 | > pass | |
1405 | > EOF |
|
1407 | > EOF | |
1406 | $ hg add test-bisect.t |
|
1408 | $ hg add test-bisect.t | |
1407 | $ hg ci -m 'good' |
|
1409 | $ hg ci -m 'good' | |
1408 | $ cat >> test-bisect.t <<EOF |
|
1410 | $ cat >> test-bisect.t <<EOF | |
1409 | > $ echo pass |
|
1411 | > $ echo pass | |
1410 | > fail |
|
1412 | > fail | |
1411 | > EOF |
|
1413 | > EOF | |
1412 | $ hg ci -m 'bad' |
|
1414 | $ hg ci -m 'bad' | |
1413 | $ rt --known-good-rev=0 test-bisect.t |
|
1415 | $ rt --known-good-rev=0 test-bisect.t | |
1414 |
|
1416 | |||
1415 | --- $TESTTMP/anothertests/bisect/test-bisect.t |
|
1417 | --- $TESTTMP/anothertests/bisect/test-bisect.t | |
1416 | +++ $TESTTMP/anothertests/bisect/test-bisect.t.err |
|
1418 | +++ $TESTTMP/anothertests/bisect/test-bisect.t.err | |
1417 | @@ -1,4 +1,4 @@ |
|
1419 | @@ -1,4 +1,4 @@ | |
1418 | $ echo pass |
|
1420 | $ echo pass | |
1419 | pass |
|
1421 | pass | |
1420 | $ echo pass |
|
1422 | $ echo pass | |
1421 | - fail |
|
1423 | - fail | |
1422 | + pass |
|
1424 | + pass | |
1423 |
|
1425 | |||
1424 | ERROR: test-bisect.t output changed |
|
1426 | ERROR: test-bisect.t output changed | |
1425 | ! |
|
1427 | ! | |
1426 | Failed test-bisect.t: output changed |
|
1428 | Failed test-bisect.t: output changed | |
1427 | test-bisect.t broken by 72cbf122d116 (bad) |
|
1429 | test-bisect.t broken by 72cbf122d116 (bad) | |
1428 | # Ran 1 tests, 0 skipped, 1 failed. |
|
1430 | # Ran 1 tests, 0 skipped, 1 failed. | |
1429 | python hash seed: * (glob) |
|
1431 | python hash seed: * (glob) | |
1430 | [1] |
|
1432 | [1] | |
1431 |
|
1433 | |||
1432 | $ cd .. |
|
1434 | $ cd .. | |
1433 |
|
1435 | |||
1434 | support bisecting a separate repo |
|
1436 | support bisecting a separate repo | |
1435 |
|
1437 | |||
1436 | $ hg init bisect-dependent |
|
1438 | $ hg init bisect-dependent | |
1437 | $ cd bisect-dependent |
|
1439 | $ cd bisect-dependent | |
1438 | $ cat > test-bisect-dependent.t <<EOF |
|
1440 | $ cat > test-bisect-dependent.t <<EOF | |
1439 | > $ tail -1 \$TESTDIR/../bisect/test-bisect.t |
|
1441 | > $ tail -1 \$TESTDIR/../bisect/test-bisect.t | |
1440 | > pass |
|
1442 | > pass | |
1441 | > EOF |
|
1443 | > EOF | |
1442 | $ hg commit -Am dependent test-bisect-dependent.t |
|
1444 | $ hg commit -Am dependent test-bisect-dependent.t | |
1443 |
|
1445 | |||
1444 | $ rt --known-good-rev=0 test-bisect-dependent.t |
|
1446 | $ rt --known-good-rev=0 test-bisect-dependent.t | |
1445 |
|
1447 | |||
1446 | --- $TESTTMP/anothertests/bisect-dependent/test-bisect-dependent.t |
|
1448 | --- $TESTTMP/anothertests/bisect-dependent/test-bisect-dependent.t | |
1447 | +++ $TESTTMP/anothertests/bisect-dependent/test-bisect-dependent.t.err |
|
1449 | +++ $TESTTMP/anothertests/bisect-dependent/test-bisect-dependent.t.err | |
1448 | @@ -1,2 +1,2 @@ |
|
1450 | @@ -1,2 +1,2 @@ | |
1449 | $ tail -1 $TESTDIR/../bisect/test-bisect.t |
|
1451 | $ tail -1 $TESTDIR/../bisect/test-bisect.t | |
1450 | - pass |
|
1452 | - pass | |
1451 | + fail |
|
1453 | + fail | |
1452 |
|
1454 | |||
1453 | ERROR: test-bisect-dependent.t output changed |
|
1455 | ERROR: test-bisect-dependent.t output changed | |
1454 | ! |
|
1456 | ! | |
1455 | Failed test-bisect-dependent.t: output changed |
|
1457 | Failed test-bisect-dependent.t: output changed | |
1456 | Failed to identify failure point for test-bisect-dependent.t |
|
1458 | Failed to identify failure point for test-bisect-dependent.t | |
1457 | # Ran 1 tests, 0 skipped, 1 failed. |
|
1459 | # Ran 1 tests, 0 skipped, 1 failed. | |
1458 | python hash seed: * (glob) |
|
1460 | python hash seed: * (glob) | |
1459 | [1] |
|
1461 | [1] | |
1460 |
|
1462 | |||
1461 | $ rt --bisect-repo=../test-bisect test-bisect-dependent.t |
|
1463 | $ rt --bisect-repo=../test-bisect test-bisect-dependent.t | |
1462 | usage: run-tests.py [options] [tests] |
|
1464 | usage: run-tests.py [options] [tests] | |
1463 | run-tests.py: error: --bisect-repo cannot be used without --known-good-rev |
|
1465 | run-tests.py: error: --bisect-repo cannot be used without --known-good-rev | |
1464 | [2] |
|
1466 | [2] | |
1465 |
|
1467 | |||
1466 | $ rt --known-good-rev=0 --bisect-repo=../bisect test-bisect-dependent.t |
|
1468 | $ rt --known-good-rev=0 --bisect-repo=../bisect test-bisect-dependent.t | |
1467 |
|
1469 | |||
1468 | --- $TESTTMP/anothertests/bisect-dependent/test-bisect-dependent.t |
|
1470 | --- $TESTTMP/anothertests/bisect-dependent/test-bisect-dependent.t | |
1469 | +++ $TESTTMP/anothertests/bisect-dependent/test-bisect-dependent.t.err |
|
1471 | +++ $TESTTMP/anothertests/bisect-dependent/test-bisect-dependent.t.err | |
1470 | @@ -1,2 +1,2 @@ |
|
1472 | @@ -1,2 +1,2 @@ | |
1471 | $ tail -1 $TESTDIR/../bisect/test-bisect.t |
|
1473 | $ tail -1 $TESTDIR/../bisect/test-bisect.t | |
1472 | - pass |
|
1474 | - pass | |
1473 | + fail |
|
1475 | + fail | |
1474 |
|
1476 | |||
1475 | ERROR: test-bisect-dependent.t output changed |
|
1477 | ERROR: test-bisect-dependent.t output changed | |
1476 | ! |
|
1478 | ! | |
1477 | Failed test-bisect-dependent.t: output changed |
|
1479 | Failed test-bisect-dependent.t: output changed | |
1478 | test-bisect-dependent.t broken by 72cbf122d116 (bad) |
|
1480 | test-bisect-dependent.t broken by 72cbf122d116 (bad) | |
1479 | # Ran 1 tests, 0 skipped, 1 failed. |
|
1481 | # Ran 1 tests, 0 skipped, 1 failed. | |
1480 | python hash seed: * (glob) |
|
1482 | python hash seed: * (glob) | |
1481 | [1] |
|
1483 | [1] | |
1482 |
|
1484 | |||
1483 | $ cd .. |
|
1485 | $ cd .. | |
1484 |
|
1486 | |||
1485 | Test a broken #if statement doesn't break run-tests threading. |
|
1487 | Test a broken #if statement doesn't break run-tests threading. | |
1486 | ============================================================== |
|
1488 | ============================================================== | |
1487 | $ mkdir broken |
|
1489 | $ mkdir broken | |
1488 | $ cd broken |
|
1490 | $ cd broken | |
1489 | $ cat > test-broken.t <<EOF |
|
1491 | $ cat > test-broken.t <<EOF | |
1490 | > true |
|
1492 | > true | |
1491 | > #if notarealhghavefeature |
|
1493 | > #if notarealhghavefeature | |
1492 | > $ false |
|
1494 | > $ false | |
1493 | > #endif |
|
1495 | > #endif | |
1494 | > EOF |
|
1496 | > EOF | |
1495 | $ for f in 1 2 3 4 ; do |
|
1497 | $ for f in 1 2 3 4 ; do | |
1496 | > cat > test-works-$f.t <<EOF |
|
1498 | > cat > test-works-$f.t <<EOF | |
1497 | > This is test case $f |
|
1499 | > This is test case $f | |
1498 | > $ sleep 1 |
|
1500 | > $ sleep 1 | |
1499 | > EOF |
|
1501 | > EOF | |
1500 | > done |
|
1502 | > done | |
1501 | $ rt -j 2 |
|
1503 | $ rt -j 2 | |
1502 | .... |
|
1504 | .... | |
1503 | # Ran 5 tests, 0 skipped, 0 failed. |
|
1505 | # Ran 5 tests, 0 skipped, 0 failed. | |
1504 | skipped: unknown feature: notarealhghavefeature |
|
1506 | skipped: unknown feature: notarealhghavefeature | |
1505 |
|
1507 | |||
1506 | $ cd .. |
|
1508 | $ cd .. | |
1507 | $ rm -rf broken |
|
1509 | $ rm -rf broken | |
1508 |
|
1510 | |||
1509 | Test cases in .t files |
|
1511 | Test cases in .t files | |
1510 | ====================== |
|
1512 | ====================== | |
1511 | $ mkdir cases |
|
1513 | $ mkdir cases | |
1512 | $ cd cases |
|
1514 | $ cd cases | |
1513 | $ cat > test-cases-abc.t <<'EOF' |
|
1515 | $ cat > test-cases-abc.t <<'EOF' | |
1514 | > #testcases A B C |
|
1516 | > #testcases A B C | |
1515 | > $ V=B |
|
1517 | > $ V=B | |
1516 | > #if A |
|
1518 | > #if A | |
1517 | > $ V=A |
|
1519 | > $ V=A | |
1518 | > #endif |
|
1520 | > #endif | |
1519 | > #if C |
|
1521 | > #if C | |
1520 | > $ V=C |
|
1522 | > $ V=C | |
1521 | > #endif |
|
1523 | > #endif | |
1522 | > $ echo $V | sed 's/A/C/' |
|
1524 | > $ echo $V | sed 's/A/C/' | |
1523 | > C |
|
1525 | > C | |
1524 | > #if C |
|
1526 | > #if C | |
1525 | > $ [ $V = C ] |
|
1527 | > $ [ $V = C ] | |
1526 | > #endif |
|
1528 | > #endif | |
1527 | > #if A |
|
1529 | > #if A | |
1528 | > $ [ $V = C ] |
|
1530 | > $ [ $V = C ] | |
1529 | > [1] |
|
1531 | > [1] | |
1530 | > #endif |
|
1532 | > #endif | |
1531 | > #if no-C |
|
1533 | > #if no-C | |
1532 | > $ [ $V = C ] |
|
1534 | > $ [ $V = C ] | |
1533 | > [1] |
|
1535 | > [1] | |
1534 | > #endif |
|
1536 | > #endif | |
1535 | > $ [ $V = D ] |
|
1537 | > $ [ $V = D ] | |
1536 | > [1] |
|
1538 | > [1] | |
1537 | > EOF |
|
1539 | > EOF | |
1538 | $ rt |
|
1540 | $ rt | |
1539 | . |
|
1541 | . | |
1540 | --- $TESTTMP/anothertests/cases/test-cases-abc.t |
|
1542 | --- $TESTTMP/anothertests/cases/test-cases-abc.t | |
1541 | +++ $TESTTMP/anothertests/cases/test-cases-abc.t.B.err |
|
1543 | +++ $TESTTMP/anothertests/cases/test-cases-abc.t.B.err | |
1542 | @@ -7,7 +7,7 @@ |
|
1544 | @@ -7,7 +7,7 @@ | |
1543 | $ V=C |
|
1545 | $ V=C | |
1544 | #endif |
|
1546 | #endif | |
1545 | $ echo $V | sed 's/A/C/' |
|
1547 | $ echo $V | sed 's/A/C/' | |
1546 | - C |
|
1548 | - C | |
1547 | + B |
|
1549 | + B | |
1548 | #if C |
|
1550 | #if C | |
1549 | $ [ $V = C ] |
|
1551 | $ [ $V = C ] | |
1550 | #endif |
|
1552 | #endif | |
1551 |
|
1553 | |||
1552 | ERROR: test-cases-abc.t#B output changed |
|
1554 | ERROR: test-cases-abc.t#B output changed | |
1553 | !. |
|
1555 | !. | |
1554 | Failed test-cases-abc.t#B: output changed |
|
1556 | Failed test-cases-abc.t#B: output changed | |
1555 | # Ran 3 tests, 0 skipped, 1 failed. |
|
1557 | # Ran 3 tests, 0 skipped, 1 failed. | |
1556 | python hash seed: * (glob) |
|
1558 | python hash seed: * (glob) | |
1557 | [1] |
|
1559 | [1] | |
1558 |
|
1560 | |||
1559 | --restart works |
|
1561 | --restart works | |
1560 |
|
1562 | |||
1561 | $ rt --restart |
|
1563 | $ rt --restart | |
1562 |
|
1564 | |||
1563 | --- $TESTTMP/anothertests/cases/test-cases-abc.t |
|
1565 | --- $TESTTMP/anothertests/cases/test-cases-abc.t | |
1564 | +++ $TESTTMP/anothertests/cases/test-cases-abc.t.B.err |
|
1566 | +++ $TESTTMP/anothertests/cases/test-cases-abc.t.B.err | |
1565 | @@ -7,7 +7,7 @@ |
|
1567 | @@ -7,7 +7,7 @@ | |
1566 | $ V=C |
|
1568 | $ V=C | |
1567 | #endif |
|
1569 | #endif | |
1568 | $ echo $V | sed 's/A/C/' |
|
1570 | $ echo $V | sed 's/A/C/' | |
1569 | - C |
|
1571 | - C | |
1570 | + B |
|
1572 | + B | |
1571 | #if C |
|
1573 | #if C | |
1572 | $ [ $V = C ] |
|
1574 | $ [ $V = C ] | |
1573 | #endif |
|
1575 | #endif | |
1574 |
|
1576 | |||
1575 | ERROR: test-cases-abc.t#B output changed |
|
1577 | ERROR: test-cases-abc.t#B output changed | |
1576 | !. |
|
1578 | !. | |
1577 | Failed test-cases-abc.t#B: output changed |
|
1579 | Failed test-cases-abc.t#B: output changed | |
1578 | # Ran 2 tests, 0 skipped, 1 failed. |
|
1580 | # Ran 2 tests, 0 skipped, 1 failed. | |
1579 | python hash seed: * (glob) |
|
1581 | python hash seed: * (glob) | |
1580 | [1] |
|
1582 | [1] | |
1581 |
|
1583 | |||
1582 | --restart works with outputdir |
|
1584 | --restart works with outputdir | |
1583 |
|
1585 | |||
1584 | $ mkdir output |
|
1586 | $ mkdir output | |
1585 | $ mv test-cases-abc.t.B.err output |
|
1587 | $ mv test-cases-abc.t.B.err output | |
1586 | $ rt --restart --outputdir output |
|
1588 | $ rt --restart --outputdir output | |
1587 |
|
1589 | |||
1588 | --- $TESTTMP/anothertests/cases/test-cases-abc.t |
|
1590 | --- $TESTTMP/anothertests/cases/test-cases-abc.t | |
1589 | +++ $TESTTMP/anothertests/cases/output/test-cases-abc.t.B.err |
|
1591 | +++ $TESTTMP/anothertests/cases/output/test-cases-abc.t.B.err | |
1590 | @@ -7,7 +7,7 @@ |
|
1592 | @@ -7,7 +7,7 @@ | |
1591 | $ V=C |
|
1593 | $ V=C | |
1592 | #endif |
|
1594 | #endif | |
1593 | $ echo $V | sed 's/A/C/' |
|
1595 | $ echo $V | sed 's/A/C/' | |
1594 | - C |
|
1596 | - C | |
1595 | + B |
|
1597 | + B | |
1596 | #if C |
|
1598 | #if C | |
1597 | $ [ $V = C ] |
|
1599 | $ [ $V = C ] | |
1598 | #endif |
|
1600 | #endif | |
1599 |
|
1601 | |||
1600 | ERROR: test-cases-abc.t#B output changed |
|
1602 | ERROR: test-cases-abc.t#B output changed | |
1601 | !. |
|
1603 | !. | |
1602 | Failed test-cases-abc.t#B: output changed |
|
1604 | Failed test-cases-abc.t#B: output changed | |
1603 | # Ran 2 tests, 0 skipped, 1 failed. |
|
1605 | # Ran 2 tests, 0 skipped, 1 failed. | |
1604 | python hash seed: * (glob) |
|
1606 | python hash seed: * (glob) | |
1605 | [1] |
|
1607 | [1] | |
1606 |
|
1608 | |||
1607 | Test TESTCASE variable |
|
1609 | Test TESTCASE variable | |
1608 |
|
1610 | |||
1609 | $ cat > test-cases-ab.t <<'EOF' |
|
1611 | $ cat > test-cases-ab.t <<'EOF' | |
1610 | > $ dostuff() { |
|
1612 | > $ dostuff() { | |
1611 | > > echo "In case $TESTCASE" |
|
1613 | > > echo "In case $TESTCASE" | |
1612 | > > } |
|
1614 | > > } | |
1613 | > #testcases A B |
|
1615 | > #testcases A B | |
1614 | > #if A |
|
1616 | > #if A | |
1615 | > $ dostuff |
|
1617 | > $ dostuff | |
1616 | > In case A |
|
1618 | > In case A | |
1617 | > #endif |
|
1619 | > #endif | |
1618 | > #if B |
|
1620 | > #if B | |
1619 | > $ dostuff |
|
1621 | > $ dostuff | |
1620 | > In case B |
|
1622 | > In case B | |
1621 | > #endif |
|
1623 | > #endif | |
1622 | > EOF |
|
1624 | > EOF | |
1623 | $ rt test-cases-ab.t |
|
1625 | $ rt test-cases-ab.t | |
1624 | .. |
|
1626 | .. | |
1625 | # Ran 2 tests, 0 skipped, 0 failed. |
|
1627 | # Ran 2 tests, 0 skipped, 0 failed. | |
1626 |
|
1628 | |||
1627 | Support running a specific test case |
|
1629 | Support running a specific test case | |
1628 |
|
1630 | |||
1629 | $ rt "test-cases-abc.t#B" |
|
1631 | $ rt "test-cases-abc.t#B" | |
1630 |
|
1632 | |||
1631 | --- $TESTTMP/anothertests/cases/test-cases-abc.t |
|
1633 | --- $TESTTMP/anothertests/cases/test-cases-abc.t | |
1632 | +++ $TESTTMP/anothertests/cases/test-cases-abc.t.B.err |
|
1634 | +++ $TESTTMP/anothertests/cases/test-cases-abc.t.B.err | |
1633 | @@ -7,7 +7,7 @@ |
|
1635 | @@ -7,7 +7,7 @@ | |
1634 | $ V=C |
|
1636 | $ V=C | |
1635 | #endif |
|
1637 | #endif | |
1636 | $ echo $V | sed 's/A/C/' |
|
1638 | $ echo $V | sed 's/A/C/' | |
1637 | - C |
|
1639 | - C | |
1638 | + B |
|
1640 | + B | |
1639 | #if C |
|
1641 | #if C | |
1640 | $ [ $V = C ] |
|
1642 | $ [ $V = C ] | |
1641 | #endif |
|
1643 | #endif | |
1642 |
|
1644 | |||
1643 | ERROR: test-cases-abc.t#B output changed |
|
1645 | ERROR: test-cases-abc.t#B output changed | |
1644 | ! |
|
1646 | ! | |
1645 | Failed test-cases-abc.t#B: output changed |
|
1647 | Failed test-cases-abc.t#B: output changed | |
1646 | # Ran 1 tests, 0 skipped, 1 failed. |
|
1648 | # Ran 1 tests, 0 skipped, 1 failed. | |
1647 | python hash seed: * (glob) |
|
1649 | python hash seed: * (glob) | |
1648 | [1] |
|
1650 | [1] | |
1649 |
|
1651 | |||
1650 | Support running multiple test cases in the same file |
|
1652 | Support running multiple test cases in the same file | |
1651 |
|
1653 | |||
1652 | $ rt test-cases-abc.t#B test-cases-abc.t#C |
|
1654 | $ rt test-cases-abc.t#B test-cases-abc.t#C | |
1653 |
|
1655 | |||
1654 | --- $TESTTMP/anothertests/cases/test-cases-abc.t |
|
1656 | --- $TESTTMP/anothertests/cases/test-cases-abc.t | |
1655 | +++ $TESTTMP/anothertests/cases/test-cases-abc.t.B.err |
|
1657 | +++ $TESTTMP/anothertests/cases/test-cases-abc.t.B.err | |
1656 | @@ -7,7 +7,7 @@ |
|
1658 | @@ -7,7 +7,7 @@ | |
1657 | $ V=C |
|
1659 | $ V=C | |
1658 | #endif |
|
1660 | #endif | |
1659 | $ echo $V | sed 's/A/C/' |
|
1661 | $ echo $V | sed 's/A/C/' | |
1660 | - C |
|
1662 | - C | |
1661 | + B |
|
1663 | + B | |
1662 | #if C |
|
1664 | #if C | |
1663 | $ [ $V = C ] |
|
1665 | $ [ $V = C ] | |
1664 | #endif |
|
1666 | #endif | |
1665 |
|
1667 | |||
1666 | ERROR: test-cases-abc.t#B output changed |
|
1668 | ERROR: test-cases-abc.t#B output changed | |
1667 | !. |
|
1669 | !. | |
1668 | Failed test-cases-abc.t#B: output changed |
|
1670 | Failed test-cases-abc.t#B: output changed | |
1669 | # Ran 2 tests, 0 skipped, 1 failed. |
|
1671 | # Ran 2 tests, 0 skipped, 1 failed. | |
1670 | python hash seed: * (glob) |
|
1672 | python hash seed: * (glob) | |
1671 | [1] |
|
1673 | [1] | |
1672 |
|
1674 | |||
1673 | Support ignoring invalid test cases |
|
1675 | Support ignoring invalid test cases | |
1674 |
|
1676 | |||
1675 | $ rt test-cases-abc.t#B test-cases-abc.t#D |
|
1677 | $ rt test-cases-abc.t#B test-cases-abc.t#D | |
1676 |
|
1678 | |||
1677 | --- $TESTTMP/anothertests/cases/test-cases-abc.t |
|
1679 | --- $TESTTMP/anothertests/cases/test-cases-abc.t | |
1678 | +++ $TESTTMP/anothertests/cases/test-cases-abc.t.B.err |
|
1680 | +++ $TESTTMP/anothertests/cases/test-cases-abc.t.B.err | |
1679 | @@ -7,7 +7,7 @@ |
|
1681 | @@ -7,7 +7,7 @@ | |
1680 | $ V=C |
|
1682 | $ V=C | |
1681 | #endif |
|
1683 | #endif | |
1682 | $ echo $V | sed 's/A/C/' |
|
1684 | $ echo $V | sed 's/A/C/' | |
1683 | - C |
|
1685 | - C | |
1684 | + B |
|
1686 | + B | |
1685 | #if C |
|
1687 | #if C | |
1686 | $ [ $V = C ] |
|
1688 | $ [ $V = C ] | |
1687 | #endif |
|
1689 | #endif | |
1688 |
|
1690 | |||
1689 | ERROR: test-cases-abc.t#B output changed |
|
1691 | ERROR: test-cases-abc.t#B output changed | |
1690 | ! |
|
1692 | ! | |
1691 | Failed test-cases-abc.t#B: output changed |
|
1693 | Failed test-cases-abc.t#B: output changed | |
1692 | # Ran 1 tests, 0 skipped, 1 failed. |
|
1694 | # Ran 1 tests, 0 skipped, 1 failed. | |
1693 | python hash seed: * (glob) |
|
1695 | python hash seed: * (glob) | |
1694 | [1] |
|
1696 | [1] | |
1695 |
|
1697 | |||
1696 | Support running complex test cases names |
|
1698 | Support running complex test cases names | |
1697 |
|
1699 | |||
1698 | $ cat > test-cases-advanced-cases.t <<'EOF' |
|
1700 | $ cat > test-cases-advanced-cases.t <<'EOF' | |
1699 | > #testcases simple case-with-dashes casewith_-.chars |
|
1701 | > #testcases simple case-with-dashes casewith_-.chars | |
1700 | > $ echo $TESTCASE |
|
1702 | > $ echo $TESTCASE | |
1701 | > simple |
|
1703 | > simple | |
1702 | > EOF |
|
1704 | > EOF | |
1703 |
|
1705 | |||
1704 | $ cat test-cases-advanced-cases.t |
|
1706 | $ cat test-cases-advanced-cases.t | |
1705 | #testcases simple case-with-dashes casewith_-.chars |
|
1707 | #testcases simple case-with-dashes casewith_-.chars | |
1706 | $ echo $TESTCASE |
|
1708 | $ echo $TESTCASE | |
1707 | simple |
|
1709 | simple | |
1708 |
|
1710 | |||
1709 | $ rt test-cases-advanced-cases.t |
|
1711 | $ rt test-cases-advanced-cases.t | |
1710 |
|
1712 | |||
1711 | --- $TESTTMP/anothertests/cases/test-cases-advanced-cases.t |
|
1713 | --- $TESTTMP/anothertests/cases/test-cases-advanced-cases.t | |
1712 | +++ $TESTTMP/anothertests/cases/test-cases-advanced-cases.t.case-with-dashes.err |
|
1714 | +++ $TESTTMP/anothertests/cases/test-cases-advanced-cases.t.case-with-dashes.err | |
1713 | @@ -1,3 +1,3 @@ |
|
1715 | @@ -1,3 +1,3 @@ | |
1714 | #testcases simple case-with-dashes casewith_-.chars |
|
1716 | #testcases simple case-with-dashes casewith_-.chars | |
1715 | $ echo $TESTCASE |
|
1717 | $ echo $TESTCASE | |
1716 | - simple |
|
1718 | - simple | |
1717 | + case-with-dashes |
|
1719 | + case-with-dashes | |
1718 |
|
1720 | |||
1719 | ERROR: test-cases-advanced-cases.t#case-with-dashes output changed |
|
1721 | ERROR: test-cases-advanced-cases.t#case-with-dashes output changed | |
1720 | ! |
|
1722 | ! | |
1721 | --- $TESTTMP/anothertests/cases/test-cases-advanced-cases.t |
|
1723 | --- $TESTTMP/anothertests/cases/test-cases-advanced-cases.t | |
1722 | +++ $TESTTMP/anothertests/cases/test-cases-advanced-cases.t.casewith_-.chars.err |
|
1724 | +++ $TESTTMP/anothertests/cases/test-cases-advanced-cases.t.casewith_-.chars.err | |
1723 | @@ -1,3 +1,3 @@ |
|
1725 | @@ -1,3 +1,3 @@ | |
1724 | #testcases simple case-with-dashes casewith_-.chars |
|
1726 | #testcases simple case-with-dashes casewith_-.chars | |
1725 | $ echo $TESTCASE |
|
1727 | $ echo $TESTCASE | |
1726 | - simple |
|
1728 | - simple | |
1727 | + casewith_-.chars |
|
1729 | + casewith_-.chars | |
1728 |
|
1730 | |||
1729 | ERROR: test-cases-advanced-cases.t#casewith_-.chars output changed |
|
1731 | ERROR: test-cases-advanced-cases.t#casewith_-.chars output changed | |
1730 | !. |
|
1732 | !. | |
1731 | Failed test-cases-advanced-cases.t#case-with-dashes: output changed |
|
1733 | Failed test-cases-advanced-cases.t#case-with-dashes: output changed | |
1732 | Failed test-cases-advanced-cases.t#casewith_-.chars: output changed |
|
1734 | Failed test-cases-advanced-cases.t#casewith_-.chars: output changed | |
1733 | # Ran 3 tests, 0 skipped, 2 failed. |
|
1735 | # Ran 3 tests, 0 skipped, 2 failed. | |
1734 | python hash seed: * (glob) |
|
1736 | python hash seed: * (glob) | |
1735 | [1] |
|
1737 | [1] | |
1736 |
|
1738 | |||
1737 | $ rt "test-cases-advanced-cases.t#case-with-dashes" |
|
1739 | $ rt "test-cases-advanced-cases.t#case-with-dashes" | |
1738 |
|
1740 | |||
1739 | --- $TESTTMP/anothertests/cases/test-cases-advanced-cases.t |
|
1741 | --- $TESTTMP/anothertests/cases/test-cases-advanced-cases.t | |
1740 | +++ $TESTTMP/anothertests/cases/test-cases-advanced-cases.t.case-with-dashes.err |
|
1742 | +++ $TESTTMP/anothertests/cases/test-cases-advanced-cases.t.case-with-dashes.err | |
1741 | @@ -1,3 +1,3 @@ |
|
1743 | @@ -1,3 +1,3 @@ | |
1742 | #testcases simple case-with-dashes casewith_-.chars |
|
1744 | #testcases simple case-with-dashes casewith_-.chars | |
1743 | $ echo $TESTCASE |
|
1745 | $ echo $TESTCASE | |
1744 | - simple |
|
1746 | - simple | |
1745 | + case-with-dashes |
|
1747 | + case-with-dashes | |
1746 |
|
1748 | |||
1747 | ERROR: test-cases-advanced-cases.t#case-with-dashes output changed |
|
1749 | ERROR: test-cases-advanced-cases.t#case-with-dashes output changed | |
1748 | ! |
|
1750 | ! | |
1749 | Failed test-cases-advanced-cases.t#case-with-dashes: output changed |
|
1751 | Failed test-cases-advanced-cases.t#case-with-dashes: output changed | |
1750 | # Ran 1 tests, 0 skipped, 1 failed. |
|
1752 | # Ran 1 tests, 0 skipped, 1 failed. | |
1751 | python hash seed: * (glob) |
|
1753 | python hash seed: * (glob) | |
1752 | [1] |
|
1754 | [1] | |
1753 |
|
1755 | |||
1754 | $ rt "test-cases-advanced-cases.t#casewith_-.chars" |
|
1756 | $ rt "test-cases-advanced-cases.t#casewith_-.chars" | |
1755 |
|
1757 | |||
1756 | --- $TESTTMP/anothertests/cases/test-cases-advanced-cases.t |
|
1758 | --- $TESTTMP/anothertests/cases/test-cases-advanced-cases.t | |
1757 | +++ $TESTTMP/anothertests/cases/test-cases-advanced-cases.t.casewith_-.chars.err |
|
1759 | +++ $TESTTMP/anothertests/cases/test-cases-advanced-cases.t.casewith_-.chars.err | |
1758 | @@ -1,3 +1,3 @@ |
|
1760 | @@ -1,3 +1,3 @@ | |
1759 | #testcases simple case-with-dashes casewith_-.chars |
|
1761 | #testcases simple case-with-dashes casewith_-.chars | |
1760 | $ echo $TESTCASE |
|
1762 | $ echo $TESTCASE | |
1761 | - simple |
|
1763 | - simple | |
1762 | + casewith_-.chars |
|
1764 | + casewith_-.chars | |
1763 |
|
1765 | |||
1764 | ERROR: test-cases-advanced-cases.t#casewith_-.chars output changed |
|
1766 | ERROR: test-cases-advanced-cases.t#casewith_-.chars output changed | |
1765 | ! |
|
1767 | ! | |
1766 | Failed test-cases-advanced-cases.t#casewith_-.chars: output changed |
|
1768 | Failed test-cases-advanced-cases.t#casewith_-.chars: output changed | |
1767 | # Ran 1 tests, 0 skipped, 1 failed. |
|
1769 | # Ran 1 tests, 0 skipped, 1 failed. | |
1768 | python hash seed: * (glob) |
|
1770 | python hash seed: * (glob) | |
1769 | [1] |
|
1771 | [1] | |
1770 |
|
1772 | |||
1771 | Test automatic pattern replacement |
|
1773 | Test automatic pattern replacement | |
1772 | ================================== |
|
1774 | ================================== | |
1773 |
|
1775 | |||
1774 | $ cat << EOF >> common-pattern.py |
|
1776 | $ cat << EOF >> common-pattern.py | |
1775 | > substitutions = [ |
|
1777 | > substitutions = [ | |
1776 | > (br'foo-(.*)\\b', |
|
1778 | > (br'foo-(.*)\\b', | |
1777 | > br'\$XXX=\\1\$'), |
|
1779 | > br'\$XXX=\\1\$'), | |
1778 | > (br'bar\\n', |
|
1780 | > (br'bar\\n', | |
1779 | > br'\$YYY$\\n'), |
|
1781 | > br'\$YYY$\\n'), | |
1780 | > ] |
|
1782 | > ] | |
1781 | > EOF |
|
1783 | > EOF | |
1782 |
|
1784 | |||
1783 | $ cat << EOF >> test-substitution.t |
|
1785 | $ cat << EOF >> test-substitution.t | |
1784 | > $ echo foo-12 |
|
1786 | > $ echo foo-12 | |
1785 | > \$XXX=12$ |
|
1787 | > \$XXX=12$ | |
1786 | > $ echo foo-42 |
|
1788 | > $ echo foo-42 | |
1787 | > \$XXX=42$ |
|
1789 | > \$XXX=42$ | |
1788 | > $ echo bar prior |
|
1790 | > $ echo bar prior | |
1789 | > bar prior |
|
1791 | > bar prior | |
1790 | > $ echo lastbar |
|
1792 | > $ echo lastbar | |
1791 | > last\$YYY$ |
|
1793 | > last\$YYY$ | |
1792 | > $ echo foo-bar foo-baz |
|
1794 | > $ echo foo-bar foo-baz | |
1793 | > EOF |
|
1795 | > EOF | |
1794 |
|
1796 | |||
1795 | $ rt test-substitution.t |
|
1797 | $ rt test-substitution.t | |
1796 |
|
1798 | |||
1797 | --- $TESTTMP/anothertests/cases/test-substitution.t |
|
1799 | --- $TESTTMP/anothertests/cases/test-substitution.t | |
1798 | +++ $TESTTMP/anothertests/cases/test-substitution.t.err |
|
1800 | +++ $TESTTMP/anothertests/cases/test-substitution.t.err | |
1799 | @@ -7,3 +7,4 @@ |
|
1801 | @@ -7,3 +7,4 @@ | |
1800 | $ echo lastbar |
|
1802 | $ echo lastbar | |
1801 | last$YYY$ |
|
1803 | last$YYY$ | |
1802 | $ echo foo-bar foo-baz |
|
1804 | $ echo foo-bar foo-baz | |
1803 | + $XXX=bar foo-baz$ |
|
1805 | + $XXX=bar foo-baz$ | |
1804 |
|
1806 | |||
1805 | ERROR: test-substitution.t output changed |
|
1807 | ERROR: test-substitution.t output changed | |
1806 | ! |
|
1808 | ! | |
1807 | Failed test-substitution.t: output changed |
|
1809 | Failed test-substitution.t: output changed | |
1808 | # Ran 1 tests, 0 skipped, 1 failed. |
|
1810 | # Ran 1 tests, 0 skipped, 1 failed. | |
1809 | python hash seed: * (glob) |
|
1811 | python hash seed: * (glob) | |
1810 | [1] |
|
1812 | [1] | |
1811 |
|
1813 | |||
1812 | --extra-config-opt works |
|
1814 | --extra-config-opt works | |
1813 |
|
1815 | |||
1814 | $ cat << EOF >> test-config-opt.t |
|
1816 | $ cat << EOF >> test-config-opt.t | |
1815 | > $ hg init test-config-opt |
|
1817 | > $ hg init test-config-opt | |
1816 | > $ hg -R test-config-opt purge |
|
1818 | > $ hg -R test-config-opt purge | |
1817 | > EOF |
|
1819 | > EOF | |
1818 |
|
1820 | |||
1819 | $ rt --extra-config-opt extensions.purge= test-config-opt.t |
|
1821 | $ rt --extra-config-opt extensions.purge= test-config-opt.t | |
1820 | . |
|
1822 | . | |
1821 | # Ran 1 tests, 0 skipped, 0 failed. |
|
1823 | # Ran 1 tests, 0 skipped, 0 failed. |
General Comments 0
You need to be logged in to leave comments.
Login now