@@ -274,53 +274,35 @@ $ git bisect start HEAD origin -- # HEAD is bad, origin is good
274274$ git bisect run make test # "make test" builds and tests
275275------------
276276
277- * Automatically bisect a broken test suite:
278- +
279- ------------
280- $ cat ~/test.sh
281- #!/bin/sh
282- make || exit 125 # this skips broken builds
283- make test # "make test" runs the test suite
284- $ git bisect start v1.3 v1.1 -- # v1.3 is bad, v1.1 is good
285- $ git bisect run ~/test.sh
286- ------------
287- +
288- Here we use a "test.sh" custom script. In this script, if "make"
289- fails, we skip the current commit.
290- +
291- It is safer to use a custom script outside the repository to prevent
292- interactions between the bisect, make and test processes and the
293- script.
294- +
295- "make test" should "exit 0", if the test suite passes, and
296- "exit 1" otherwise.
297-
298277* Automatically bisect a broken test case:
299278+
300279------------
301280$ cat ~/test.sh
302281#!/bin/sh
303282make || exit 125 # this skips broken builds
304- ~/check_test_case.sh # does the test case passes ?
283+ ~/check_test_case.sh # does the test case pass ?
305284$ git bisect start HEAD HEAD~10 -- # culprit is among the last 10
306285$ git bisect run ~/test.sh
307286------------
308287+
309- Here "check_test_case.sh" should "exit 0" if the test case passes,
288+ Here we use a "test.sh" custom script. In this script, if "make"
289+ fails, we skip the current commit.
290+ "check_test_case.sh" should "exit 0" if the test case passes,
310291and "exit 1" otherwise.
311292+
312- It is safer if both "test.sh" and "check_test_case.sh" scripts are
293+ It is safer if both "test.sh" and "check_test_case.sh" are
313294outside the repository to prevent interactions between the bisect,
314295make and test processes and the scripts.
315296
316- * Automatically bisect a broken test suite :
297+ * Automatically bisect a broken test case :
317298+
318299------------
319300$ git bisect start HEAD HEAD~10 -- # culprit is among the last 10
320301$ git bisect run sh -c "make || exit 125; ~/check_test_case.sh"
321302------------
322303+
323- Does the same as the previous example, but on a single line.
304+ This shows that you can do without a run script if you write the test
305+ on a single line.
324306
325307Author
326308------
0 commit comments