git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v4 1/6] t6030-bisect-porcelain: add tests to control bisect run exit cases

From
Miriam R. <mirucam@gmail.com>
Date
Aug 17, 2021, 20:19 UTC
Message-ID
<CAN7CjDBJMLn=MkJHnFFBmTsMR0dy65+D1UMWObyHV8=qoNfOHg@mail.gmail.com>
In-Reply-To
<CAP8UFD0RFm=CBsckhdBJKJ9QAw+hWT0yY84J4dNcaXegRp4u0w@mail.gmail.com>
Hi,

El mar, 17 ago 2021 a las 11:23, Christian Couder (<christian.couder@gmail.com>) escribió:

Show 15 quoted lines
>
> On Tue, Aug 17, 2021 at 11:03 AM Bagas Sanjaya <bagasdotme@gmail.com> wrote:
> >
> > On 17/08/21 15.14, Miriam Rubio wrote:
> >
> > > +test_expect_success 'bisect run fails with exit code equals or greater than 128' '
> > > +     write_script test_script.sh <<-\EOF &&
> > > +     exit 128 >/dev/null
> > > +     EOF
> > > +     test_must_fail git bisect run ./test_script.sh > my_bisect_log.txt
> > > +'
> >
> > This only checks for exit code equals to 128. You should also check for
> > exit code greater than 128, for example 255.
> >

Noted. Thank you for reviewing, Bagas.

Show 23 quoted lines
> > > +
> > > +test_expect_success 'bisect run fails with exit code smaller than 0' '
> > > +     write_script test_script.sh <<-\EOF &&
> > > +     exit -1 >/dev/null
> > > +     EOF
> > > +     test_must_fail git bisect run ./test_script.sh > my_bisect_log.txt
> > > +'
> >
> > This test looks OK, using -1 as representative of negative exit code.
> > However, wording of test name can also be 'bisect run fails with
> > negative exit code'.
>
> Actually I am not sure that it makes sense to test an exit code
> smaller than 0, as POSIX exit codes are between 0 and 255 (included).
>
> For example:
>
> $ bash -c 'exit -1'; echo $?
> 255
>
> $ dash -c 'exit -1'; echo $?
> dash: 1: exit: Illegal number: -1
> 2

Ok, I will remove this test. No problem. Thanks, Christian.

Previous: Christian CouderNext: Miriam Rubio
Message 5 of 20 in “Finish converting git bisect to C part 4”
  1. 0/6 Finish converting git bisect to C part 4Miriam Rubio, Aug 17, 2021
  2. 1/6 t6030-bisect-porcelain: add tests to control bisect run exit casesMiriam Rubio, Aug 17, 2021
  3. Bagas SanjayaAug 17, 2021
  4. Christian CouderAug 17, 2021
  5. Miriam R.Aug 17, 2021
  6. 2/6 t6030-bisect-porcelain: add test for bisect visualizeMiriam Rubio, Aug 17, 2021
  7. Bagas SanjayaAug 17, 2021
  8. Miriam R.Aug 17, 2021
  9. 3/6 run-command: make `exists_in_PATH()` non-staticMiriam Rubio, Aug 17, 2021
  10. 4/6 bisect--helper: reimplement `bisect_visualize()`shell function in CMiriam Rubio, Aug 17, 2021
  11. Johannes SchindelinAug 17, 2021
  12. Miriam R.Aug 17, 2021
  13. 5/6 bisect--helper: reimplement `bisect_run` shell function in CMiriam Rubio, Aug 17, 2021
  14. Johannes SchindelinAug 17, 2021
  15. Miriam R.Aug 17, 2021
  16. Johannes SchindelinAug 17, 2021
  17. Christian CouderAug 18, 2021
  18. Miriam R.Aug 18, 2021
  19. 6/6 bisect--helper: retire `--bisect-next-check` subcommandMiriam Rubio, Aug 17, 2021
  20. Johannes SchindelinAug 17, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.