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

Re: [PATCH v2 2/5] t/t4004-diff-rename-symlink.sh: use three-arg <prereq>

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Jul 29, 2010, 01:09 UTC
Message-ID
<20100729010903.GF29156@dert.cs.uchicago.edu>
In-Reply-To
<1280313299-721-3-git-send-email-avarab@gmail.com>
Ævar Arnfjörð Bjarmason wrote:
Show 7 quoted lines
> Change the tests that skipped due to unavailable SYMLINKS support to
> use the three-arg prereq form of test_expect_success.
> 
> This is like the "tests: implicitly skip SYMLINKS tests using
> <prereq>" change, but I needed to create an additional test for some
> setup code. It's in a separate change as suggested by Jonathan Nieder
> for ease of reviewing.

Hmm, I still don’t understand this. Do you mean that there is some setup that needs to be run before these commands, and so the patch fails if that change is not included?

Or is it a matter of "while at it, fix this other problem I noticed" (which would be fine, but it is clearer to present it as such if so)?

Show 21 quoted lines
> diff --git a/t/t4004-diff-rename-symlink.sh b/t/t4004-diff-rename-symlink.sh
> index 1a09e8d..92a65f4 100755
> --- a/t/t4004-diff-rename-symlink.sh
> +++ b/t/t4004-diff-rename-symlink.sh
> @@ -40,8 +34,9 @@ test_expect_success \
>  # rezrov and nitfol are rename/copy of frotz and bozbar should be
>  # a new creation.
>  
> -GIT_DIFF_OPTS=--unified=0 git diff-index -M -p $tree >current
> -cat >expected <<\EOF
> +test_expect_success SYMLINKS 'setup diff output' "
> +    GIT_DIFF_OPTS=--unified=0 git diff-index -M -p $tree >current &&
> +    cat >expected <<\EOF
>  diff --git a/bozbar b/bozbar
>  new file mode 120000
>  --- /dev/null
> @@ -65,8 +60,9 @@ deleted file mode 100644
>  -xyzzy
>  \ No newline at end of file
>  EOF
> +"

Tip for the future: if you use 'straight quotes', then readers can avoid carefully scanning through for $ and similar oddities (and the test script presented with the "expecting success:" prompt will use the friendlier $tree instead of 76c98ds89).

The patch looks good; my only remaining concern is the log message as mentioned above.

Thanks, Jonathan

Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 5 of 11 in “Skip tests using 3-arg test_*”
  1. 0/5 Skip tests using 3-arg test_*Ævar Arnfjörð Bjarmason, Jul 28, 2010
  2. 1/5 tests: implicitly skip SYMLINKS tests using <prereq>Ævar Arnfjörð Bjarmason, Jul 28, 2010
  3. Jonathan NiederJul 29, 2010
  4. 2/5 t/t4004-diff-rename-symlink.sh: use three-arg <prereq>Ævar Arnfjörð Bjarmason, Jul 28, 2010
  5. Jonathan NiederJul 29, 2010
  6. Ævar Arnfjörð BjarmasonJul 29, 2010
  7. 3/5 t/t5800-remote-helpers.sh: Skip with prereq on python <2.4Ævar Arnfjörð Bjarmason, Jul 28, 2010
  8. Jonathan NiederJul 29, 2010
  9. Ævar Arnfjörð BjarmasonJul 29, 2010
  10. 4/5 t/t7800-difftool.sh: Skip with prereq on no PERLÆvar Arnfjörð Bjarmason, Jul 28, 2010
  11. 5/5 t/README: Update "Skipping tests" to align with best practicesÆvar Arnfjörð Bjarmason, Jul 28, 2010

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.