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

Re: [PATCH v2 1/2] tests: move code to run completion tests under bash into a helper library

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Apr 17, 2012, 07:37 UTC
Message-ID
<CAMP44s2isAvmEhaTJpg8qsT967ghkvjyU1OAnTLMZSb5MSsnXw@mail.gmail.com>
In-Reply-To
<4F8D19B8.1040004@viscovery.net>
2012/4/17 Johannes Sixt <j.sixt@viscovery.net>:
Show 28 quoted lines
> Am 4/17/2012 0:09, schrieb SZEDER Gábor:
>> diff --git a/t/lib-completion.sh b/t/lib-completion.sh
>> new file mode 100644
>> index 00000000..3d85feb2
>> --- /dev/null
>> +++ b/t/lib-completion.sh
>> @@ -0,0 +1,17 @@
>> +#!/bin/sh
>> +#
>> +# Ensures that tests of the completion script are run under Bash.
>> +
>> +if test -n "$BASH" && test -z "$POSIXLY_CORRECT"; then
>> +     # we are in full-on bash mode
>> +     true
>> +elif type bash >/dev/null 2>&1; then
>> +     # execute in full-on bash mode
>> +     unset POSIXLY_CORRECT
>> +     exec bash "$0" "$@"
>> +else
>> +     echo '1..0 #SKIP skipping bash completion tests; bash not available'
>> +     exit 0
>> +fi
>
> I wonder what this 'echo...;exit' is about (I do so since I saw it the
> first time when Felipe submitted his patch). Shouldn't it be more like:
>
>        skip_all='skipping bash completion tests; bash not available'
>        test_done

It should, if the test library was loaded at that point, but it isn't. BTW, I didn't write that code.

In any case, what the user sees is exactly the same, except without color.
Cheers.
-- 
Felipe Contreras
Previous: Johannes Sixt
Message 14 of 14 in “tests: add tests for the bash prompt functions in the completion script”
  1. tests: add tests for the bash prompt functions in the completion scriptSZEDER Gábor, Apr 15, 2012
  2. Felipe ContrerasApr 15, 2012
  3. SZEDER GáborApr 16, 2012
  4. Felipe ContrerasApr 16, 2012
  5. SZEDER GáborApr 16, 2012
  6. Jonathan NiederApr 16, 2012
  7. 1/2 tests: move code to run completion tests under bash into a helper librarySZEDER Gábor, Apr 16, 2012
  8. 2/2 tests: add tests for the bash prompt functions in the completion scriptSZEDER Gábor, Apr 16, 2012
  9. Jonathan NiederApr 16, 2012
  10. SZEDER GáborApr 17, 2012
  11. Jonathan NiederApr 16, 2012
  12. SZEDER GáborApr 17, 2012
  13. Johannes SixtApr 17, 2012
  14. Felipe ContrerasApr 17, 2012

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.