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

Re: [PATCH v3 3/4] t7800: modernize tests

From
Johannes Sixt <j.sixt@viscovery.net>
Date
Mar 20, 2013, 09:48 UTC
Message-ID
<514985FB.8080806@viscovery.net>
In-Reply-To
<1361419428-22410-3-git-send-email-davvid@gmail.com>
Am 2/21/2013 5:03, schrieb David Aguilar:
Show 8 quoted lines
>  test_expect_success PERL 'difftool -d' '
> -	diff=$(git difftool -d --extcmd ls branch) &&
> -	echo "$diff" | stdin_contains sub &&
> -	echo "$diff" | stdin_contains file
> +	git difftool -d --extcmd ls branch >output &&
> +	stdin_contains sub <output &&
> +	stdin_contains file <output
>  '
This test is broken on Windows. There is this code in git-difftool.perl
	for my $file (@worktree) {
...
			copy("$b/$file", "$workdir/$file") or
			exit_cleanup($tmpdir, 1);
...
	}

@worktree is populated with all files in the worktree. At this point, "output" is among them. Then follows an attempt to copy a file over "$workdir/$file". I guess that is some link+remove magic going on behind the scenes. At any rate, this fails on Windows with "D:/Src/mingw-git/t/trash directory.t7800-difftool/../../git-difftool line 408: Bad file number", because files that are open cannot be written from outside (the file is open due to the redirection in the test snippet).

What is going on here? Why can this ever succeed even on Unix?
Same for some later tests.

BTW, while debugging this, I found the use of the helper function stdin_contains() highly unhelpful; it just resolves to a 'grep' that on top of all hides stdout. Please don't do that. Just use unadorned grep like we do everywhere else.

-- Hannes
Previous: David AguilarNext: David Aguilar
Message 8 of 55 in “difftool: silence uninitialized variable warning”
  1. 1/4 difftool: silence uninitialized variable warningDavid Aguilar, Feb 21, 2013
  2. 2/4 t7800: update copyright noticeDavid Aguilar, Feb 21, 2013
  3. 3/4 t7800: modernize testsDavid Aguilar, Feb 21, 2013
  4. 4/4 t7800: "defaults" is no longer a builtin tool nameDavid Aguilar, Feb 21, 2013
  5. Junio C HamanoFeb 21, 2013
  6. Junio C HamanoFeb 21, 2013
  7. David AguilarFeb 21, 2013
  8. Johannes SixtMar 20, 2013
  9. David AguilarMar 20, 2013
  10. Johannes SixtMar 21, 2013
  11. Johannes SixtMar 22, 2013
  12. John KeepingMar 22, 2013
  13. Johannes SixtMar 22, 2013
  14. John KeepingMar 22, 2013
  15. 0/3 Improve difftool --dir-diff testsJohn Keeping, Mar 22, 2013
  16. 1/3 t7800: don't hide grep outputJohn Keeping, Mar 22, 2013
  17. Johannes SixtMar 22, 2013
  18. Junio C HamanoMar 22, 2013
  19. 2/3 t7800: fix tests when difftool uses --no-symlinksJohn Keeping, Mar 22, 2013
  20. Johannes SixtMar 22, 2013
  21. Junio C HamanoMar 22, 2013
  22. John KeepingMar 22, 2013
  23. David AguilarMar 23, 2013
  24. 3/3 t7800: run --dir-diff tests with and without symlinksJohn Keeping, Mar 22, 2013
  25. 3/3 t7800: run --dir-diff tests with and without symlinksJohn Keeping, Mar 22, 2013
  26. 0/3 difftool --dir-diff test improvementsJohn Keeping, Mar 23, 2013
  27. 1/3 t7800: don't hide grep outputJohn Keeping, Mar 23, 2013
  28. 2/3 t7800: fix tests when difftool uses --no-symlinksJohn Keeping, Mar 23, 2013
  29. Junio C HamanoMar 24, 2013
  30. John KeepingMar 24, 2013
  31. Matt McClureMar 24, 2013
  32. John KeepingMar 24, 2013
  33. Johannes SixtMar 25, 2013
  34. John KeepingMar 25, 2013
  35. difftool: don't overwrite modified filesJohn Keeping, Mar 25, 2013
  36. Johannes SixtMar 26, 2013
  37. Johannes SixtMar 26, 2013
  38. John KeepingMar 26, 2013
  39. Johannes SixtMar 26, 2013
  40. John KeepingMar 26, 2013
  41. Matt McClureMar 26, 2013
  42. John KeepingMar 26, 2013
  43. Junio C HamanoMar 25, 2013
  44. David AguilarMar 24, 2013
  45. John KeepingMar 25, 2013
  46. Junio C HamanoMar 25, 2013
  47. Matt McClureMar 24, 2013
  48. Eric SunshineMar 24, 2013
  49. 3/3 t7800: run --dir-diff tests with and without symlinksJohn Keeping, Mar 23, 2013
  50. Johannes SixtMar 25, 2013
  51. John KeepingMar 25, 2013
  52. Johannes SixtMar 25, 2013
  53. John KeepingMar 25, 2013
  54. Junio C HamanoMar 25, 2013
  55. John KeepingMar 26, 2013

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.