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

[PATCH] t5000 on Windows: do not mistake "sh.exe" as "sh"

From
Johannes Sixt <j6t@kdbg.org>
Date
Nov 24, 2014, 18:29 UTC
Message-ID
<54737911.2040502@kdbg.org>
In-Reply-To
<54735638.9000502@web.de>

In their effort to emulate POSIX as close as possible, the MSYS tools and Cygwin treat the file name "foo.exe" as "foo" when the latter is asked for, but not present, but the former is present.

Following this rule, 'cp /bin/sh a/bin' actually copies the file /bin/sh.exe, so that we now have a/bin/sh.exe in the repository. This difference did not matter in the tests in the past because we were only interested in the equality of contents generated in various ways. But recently added tests check file names, in particular, the presence of "a/bin/sh". This test fails on Windows, as we do not have a file by this name, but "a/bin/sh.exe".

Use test-genrandom to generate the large binary file in the repository under the expected name.

We could change the guilty line to 'cat /bin/sh >a/bin/sh', but it is better for test reproducibility to ensure that the test data is the same across platforms, which test-genrandom can guarantee.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
Am 24.11.2014 um 17:00 schrieb Torsten Bögershausen:
> The test suite passes, except
> t5000 - not ok 48 - archive and :(glob)
> 
> fatal: pathspec '*.abc' did not match any files
I've this patch in my tree for a while.
 t/t5000-tar-tree.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh
index d01bbdc..4b68bba 100755
--- a/t/t5000-tar-tree.sh
+++ b/t/t5000-tar-tree.sh
@@ -101,7 +101,7 @@ test_expect_success \
      ten=0123456789 && hundred=$ten$ten$ten$ten$ten$ten$ten$ten$ten$ten &&
      echo long filename >a/four$hundred &&
      mkdir a/bin &&
-     cp /bin/sh a/bin &&
+     test-genrandom "frotz" 500000 >a/bin/sh &&
      printf "A\$Format:%s\$O" "$SUBSTFORMAT" >a/substfile1 &&
      printf "A not substituted O" >a/substfile2 &&
      if test_have_prereq SYMLINKS; then
-- 
2.0.0.12.gbcf935e
Previous: Torsten BögershausenNext: Torsten Bögershausen
Message 7 of 17 in “CYGWIN: avoid implicit declaration warning”
  1. CYGWIN: avoid implicit declaration warningTorsten Bögershausen, Nov 23, 2014
  2. Ramsay JonesNov 23, 2014
  3. Junio C HamanoNov 23, 2014
  4. Ramsay JonesNov 23, 2014
  5. Torsten BögershausenNov 24, 2014
  6. Torsten BögershausenNov 24, 2014
  7. t5000 on Windows: do not mistake "sh.exe" as "sh"Johannes Sixt, Nov 24, 2014
  8. Torsten BögershausenNov 24, 2014
  9. Ramsay JonesNov 24, 2014
  10. Junio C HamanoNov 24, 2014
  11. Ramsay JonesNov 24, 2014
  12. Ramsay JonesNov 24, 2014
  13. Junio C HamanoNov 24, 2014
  14. Ramsay JonesNov 24, 2014
  15. Jonathan NiederNov 24, 2014
  16. Torsten BögershausenNov 24, 2014
  17. Ramsay JonesNov 24, 2014

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.