git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Sixt <j6t@kdbg.org>
To: "Torsten Bögershausen" <tboegi@web.de>
Cc: Ramsay Jones <ramsay@ramsay1.demon.co.uk>,
	Junio C Hamano <gitster@pobox.com>,
	git@vger.kernel.org
Subject: [PATCH] t5000 on Windows: do not mistake "sh.exe" as "sh"
Date: Mon, 24 Nov 2014 19:29:37 +0100	[thread overview]
Message-ID: <54737911.2040502@kdbg.org> (raw)
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

  reply	other threads:[~2014-11-24 18:29 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-23 14:16 [PATCH RFC] CYGWIN: avoid implicit declaration warning Torsten Bögershausen
2014-11-23 17:12 ` Ramsay Jones
2014-11-23 18:53   ` Junio C Hamano
2014-11-23 23:15     ` Ramsay Jones
2014-11-24  7:20       ` Torsten Bögershausen
2014-11-24 16:00         ` Torsten Bögershausen
2014-11-24 18:29           ` Johannes Sixt [this message]
2014-11-24 20:02             ` [PATCH] t5000 on Windows: do not mistake "sh.exe" as "sh" Torsten Bögershausen
2014-11-24 21:27         ` [PATCH RFC] CYGWIN: avoid implicit declaration warning Ramsay Jones
2014-11-24 21:44           ` Junio C Hamano
2014-11-24 22:59             ` Ramsay Jones
2014-11-24 22:27       ` Ramsay Jones
2014-11-24 22:50         ` Junio C Hamano
2014-11-24 23:04           ` Ramsay Jones
2014-11-24 17:59 ` Jonathan Nieder
2014-11-24 19:17   ` Torsten Bögershausen
2014-11-24 21:41   ` Ramsay Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54737911.2040502@kdbg.org \
    --to=j6t@kdbg.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=ramsay@ramsay1.demon.co.uk \
    --cc=tboegi@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).