test-bisect: test --command option
authorPatrick Mezard <pmezard@gmail.com>
Sat, 13 Jun 2009 22:42:15 +0200
changeset 8803 2b35ced86b69
parent 8802 ca14b3982ffe
child 8804 820723a4bd17
test-bisect: test --command option
tests/test-bisect
tests/test-bisect.out
--- a/tests/test-bisect	Sat Jun 13 22:42:13 2009 +0200
+++ b/tests/test-bisect	Sat Jun 13 22:42:15 2009 +0200
@@ -83,6 +83,24 @@
 hg bisect -s 
 hg bisect -g
 
+set +e
+
 echo % test invalid command
 hg bisect -r
 hg bisect --command 'foobar'
+
+echo % test bisecting command
+cat > script.py <<EOF
+#!/usr/bin/env python
+import sys
+from mercurial import ui, hg
+repo = hg.repository(ui.ui(), '.')
+if repo['.'].rev() < 6:
+    sys.exit(1)
+EOF
+chmod +x script.py
+hg bisect -r
+hg bisect --good tip
+hg bisect --bad 0
+hg bisect --command "`pwd`/script.py"
+true
--- a/tests/test-bisect.out	Sat Jun 13 22:42:13 2009 +0200
+++ b/tests/test-bisect.out	Sat Jun 13 22:42:15 2009 +0200
@@ -305,3 +305,12 @@
 
 % test invalid command
 abort: cannot find executable: foobar
+% test bisecting command
+Testing changeset 15:e7fa0811edb0 (31 changesets remaining, ~4 tests)
+1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+The first good revision is:
+changeset:   6:a3d5c6fdf0d3
+user:        test
+date:        Thu Jan 01 00:00:06 1970 +0000
+summary:     msg 6
+