bzr branch
http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar
|
0.54.76
by Vincent Ladeuil
Fix the broken test. |
1 |
# Copyright (C) 2007-2010 Canonical Ltd
|
|
0.54.61
by Jeff Licquia
Assign copyright to Canonical. |
2 |
#
|
|
0.54.40
by Jeff Licquia
Move the tests to their own module. |
3 |
# This program is free software; you can redistribute it and/or modify
|
4 |
# it under the terms of the GNU General Public License as published by
|
|
5 |
# the Free Software Foundation; either version 2 of the License, or
|
|
|
0.54.61
by Jeff Licquia
Assign copyright to Canonical. |
6 |
# (at your option) any later version.
|
|
0.54.57
by Jeff Licquia
Check and fix more PEP 8 failures. |
7 |
#
|
|
0.54.40
by Jeff Licquia
Move the tests to their own module. |
8 |
# This program is distributed in the hope that it will be useful,
|
9 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
10 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
11 |
# GNU General Public License for more details.
|
|
|
0.54.57
by Jeff Licquia
Check and fix more PEP 8 failures. |
12 |
#
|
|
0.54.40
by Jeff Licquia
Move the tests to their own module. |
13 |
# You should have received a copy of the GNU General Public License
|
14 |
# along with this program; if not, write to the Free Software
|
|
15 |
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
16 |
||
|
0.54.56
by Jeff Licquia
Fix some pylint complaints. |
17 |
"Test suite for the bzr bisect plugin."
|
18 |
||
|
0.54.40
by Jeff Licquia
Move the tests to their own module. |
19 |
import os |
|
0.60.1
by Gustaf Thorslund
Added test cases for running a test script: |
20 |
import stat |
|
0.54.72
by James Westby
Start to remove the use of sys.stdout. |
21 |
from cStringIO import StringIO |
|
0.54.41
by Jeff Licquia
Add a merged subtree to the repo the tests create. |
22 |
import shutil |
|
0.54.60
by Jeff Licquia
Move plugin metadata to its own package, and redo versioning. |
23 |
import bzrlib |
|
0.54.41
by Jeff Licquia
Add a merged subtree to the repo the tests create. |
24 |
import bzrlib.bzrdir |
|
0.54.40
by Jeff Licquia
Move the tests to their own module. |
25 |
import bzrlib.tests |
|
0.54.49
by Jeff Licquia
Add subtree and harness tests. |
26 |
import bzrlib.revisionspec |
|
0.54.40
by Jeff Licquia
Move the tests to their own module. |
27 |
import bzrlib.plugins.bisect as bisect |
|
0.60.3
by Gustaf Thorslund
Marked two tests as KnownFailure due to: |
28 |
from bzrlib.tests import KnownFailure |
|
0.54.52
by Jeff Licquia
PEP 8 fixes. |
29 |
|
|
0.54.40
by Jeff Licquia
Move the tests to their own module. |
30 |
class BisectTestCase(bzrlib.tests.TestCaseWithTransport): |
|
0.54.56
by Jeff Licquia
Fix some pylint complaints. |
31 |
"Test harness specific to the bisect plugin."
|
|
0.54.57
by Jeff Licquia
Check and fix more PEP 8 failures. |
32 |
|
|
0.54.40
by Jeff Licquia
Move the tests to their own module. |
33 |
def assertRevno(self, rev): |
34 |
"Make sure we're at the right revision."
|
|
35 |
||
|
0.54.52
by Jeff Licquia
PEP 8 fixes. |
36 |
rev_contents = {1: "one", 1.1: "one dot one", 1.2: "one dot two", |
37 |
1.3: "one dot three", 2: "two", 3: "three", |
|
38 |
4: "four", 5: "five"} |
|
|
0.54.40
by Jeff Licquia
Move the tests to their own module. |
39 |
|
|
0.54.56
by Jeff Licquia
Fix some pylint complaints. |
40 |
test_file = open("test_file") |
41 |
content = test_file.read().strip() |
|
|
0.54.50
by Jeff Licquia
Better diagnostics when an assertRevno() call fails. |
42 |
if content != rev_contents[rev]: |
43 |
rev_ids = dict((rev_contents[k], k) for k in rev_contents.keys()) |
|
44 |
found_rev = rev_ids[content] |
|
45 |
raise AssertionError("expected rev %0.1f, found rev %0.1f" |
|
46 |
% (rev, found_rev)) |
|
|
0.54.40
by Jeff Licquia
Move the tests to their own module. |
47 |
|
48 |
def setUp(self): |
|
49 |
bzrlib.tests.TestCaseWithTransport.setUp(self) |
|
50 |
||
|
0.54.41
by Jeff Licquia
Add a merged subtree to the repo the tests create. |
51 |
# These tests assume a branch with five revisions, and
|
52 |
# a branch from version 1 containing three revisions
|
|
53 |
# merged at version 2.
|
|
|
0.54.40
by Jeff Licquia
Move the tests to their own module. |
54 |
|
55 |
self.tree = self.make_branch_and_tree(".") |
|
56 |
||
|
0.54.56
by Jeff Licquia
Fix some pylint complaints. |
57 |
test_file = open("test_file", "w") |
58 |
test_file.write("one") |
|
59 |
test_file.close() |
|
|
0.54.52
by Jeff Licquia
PEP 8 fixes. |
60 |
self.tree.add(self.tree.relpath(os.path.join(os.getcwd(), |
61 |
'test_file'))) |
|
|
0.60.1
by Gustaf Thorslund
Added test cases for running a test script: |
62 |
test_file_append = open("test_file_append", "a") |
63 |
test_file_append.write("one\n") |
|
64 |
test_file_append.close() |
|
65 |
self.tree.add(self.tree.relpath(os.path.join(os.getcwd(), |
|
66 |
'test_file_append'))) |
|
67 |
self.tree.commit(message = "add test files") |
|
|
0.54.40
by Jeff Licquia
Move the tests to their own module. |
68 |
|
|
0.54.41
by Jeff Licquia
Add a merged subtree to the repo the tests create. |
69 |
bzrlib.bzrdir.BzrDir.open(".").sprout("../temp-clone") |
70 |
clone_bzrdir = bzrlib.bzrdir.BzrDir.open("../temp-clone") |
|
71 |
clone_tree = clone_bzrdir.open_workingtree() |
|
72 |
for content in ["one dot one", "one dot two", "one dot three"]: |
|
|
0.54.56
by Jeff Licquia
Fix some pylint complaints. |
73 |
test_file = open("../temp-clone/test_file", "w") |
74 |
test_file.write(content) |
|
75 |
test_file.close() |
|
|
0.60.1
by Gustaf Thorslund
Added test cases for running a test script: |
76 |
test_file_append = open("../temp-clone/test_file_append", "a") |
77 |
test_file_append.write(content + "\n") |
|
78 |
test_file_append.close() |
|
|
0.54.41
by Jeff Licquia
Add a merged subtree to the repo the tests create. |
79 |
clone_tree.commit(message = "make branch test change") |
|
0.54.49
by Jeff Licquia
Add subtree and harness tests. |
80 |
saved_subtree_revid = clone_tree.branch.last_revision() |
|
0.54.41
by Jeff Licquia
Add a merged subtree to the repo the tests create. |
81 |
|
82 |
self.tree.merge_from_branch(clone_tree.branch) |
|
|
0.54.56
by Jeff Licquia
Fix some pylint complaints. |
83 |
test_file = open("test_file", "w") |
84 |
test_file.write("two") |
|
85 |
test_file.close() |
|
|
0.60.1
by Gustaf Thorslund
Added test cases for running a test script: |
86 |
test_file_append = open("test_file_append", "a") |
87 |
test_file_append.write("two\n") |
|
88 |
test_file_append.close() |
|
|
0.54.41
by Jeff Licquia
Add a merged subtree to the repo the tests create. |
89 |
self.tree.commit(message = "merge external branch") |
90 |
shutil.rmtree("../temp-clone") |
|
91 |
||
|
0.54.49
by Jeff Licquia
Add subtree and harness tests. |
92 |
self.subtree_rev = saved_subtree_revid |
93 |
||
|
0.54.41
by Jeff Licquia
Add a merged subtree to the repo the tests create. |
94 |
file_contents = ["three", "four", "five"] |
|
0.54.40
by Jeff Licquia
Move the tests to their own module. |
95 |
for content in file_contents: |
|
0.54.56
by Jeff Licquia
Fix some pylint complaints. |
96 |
test_file = open("test_file", "w") |
97 |
test_file.write(content) |
|
98 |
test_file.close() |
|
|
0.60.1
by Gustaf Thorslund
Added test cases for running a test script: |
99 |
test_file_append = open("test_file_append", "a") |
100 |
test_file_append.write(content + "\n") |
|
101 |
test_file_append.close() |
|
|
0.54.40
by Jeff Licquia
Move the tests to their own module. |
102 |
self.tree.commit(message = "make test change") |
103 |
||
|
0.54.52
by Jeff Licquia
PEP 8 fixes. |
104 |
|
|
0.54.49
by Jeff Licquia
Add subtree and harness tests. |
105 |
class BisectHarnessTests(BisectTestCase): |
|
0.54.56
by Jeff Licquia
Fix some pylint complaints. |
106 |
"Tests for the harness itself."
|
|
0.54.57
by Jeff Licquia
Check and fix more PEP 8 failures. |
107 |
|
|
0.54.49
by Jeff Licquia
Add subtree and harness tests. |
108 |
def testLastRev(self): |
|
0.54.56
by Jeff Licquia
Fix some pylint complaints. |
109 |
"Test that the last revision is correct."
|
|
0.54.52
by Jeff Licquia
PEP 8 fixes. |
110 |
repo = self.tree.branch.repository |
111 |
top_revtree = repo.revision_tree(self.tree.last_revision()) |
|
|
0.54.49
by Jeff Licquia
Add subtree and harness tests. |
112 |
top_revtree.lock_read() |
113 |
top_file = top_revtree.get_file(top_revtree.path2id("test_file")) |
|
114 |
test_content = top_file.read().strip() |
|
115 |
top_file.close() |
|
116 |
top_revtree.unlock() |
|
117 |
assert test_content == "five" |
|
118 |
||
119 |
def testSubtreeRev(self): |
|
|
0.54.56
by Jeff Licquia
Fix some pylint complaints. |
120 |
"Test that the last revision in a subtree is correct."
|
|
0.54.52
by Jeff Licquia
PEP 8 fixes. |
121 |
repo = self.tree.branch.repository |
122 |
sub_revtree = repo.revision_tree(self.subtree_rev) |
|
|
0.54.49
by Jeff Licquia
Add subtree and harness tests. |
123 |
sub_revtree.lock_read() |
124 |
sub_file = sub_revtree.get_file(sub_revtree.path2id("test_file")) |
|
125 |
test_content = sub_file.read().strip() |
|
126 |
sub_file.close() |
|
127 |
sub_revtree.unlock() |
|
128 |
assert test_content == "one dot three" |
|
129 |
||
|
0.54.52
by Jeff Licquia
PEP 8 fixes. |
130 |
|
|
0.54.60
by Jeff Licquia
Move plugin metadata to its own package, and redo versioning. |
131 |
class BisectMetaTests(BisectTestCase): |
132 |
"Test the metadata provided by the package."
|
|
133 |
||
134 |
def testVersionPresent(self): |
|
135 |
assert bisect.version_info |
|
136 |
||
137 |
def testBzrVersioning(self): |
|
|
0.54.76
by Vincent Ladeuil
Fix the broken test. |
138 |
assert bisect.bzr_minimum_api <= bzrlib.api_minimum_version |
|
0.54.60
by Jeff Licquia
Move plugin metadata to its own package, and redo versioning. |
139 |
assert bisect.bzr_minimum_api <= bzrlib.version_info[:3] |
140 |
||
141 |
||
|
0.54.40
by Jeff Licquia
Move the tests to their own module. |
142 |
class BisectCurrentUnitTests(BisectTestCase): |
|
0.54.56
by Jeff Licquia
Fix some pylint complaints. |
143 |
"Test the BisectCurrent class."
|
|
0.54.57
by Jeff Licquia
Check and fix more PEP 8 failures. |
144 |
|
|
0.54.40
by Jeff Licquia
Move the tests to their own module. |
145 |
def testShowLog(self): |
|
0.54.56
by Jeff Licquia
Fix some pylint complaints. |
146 |
"Test that the log can be shown."
|
|
0.54.40
by Jeff Licquia
Move the tests to their own module. |
147 |
# Not a very good test; just makes sure the code doesn't fail,
|
148 |
# not that the output makes any sense.
|
|
|
0.54.72
by James Westby
Start to remove the use of sys.stdout. |
149 |
sio = StringIO() |
150 |
bisect.BisectCurrent().show_rev_log(out=sio) |
|
|
0.54.40
by Jeff Licquia
Move the tests to their own module. |
151 |
|
|
0.54.49
by Jeff Licquia
Add subtree and harness tests. |
152 |
def testShowLogSubtree(self): |
|
0.54.56
by Jeff Licquia
Fix some pylint complaints. |
153 |
"Test that a subtree's log can be shown."
|
154 |
current = bisect.BisectCurrent() |
|
155 |
current.switch(self.subtree_rev) |
|
|
0.54.72
by James Westby
Start to remove the use of sys.stdout. |
156 |
sio = StringIO() |
157 |
current.show_rev_log(out=sio) |
|
|
0.54.49
by Jeff Licquia
Add subtree and harness tests. |
158 |
|
|
0.54.40
by Jeff Licquia
Move the tests to their own module. |
159 |
def testSwitchVersions(self): |
|
0.54.56
by Jeff Licquia
Fix some pylint complaints. |
160 |
"Test switching versions."
|
161 |
current = bisect.BisectCurrent() |
|
|
0.54.40
by Jeff Licquia
Move the tests to their own module. |
162 |
self.assertRevno(5) |
|
0.54.56
by Jeff Licquia
Fix some pylint complaints. |
163 |
current.switch(4) |
|
0.54.40
by Jeff Licquia
Move the tests to their own module. |
164 |
self.assertRevno(4) |
165 |
||
166 |
def testReset(self): |
|
|
0.54.56
by Jeff Licquia
Fix some pylint complaints. |
167 |
"Test resetting the working tree to a non-bisected state."
|
168 |
current = bisect.BisectCurrent() |
|
169 |
current.switch(4) |
|
170 |
current.reset() |
|
|
0.54.40
by Jeff Licquia
Move the tests to their own module. |
171 |
self.assertRevno(5) |
172 |
assert not os.path.exists(bisect.bisect_rev_path) |
|
173 |
||
|
0.54.43
by Jeff Licquia
Add non-functioning is_merge_point() method to BisectCurrent. |
174 |
def testIsMergePoint(self): |
|
0.54.56
by Jeff Licquia
Fix some pylint complaints. |
175 |
"Test merge point detection."
|
176 |
current = bisect.BisectCurrent() |
|
|
0.54.43
by Jeff Licquia
Add non-functioning is_merge_point() method to BisectCurrent. |
177 |
self.assertRevno(5) |
|
0.54.56
by Jeff Licquia
Fix some pylint complaints. |
178 |
assert not current.is_merge_point() |
179 |
current.switch(2) |
|
180 |
assert current.is_merge_point() |
|
|
0.54.43
by Jeff Licquia
Add non-functioning is_merge_point() method to BisectCurrent. |
181 |
|
|
0.54.52
by Jeff Licquia
PEP 8 fixes. |
182 |
|
|
0.54.40
by Jeff Licquia
Move the tests to their own module. |
183 |
class BisectLogUnitTests(BisectTestCase): |
|
0.54.56
by Jeff Licquia
Fix some pylint complaints. |
184 |
"Test the BisectLog class."
|
|
0.54.57
by Jeff Licquia
Check and fix more PEP 8 failures. |
185 |
|
|
0.54.40
by Jeff Licquia
Move the tests to their own module. |
186 |
def testCreateBlank(self): |
|
0.54.56
by Jeff Licquia
Fix some pylint complaints. |
187 |
"Test creation of new log."
|
188 |
bisect_log = bisect.BisectLog() |
|
189 |
bisect_log.save() |
|
|
0.54.40
by Jeff Licquia
Move the tests to their own module. |
190 |
assert os.path.exists(bisect.bisect_info_path) |
191 |
||
192 |
def testLoad(self): |
|
|
0.54.56
by Jeff Licquia
Fix some pylint complaints. |
193 |
"Test loading a log."
|
194 |
preloaded_log = open(bisect.bisect_info_path, "w") |
|
195 |
preloaded_log.write("rev1 yes\nrev2 no\nrev3 yes\n") |
|
196 |
preloaded_log.close() |
|
|
0.54.40
by Jeff Licquia
Move the tests to their own module. |
197 |
|
|
0.54.56
by Jeff Licquia
Fix some pylint complaints. |
198 |
bisect_log = bisect.BisectLog() |
199 |
assert len(bisect_log._items) == 3 |
|
200 |
assert bisect_log._items[0] == ("rev1", "yes") |
|
201 |
assert bisect_log._items[1] == ("rev2", "no") |
|
202 |
assert bisect_log._items[2] == ("rev3", "yes") |
|
|
0.54.40
by Jeff Licquia
Move the tests to their own module. |
203 |
|
204 |
def testSave(self): |
|
|
0.54.56
by Jeff Licquia
Fix some pylint complaints. |
205 |
"Test saving the log."
|
206 |
bisect_log = bisect.BisectLog() |
|
207 |
bisect_log._items = [("rev1", "yes"), ("rev2", "no"), ("rev3", "yes")] |
|
208 |
bisect_log.save() |
|
|
0.54.40
by Jeff Licquia
Move the tests to their own module. |
209 |
|
|
0.54.56
by Jeff Licquia
Fix some pylint complaints. |
210 |
logfile = open(bisect.bisect_info_path) |
211 |
assert logfile.read() == "rev1 yes\nrev2 no\nrev3 yes\n" |
|
|
0.54.40
by Jeff Licquia
Move the tests to their own module. |
212 |
|
|
0.54.52
by Jeff Licquia
PEP 8 fixes. |
213 |
|
|
0.54.40
by Jeff Licquia
Move the tests to their own module. |
214 |
class BisectFuncTests(BisectTestCase): |
|
0.54.56
by Jeff Licquia
Fix some pylint complaints. |
215 |
"Functional tests for the bisect plugin."
|
|
0.54.57
by Jeff Licquia
Check and fix more PEP 8 failures. |
216 |
|
|
0.54.40
by Jeff Licquia
Move the tests to their own module. |
217 |
def testWorkflow(self): |
|
0.54.56
by Jeff Licquia
Fix some pylint complaints. |
218 |
"Run through a basic usage scenario."
|
219 |
||
|
0.54.40
by Jeff Licquia
Move the tests to their own module. |
220 |
# Start up the bisection. When the two ends are set, we should
|
221 |
# end up in the middle.
|
|
222 |
||
223 |
self.run_bzr(['bisect', 'start']) |
|
224 |
self.run_bzr(['bisect', 'yes']) |
|
225 |
self.run_bzr(['bisect', 'no', '-r', '1']) |
|
226 |
self.assertRevno(3) |
|
227 |
||
228 |
# Mark feature as present in the middle. Should move us
|
|
229 |
# halfway back between the current middle and the start.
|
|
230 |
||
231 |
self.run_bzr(['bisect', 'yes']) |
|
232 |
self.assertRevno(2) |
|
233 |
||
234 |
# Mark feature as not present. Since this is only one
|
|
235 |
# rev back from the lowest marked revision with the feature,
|
|
236 |
# the process should end, with the current rev set to the
|
|
237 |
# rev following.
|
|
238 |
||
239 |
self.run_bzr(['bisect', 'no']) |
|
240 |
self.assertRevno(3) |
|
241 |
||
|
0.59.7
by Jeff Licquia
Tests for detecting "done" status, plus a first run at implementation. |
242 |
# Run again. Since we're done, this should do nothing.
|
243 |
||
244 |
self.run_bzr(['bisect', 'no']) |
|
245 |
self.assertRevno(3) |
|
246 |
||
|
0.54.42
by Jeff Licquia
Add functional test for subtree functionality (not passing). |
247 |
def testWorkflowSubtree(self): |
|
0.54.56
by Jeff Licquia
Fix some pylint complaints. |
248 |
"""Run through a usage scenario where the offending change |
249 |
is in a subtree."""
|
|
250 |
||
|
0.54.42
by Jeff Licquia
Add functional test for subtree functionality (not passing). |
251 |
# Similar to testWorkflow, but make sure the plugin traverses
|
252 |
# subtrees when the "final" revision is a merge point.
|
|
253 |
||
254 |
# This part is similar to testWorkflow.
|
|
255 |
||
256 |
self.run_bzr(['bisect', 'start']) |
|
257 |
self.run_bzr(['bisect', 'yes']) |
|
258 |
self.run_bzr(['bisect', 'no', '-r', '1']) |
|
259 |
self.run_bzr(['bisect', 'yes']) |
|
260 |
||
261 |
# Check to make sure we're where we expect to be.
|
|
262 |
||
263 |
self.assertRevno(2) |
|
264 |
||
265 |
# Now, mark the merge point revno, meaning the feature
|
|
266 |
# appeared at a merge point.
|
|
267 |
||
268 |
self.run_bzr(['bisect', 'yes']) |
|
269 |
self.assertRevno(1.2) |
|
270 |
||
271 |
# Continue bisecting along the subtree to the real conclusion.
|
|
272 |
||
273 |
self.run_bzr(['bisect', 'yes']) |
|
274 |
self.assertRevno(1.1) |
|
275 |
self.run_bzr(['bisect', 'yes']) |
|
276 |
self.assertRevno(1.1) |
|
277 |
||
|
0.59.7
by Jeff Licquia
Tests for detecting "done" status, plus a first run at implementation. |
278 |
# Run again. Since we're done, this should do nothing.
|
279 |
||
280 |
self.run_bzr(['bisect', 'yes']) |
|
281 |
self.assertRevno(1.1) |
|
282 |
||
|
0.54.40
by Jeff Licquia
Move the tests to their own module. |
283 |
def testMove(self): |
|
0.54.56
by Jeff Licquia
Fix some pylint complaints. |
284 |
"Test manually moving to a different revision during the bisection."
|
285 |
||
|
0.54.40
by Jeff Licquia
Move the tests to their own module. |
286 |
# Set up a bisection in progress.
|
287 |
||
288 |
self.run_bzr(['bisect', 'start']) |
|
289 |
self.run_bzr(['bisect', 'yes']) |
|
290 |
self.run_bzr(['bisect', 'no', '-r', '1']) |
|
291 |
||
292 |
# Move.
|
|
293 |
||
294 |
self.run_bzr(['bisect', 'move', '-r', '2']) |
|
295 |
self.assertRevno(2) |
|
296 |
||
297 |
def testReset(self): |
|
|
0.54.56
by Jeff Licquia
Fix some pylint complaints. |
298 |
"Test resetting the tree."
|
299 |
||
|
0.54.40
by Jeff Licquia
Move the tests to their own module. |
300 |
# Set up a bisection in progress.
|
301 |
||
302 |
self.run_bzr(['bisect', 'start']) |
|
303 |
self.run_bzr(['bisect', 'yes']) |
|
304 |
self.run_bzr(['bisect', 'no', '-r', '1']) |
|
305 |
self.run_bzr(['bisect', 'yes']) |
|
306 |
||
307 |
# Now reset.
|
|
308 |
||
309 |
self.run_bzr(['bisect', 'reset']) |
|
310 |
self.assertRevno(5) |
|
311 |
||
|
0.59.4
by Jeff Licquia
Make reset a no-op if no bisection is in progress. |
312 |
# Check that reset doesn't do anything unless there's a
|
313 |
# bisection in progress.
|
|
314 |
||
315 |
test_file = open("test_file", "w") |
|
316 |
test_file.write("keep me") |
|
317 |
test_file.close() |
|
318 |
||
|
0.54.73
by James Westby
Some cleanups. |
319 |
out, err = self.run_bzr(['bisect', 'reset'], retcode=3) |
320 |
self.assert_("No bisection in progress." in err) |
|
|
0.59.4
by Jeff Licquia
Make reset a no-op if no bisection is in progress. |
321 |
|
322 |
test_file = open("test_file") |
|
323 |
content = test_file.read().strip() |
|
324 |
test_file.close() |
|
325 |
self.failUnless(content == "keep me") |
|
326 |
||
|
0.54.40
by Jeff Licquia
Move the tests to their own module. |
327 |
def testLog(self): |
|
0.54.56
by Jeff Licquia
Fix some pylint complaints. |
328 |
"Test saving the current bisection state, and re-loading it."
|
329 |
||
|
0.54.40
by Jeff Licquia
Move the tests to their own module. |
330 |
# Set up a bisection in progress.
|
331 |
||
332 |
self.run_bzr(['bisect', 'start']) |
|
333 |
self.run_bzr(['bisect', 'yes']) |
|
334 |
self.run_bzr(['bisect', 'no', '-r', '1']) |
|
335 |
self.run_bzr(['bisect', 'yes']) |
|
336 |
||
337 |
# Now save the log.
|
|
338 |
||
339 |
self.run_bzr(['bisect', 'log', '-o', 'bisect_log']) |
|
340 |
||
341 |
# Reset.
|
|
342 |
||
343 |
self.run_bzr(['bisect', 'reset']) |
|
344 |
||
345 |
# Read it back in.
|
|
346 |
||
347 |
self.run_bzr(['bisect', 'replay', 'bisect_log']) |
|
348 |
self.assertRevno(2) |
|
349 |
||
350 |
# Mark another state, and see if the bisect moves in the
|
|
351 |
# right way.
|
|
352 |
||
353 |
self.run_bzr(['bisect', 'no']) |
|
354 |
self.assertRevno(3) |
|
|
0.60.1
by Gustaf Thorslund
Added test cases for running a test script: |
355 |
|
356 |
def testRunScript(self): |
|
357 |
"Make a test script and run it."
|
|
358 |
test_script = open("test_script", "w") |
|
359 |
test_script.write("#!/bin/sh\n" |
|
360 |
"grep -q '^four' test_file_append\n") |
|
361 |
test_script.close() |
|
362 |
os.chmod("test_script", stat.S_IRWXU) |
|
363 |
self.run_bzr(['bisect', 'start']) |
|
364 |
self.run_bzr(['bisect', 'yes']) |
|
365 |
self.run_bzr(['bisect', 'no', '-r', '1']) |
|
366 |
self.run_bzr(['bisect', 'run', './test_script']) |
|
367 |
self.assertRevno(4) |
|
368 |
||
369 |
def testRunScriptMergePoint(self): |
|
370 |
"Make a test script and run it."
|
|
371 |
test_script = open("test_script", "w") |
|
372 |
test_script.write("#!/bin/sh\n" |
|
373 |
"grep -q '^two' test_file_append\n") |
|
374 |
test_script.close() |
|
375 |
os.chmod("test_script", stat.S_IRWXU) |
|
376 |
self.run_bzr(['bisect', 'start']) |
|
377 |
self.run_bzr(['bisect', 'yes']) |
|
378 |
self.run_bzr(['bisect', 'no', '-r', '1']) |
|
379 |
self.run_bzr(['bisect', 'run', './test_script']) |
|
|
0.60.3
by Gustaf Thorslund
Marked two tests as KnownFailure due to: |
380 |
try: |
381 |
self.assertRevno(2) |
|
382 |
except AssertionError: |
|
383 |
raise KnownFailure\ |
|
384 |
("bisect does not drill down into merge commits: " |
|
385 |
"https://bugs.launchpad.net/bzr-bisect/+bug/539937") |
|
386 |
||
|
0.60.1
by Gustaf Thorslund
Added test cases for running a test script: |
387 |
def testRunScriptSubtree(self): |
388 |
"Make a test script and run it."
|
|
389 |
test_script = open("test_script", "w") |
|
390 |
test_script.write("#!/bin/sh\n" |
|
391 |
"grep -q '^one dot two' test_file_append\n") |
|
392 |
test_script.close() |
|
393 |
os.chmod("test_script", stat.S_IRWXU) |
|
394 |
self.run_bzr(['bisect', 'start']) |
|
395 |
self.run_bzr(['bisect', 'yes']) |
|
396 |
self.run_bzr(['bisect', 'no', '-r', '1']) |
|
397 |
self.run_bzr(['bisect', 'run', './test_script']) |
|
|
0.60.3
by Gustaf Thorslund
Marked two tests as KnownFailure due to: |
398 |
try: |
399 |
self.assertRevno(1.2) |
|
400 |
except AssertionError: |
|
401 |
raise KnownFailure\ |
|
402 |
("bisect does not drill down into merge commits: " |
|
403 |
"https://bugs.launchpad.net/bzr-bisect/+bug/539937") |