All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/11] Test on Windows - prequel
@ 2009-03-18 21:27 Johannes Sixt
  2009-03-18 21:27 ` [PATCH 01/10] t9400, t9401: Do not force hard-linked clone Johannes Sixt
                   ` (11 more replies)
  0 siblings, 12 replies; 27+ messages in thread
From: Johannes Sixt @ 2009-03-18 21:27 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Johannes Sixt

I'm preparing a series of patches that adjust the test suite so that it
passes on Windows (MinGW port). This is the initial part of it. Another
dozen or more are to follow. By splitting the series I hope to get
earlier feedback.

The series is also available from

 git://repo.or.cz/git/mingw/j6t.git for-junio

 http://repo.or.cz/w/git/mingw/j6t.git?a=shortlog;h=refs/heads/for-junio

-- Hannes

Johannes Schindelin (1):
  t7300: fix clean up on Windows

Johannes Sixt (9):
  t9400, t9401: Do not force hard-linked clone
  test suite: Use 'say' to say something instead of
    'test_expect_success'
  Call 'say' outside test_expect_success
  test-lib: Replace uses of $(expr ...) by POSIX shell features.
  test-lib: Simplify test counting.
  test-lib: Introduce test_chmod and use it instead of update-index
    --chmod
  t2200, t7004: Avoid glob pattern that also matches files
  t5300, t5302, t5303: Do not use /dev/zero
  t5602: Work around path mangling on MSYS

 t/lib-git-svn.sh                       |    6 +++---
 t/t0024-crlf-archive.sh                |    2 +-
 t/t0050-filesystem.sh                  |    9 +++++++--
 t/t1410-reflog.sh                      |    4 +---
 t/t2200-add-update.sh                  |    2 +-
 t/t3400-rebase.sh                      |    4 ++--
 t/t3600-rm.sh                          |    5 +++--
 t/t4006-diff-mode.sh                   |   19 ++++---------------
 t/t4013-diff-various.sh                |    2 +-
 t/t4014-format-patch.sh                |    4 +---
 t/t5000-tar-tree.sh                    |    2 +-
 t/t5300-pack-object.sh                 |   17 ++++++++---------
 t/t5302-pack-index.sh                  |    2 +-
 t/t5303-pack-corruption-resilience.sh  |   12 +++++++-----
 t/t5515-fetch-merge-logic.sh           |    2 +-
 t/t5602-clone-remote-exec.sh           |    4 ++--
 t/t6031-merge-recursive.sh             |    9 ++-------
 t/t7004-tag.sh                         |    9 +++++----
 t/t7005-editor.sh                      |   29 +++++++++++++----------------
 t/t7300-clean.sh                       |    6 +++---
 t/t9200-git-cvsexportcommit.sh         |    2 +-
 t/t9400-git-cvsserver-server.sh        |    8 ++++----
 t/t9401-git-cvsserver-crlf.sh          |    6 +++---
 t/t9500-gitweb-standalone-no-errors.sh |   20 ++++++--------------
 t/t9700-perl-git.sh                    |    2 +-
 t/test-lib.sh                          |   28 ++++++++++++++++------------
 26 files changed, 98 insertions(+), 117 deletions(-)

^ permalink raw reply	[flat|nested] 27+ messages in thread

* [PATCH 01/10] t9400, t9401: Do not force hard-linked clone
  2009-03-18 21:27 [PATCH 00/11] Test on Windows - prequel Johannes Sixt
@ 2009-03-18 21:27 ` Johannes Sixt
  2009-03-18 21:27 ` [PATCH 02/10] test suite: Use 'say' to say something instead of 'test_expect_success' Johannes Sixt
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 27+ messages in thread
From: Johannes Sixt @ 2009-03-18 21:27 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Johannes Sixt

The tests do not depend on that the clones are hard-linked, but used
--local only as an optimization: At the time that --local was used first
in t9400 hard-linked clones were not the default, yet.

By removing --local, we help filesystems that do not support hard-links.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
 t/t9400-git-cvsserver-server.sh |    4 ++--
 t/t9401-git-cvsserver-crlf.sh   |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/t/t9400-git-cvsserver-server.sh b/t/t9400-git-cvsserver-server.sh
index 6a37f71..9ccb123 100755
--- a/t/t9400-git-cvsserver-server.sh
+++ b/t/t9400-git-cvsserver-server.sh
@@ -44,7 +44,7 @@ test_expect_success 'setup' '
   git add secondrootfile &&
   git commit -m "second root") &&
   git pull secondroot master &&
-  git clone -q --local --bare "$WORKDIR/.git" "$SERVERDIR" >/dev/null 2>&1 &&
+  git clone -q --bare "$WORKDIR/.git" "$SERVERDIR" >/dev/null 2>&1 &&
   GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled true &&
   GIT_DIR="$SERVERDIR" git config gitcvs.logfile "$SERVERDIR/gitcvs.log"
 '
@@ -267,7 +267,7 @@ test_expect_success 'gitcvs.ext.dbname' \
 
 rm -fr "$SERVERDIR"
 cd "$WORKDIR" &&
-git clone -q --local --bare "$WORKDIR/.git" "$SERVERDIR" >/dev/null 2>&1 &&
+git clone -q --bare "$WORKDIR/.git" "$SERVERDIR" >/dev/null 2>&1 &&
 GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled true &&
 GIT_DIR="$SERVERDIR" git config gitcvs.logfile "$SERVERDIR/gitcvs.log" ||
 exit 1
diff --git a/t/t9401-git-cvsserver-crlf.sh b/t/t9401-git-cvsserver-crlf.sh
index e27a1c5..5d6200c 100755
--- a/t/t9401-git-cvsserver-crlf.sh
+++ b/t/t9401-git-cvsserver-crlf.sh
@@ -84,7 +84,7 @@ test_expect_success 'setup' '
     echo "subdir/file.h crlf" >> .gitattributes &&
     git add .gitattributes textfile.c binfile.bin mixedUp.c subdir/* &&
     git commit -q -m "First Commit" &&
-    git clone -q --local --bare "$WORKDIR/.git" "$SERVERDIR" >/dev/null 2>&1 &&
+    git clone -q --bare "$WORKDIR/.git" "$SERVERDIR" >/dev/null 2>&1 &&
     GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled true &&
     GIT_DIR="$SERVERDIR" git config gitcvs.logfile "$SERVERDIR/gitcvs.log"
 '
-- 
1.6.2.1.224.g2225f

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH 02/10] test suite: Use 'say' to say something instead of 'test_expect_success'
  2009-03-18 21:27 [PATCH 00/11] Test on Windows - prequel Johannes Sixt
  2009-03-18 21:27 ` [PATCH 01/10] t9400, t9401: Do not force hard-linked clone Johannes Sixt
@ 2009-03-18 21:27 ` Johannes Sixt
  2009-03-18 22:07   ` Johannes Schindelin
  2009-03-18 21:27 ` [PATCH 03/10] Call 'say' outside test_expect_success Johannes Sixt
                   ` (9 subsequent siblings)
  11 siblings, 1 reply; 27+ messages in thread
From: Johannes Sixt @ 2009-03-18 21:27 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Johannes Sixt

Some tests report that some tests will be skipped.  They used
'test_exect_success' with a trivially successful test.  Nowadays we have
the helper function 'say' for this purpose.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
 t/lib-git-svn.sh                       |    6 +++---
 t/t0024-crlf-archive.sh                |    2 +-
 t/t3600-rm.sh                          |    2 +-
 t/t5000-tar-tree.sh                    |    2 +-
 t/t7004-tag.sh                         |    4 ++--
 t/t9200-git-cvsexportcommit.sh         |    2 +-
 t/t9400-git-cvsserver-server.sh        |    4 ++--
 t/t9401-git-cvsserver-crlf.sh          |    4 ++--
 t/t9500-gitweb-standalone-no-errors.sh |    2 +-
 t/t9700-perl-git.sh                    |    2 +-
 10 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/t/lib-git-svn.sh b/t/lib-git-svn.sh
index 67c431d..de384e6 100644
--- a/t/lib-git-svn.sh
+++ b/t/lib-git-svn.sh
@@ -5,7 +5,7 @@ git_svn_id=git""-svn-id
 
 if test -n "$NO_SVN_TESTS"
 then
-	test_expect_success 'skipping git svn tests, NO_SVN_TESTS defined' :
+	say 'skipping git svn tests, NO_SVN_TESTS defined'
 	test_done
 	exit
 fi
@@ -17,7 +17,7 @@ SVN_TREE=$GIT_SVN_DIR/svn-tree
 svn >/dev/null 2>&1
 if test $? -ne 1
 then
-    test_expect_success 'skipping git svn tests, svn not found' :
+    say 'skipping git svn tests, svn not found'
     test_done
     exit
 fi
@@ -41,7 +41,7 @@ then
 	else
 		err='Perl SVN libraries not found or unusable, skipping test'
 	fi
-	test_expect_success "$err" :
+	say "$err"
 	test_done
 	exit
 fi
diff --git a/t/t0024-crlf-archive.sh b/t/t0024-crlf-archive.sh
index e533039..ae90d34 100755
--- a/t/t0024-crlf-archive.sh
+++ b/t/t0024-crlf-archive.sh
@@ -28,7 +28,7 @@ test_expect_success 'tar archive' '
 
 "$UNZIP" -v >/dev/null 2>&1
 if [ $? -eq 127 ]; then
-	echo "Skipping ZIP test, because unzip was not found"
+	say "Skipping ZIP test, because unzip was not found"
 	test_done
 	exit
 fi
diff --git a/t/t3600-rm.sh b/t/t3600-rm.sh
index 95542e9..74ea8e0 100755
--- a/t/t3600-rm.sh
+++ b/t/t3600-rm.sh
@@ -112,7 +112,7 @@ test_expect_success \
     'test_must_fail git rm -f baz'
 chmod 775 .
 else
-    test_expect_success 'skipping removal failure (perhaps running as root?)' :
+    say 'skipping removal failure test (perhaps running as root?)'
 fi
 
 test_expect_success \
diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh
index e1ed073..7a84ab6 100755
--- a/t/t5000-tar-tree.sh
+++ b/t/t5000-tar-tree.sh
@@ -182,7 +182,7 @@ test_expect_success 'git archive --format=zip with --output' \
 
 $UNZIP -v >/dev/null 2>&1
 if [ $? -eq 127 ]; then
-	echo "Skipping ZIP tests, because unzip was not found"
+	say "Skipping ZIP tests, because unzip was not found"
 	test_done
 	exit
 fi
diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh
index 69501e2..06e6e17 100755
--- a/t/t7004-tag.sh
+++ b/t/t7004-tag.sh
@@ -582,7 +582,7 @@ test_expect_success \
 # subsequent tests require gpg; check if it is available
 gpg --version >/dev/null
 if [ $? -eq 127 ]; then
-	echo "gpg not found - skipping tag signing and verification tests"
+	say "gpg not found - skipping tag signing and verification tests"
 	test_done
 	exit
 fi
@@ -614,7 +614,7 @@ test_expect_success \
 # that version, creation of signed tags using the generated key fails.
 case "$(gpg --version)" in
 'gpg (GnuPG) 1.0.6'*)
-	echo "Skipping signed tag tests, because a bug in 1.0.6 version"
+	say "Skipping signed tag tests, because a bug in 1.0.6 version"
 	test_done
 	exit
 	;;
diff --git a/t/t9200-git-cvsexportcommit.sh b/t/t9200-git-cvsexportcommit.sh
index 245a7c3..d28b71b 100755
--- a/t/t9200-git-cvsexportcommit.sh
+++ b/t/t9200-git-cvsexportcommit.sh
@@ -9,7 +9,7 @@ test_description='Test export of commits to CVS'
 cvs >/dev/null 2>&1
 if test $? -ne 1
 then
-    test_expect_success 'skipping git cvsexportcommit tests, cvs not found' :
+    say 'skipping git cvsexportcommit tests, cvs not found'
     test_done
     exit
 fi
diff --git a/t/t9400-git-cvsserver-server.sh b/t/t9400-git-cvsserver-server.sh
index 9ccb123..466240c 100755
--- a/t/t9400-git-cvsserver-server.sh
+++ b/t/t9400-git-cvsserver-server.sh
@@ -13,12 +13,12 @@ cvs CLI client via git-cvsserver server'
 cvs >/dev/null 2>&1
 if test $? -ne 1
 then
-    test_expect_success 'skipping git-cvsserver tests, cvs not found' :
+    say 'skipping git-cvsserver tests, cvs not found'
     test_done
     exit
 fi
 perl -e 'use DBI; use DBD::SQLite' >/dev/null 2>&1 || {
-    test_expect_success 'skipping git-cvsserver tests, Perl SQLite interface unavailable' :
+    say 'skipping git-cvsserver tests, Perl SQLite interface unavailable'
     test_done
     exit
 }
diff --git a/t/t9401-git-cvsserver-crlf.sh b/t/t9401-git-cvsserver-crlf.sh
index 5d6200c..8882230 100755
--- a/t/t9401-git-cvsserver-crlf.sh
+++ b/t/t9401-git-cvsserver-crlf.sh
@@ -49,12 +49,12 @@ not_present() {
 cvs >/dev/null 2>&1
 if test $? -ne 1
 then
-    test_expect_success 'skipping git-cvsserver tests, cvs not found' :
+    say 'skipping git-cvsserver tests, cvs not found'
     test_done
     exit
 fi
 perl -e 'use DBI; use DBD::SQLite' >/dev/null 2>&1 || {
-    test_expect_success 'skipping git-cvsserver tests, Perl SQLite interface unavailable' :
+    say 'skipping git-cvsserver tests, Perl SQLite interface unavailable'
     test_done
     exit
 }
diff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb-standalone-no-errors.sh
index 6ed10d0..1b78e28 100755
--- a/t/t9500-gitweb-standalone-no-errors.sh
+++ b/t/t9500-gitweb-standalone-no-errors.sh
@@ -74,7 +74,7 @@ safe_chmod () {
 . ./test-lib.sh
 
 perl -MEncode -e 'decode_utf8("", Encode::FB_CROAK)' >/dev/null 2>&1 || {
-    test_expect_success 'skipping gitweb tests, perl version is too old' :
+    say 'skipping gitweb tests, perl version is too old'
     test_done
     exit
 }
diff --git a/t/t9700-perl-git.sh b/t/t9700-perl-git.sh
index b81d5df..4a501c6 100755
--- a/t/t9700-perl-git.sh
+++ b/t/t9700-perl-git.sh
@@ -7,7 +7,7 @@ test_description='perl interface (Git.pm)'
 . ./test-lib.sh
 
 perl -MTest::More -e 0 2>/dev/null || {
-	say_color skip "Perl Test::More unavailable, skipping test"
+	say "Perl Test::More unavailable, skipping test"
 	test_done
 }
 
-- 
1.6.2.1.224.g2225f

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH 03/10] Call 'say' outside test_expect_success
  2009-03-18 21:27 [PATCH 00/11] Test on Windows - prequel Johannes Sixt
  2009-03-18 21:27 ` [PATCH 01/10] t9400, t9401: Do not force hard-linked clone Johannes Sixt
  2009-03-18 21:27 ` [PATCH 02/10] test suite: Use 'say' to say something instead of 'test_expect_success' Johannes Sixt
@ 2009-03-18 21:27 ` Johannes Sixt
  2009-03-18 21:27 ` [PATCH 04/10] test-lib: Replace uses of $(expr ...) by POSIX shell features Johannes Sixt
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 27+ messages in thread
From: Johannes Sixt @ 2009-03-18 21:27 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Johannes Sixt

There were some uses of 'say' inside test_expect_success. But if the tests
were not run in verbose mode, this message went to /dev/null. Pull them out
of test_expect_success.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
 t/t0050-filesystem.sh |    9 +++++++--
 t/t3600-rm.sh         |    3 ++-
 t/t7005-editor.sh     |   29 +++++++++++++----------------
 3 files changed, 22 insertions(+), 19 deletions(-)

diff --git a/t/t0050-filesystem.sh b/t/t0050-filesystem.sh
index 7edf49d..a449580 100755
--- a/t/t0050-filesystem.sh
+++ b/t/t0050-filesystem.sh
@@ -8,6 +8,7 @@ auml=`printf '\xc3\xa4'`
 aumlcdiar=`printf '\x61\xcc\x88'`
 
 case_insensitive=
+unibad=
 test_expect_success 'see if we expect ' '
 
 	test_case=test_expect_success
@@ -19,7 +20,6 @@ test_expect_success 'see if we expect ' '
 	then
 		test_case=test_expect_failure
 		case_insensitive=t
-		say "will test on a case insensitive filesystem"
 	fi &&
 	rm -fr junk &&
 	mkdir junk &&
@@ -27,13 +27,18 @@ test_expect_success 'see if we expect ' '
 	case "$(cd junk && echo *)" in
 	"$aumlcdiar")
 		test_unicode=test_expect_failure
-		say "will test on a unicode corrupting filesystem"
+		unibad=t
 		;;
 	*)	;;
 	esac &&
 	rm -fr junk
 '
 
+test "$case_insensitive" &&
+	say "will test on a case insensitive filesystem"
+test "$unibad" &&
+	say "will test on a unicode corrupting filesystem"
+
 if test "$case_insensitive"
 then
 test_expect_success "detection of case insensitive filesystem during repo init" '
diff --git a/t/t3600-rm.sh b/t/t3600-rm.sh
index 74ea8e0..2aefbcf 100755
--- a/t/t3600-rm.sh
+++ b/t/t3600-rm.sh
@@ -21,10 +21,11 @@ embedded'
 embedded' &&
      git commit -m 'add files with tabs and newlines'
      else
-         say 'Your filesystem does not allow tabs in filenames.'
          test_tabs=n
      fi"
 
+test "$test_tabs" = n && say 'Your filesystem does not allow tabs in filenames.'
+
 # Later we will try removing an unremovable path to make sure
 # git rm barfs, but if the test is run as root that cannot be
 # arranged.
diff --git a/t/t7005-editor.sh b/t/t7005-editor.sh
index 2d919d6..2f8404a 100755
--- a/t/t7005-editor.sh
+++ b/t/t7005-editor.sh
@@ -87,30 +87,27 @@ do
 	'
 done
 
+if ! echo 'echo space > "$1"' > "e space.sh"
+then
+	say "Skipping; FS does not support spaces in filenames"
+	test_done
+	exit
+fi
+
 test_expect_success 'editor with a space' '
 
-	if echo "echo space > \"\$1\"" > "e space.sh"
-	then
-		chmod a+x "e space.sh" &&
-		GIT_EDITOR="./e\ space.sh" git commit --amend &&
-		test space = "$(git show -s --pretty=format:%s)"
-	else
-		say "Skipping; FS does not support spaces in filenames"
-	fi
+	chmod a+x "e space.sh" &&
+	GIT_EDITOR="./e\ space.sh" git commit --amend &&
+	test space = "$(git show -s --pretty=format:%s)"
 
 '
 
 unset GIT_EDITOR
 test_expect_success 'core.editor with a space' '
 
-	if test -f "e space.sh"
-	then
-		git config core.editor \"./e\ space.sh\" &&
-		git commit --amend &&
-		test space = "$(git show -s --pretty=format:%s)"
-	else
-		say "Skipping; FS does not support spaces in filenames"
-	fi
+	git config core.editor \"./e\ space.sh\" &&
+	git commit --amend &&
+	test space = "$(git show -s --pretty=format:%s)"
 
 '
 
-- 
1.6.2.1.224.g2225f

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH 04/10] test-lib: Replace uses of $(expr ...) by POSIX shell features.
  2009-03-18 21:27 [PATCH 00/11] Test on Windows - prequel Johannes Sixt
                   ` (2 preceding siblings ...)
  2009-03-18 21:27 ` [PATCH 03/10] Call 'say' outside test_expect_success Johannes Sixt
@ 2009-03-18 21:27 ` Johannes Sixt
  2009-03-18 22:28   ` Johannes Schindelin
  2009-03-18 21:27 ` [PATCH 05/10] test-lib: Simplify test counting Johannes Sixt
                   ` (7 subsequent siblings)
  11 siblings, 1 reply; 27+ messages in thread
From: Johannes Sixt @ 2009-03-18 21:27 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Johannes Sixt

In particular:

- Test case counting can be achieved by arithmetic expansion.

- The name of the test, e.g. t1234, can be computed with ${0%%} and ${0##}.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
 t/t4013-diff-various.sh      |    2 +-
 t/t5515-fetch-merge-logic.sh |    2 +-
 t/test-lib.sh                |   23 +++++++++++------------
 3 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh
index 9cd5a6e..9c30b29 100755
--- a/t/t4013-diff-various.sh
+++ b/t/t4013-diff-various.sh
@@ -101,7 +101,7 @@ do
 	'' | '#'*) continue ;;
 	esac
 	test=`echo "$cmd" | sed -e 's|[/ ][/ ]*|_|g'`
-	cnt=`expr $test_count + 1`
+	cnt=$(($test_count+1))
 	pfx=`printf "%04d" $cnt`
 	expect="$TEST_DIRECTORY/t4013/diff.$test"
 	actual="$pfx-diff.$test"
diff --git a/t/t5515-fetch-merge-logic.sh b/t/t5515-fetch-merge-logic.sh
index 1f4608d..0b39503 100755
--- a/t/t5515-fetch-merge-logic.sh
+++ b/t/t5515-fetch-merge-logic.sh
@@ -129,7 +129,7 @@ do
 	'' | '#'*) continue ;;
 	esac
 	test=`echo "$cmd" | sed -e 's|[/ ][/ ]*|_|g'`
-	cnt=`expr $test_count + 1`
+	cnt=$(($test_count+1))
 	pfx=`printf "%04d" $cnt`
 	expect_f="$TEST_DIRECTORY/t5515/fetch.$test"
 	actual_f="$pfx-fetch.$test"
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 1e01a91..bd8cba1 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -242,14 +242,14 @@ test_merge () {
 # the text_expect_* functions instead.
 
 test_ok_ () {
-	test_count=$(expr "$test_count" + 1)
-	test_success=$(expr "$test_success" + 1)
+	test_count=$(($test_count + 1))
+	test_success=$(($test_success + 1))
 	say_color "" "  ok $test_count: $@"
 }
 
 test_failure_ () {
-	test_count=$(expr "$test_count" + 1)
-	test_failure=$(expr "$test_failure" + 1);
+	test_count=$(($test_count + 1))
+	test_failure=$(($test_failure + 1))
 	say_color error "FAIL $test_count: $1"
 	shift
 	echo "$@" | sed -e 's/^/	/'
@@ -257,13 +257,13 @@ test_failure_ () {
 }
 
 test_known_broken_ok_ () {
-	test_count=$(expr "$test_count" + 1)
+	test_count=$(($test_count+1))
 	test_fixed=$(($test_fixed+1))
 	say_color "" "  FIXED $test_count: $@"
 }
 
 test_known_broken_failure_ () {
-	test_count=$(expr "$test_count" + 1)
+	test_count=$(($test_count+1))
 	test_broken=$(($test_broken+1))
 	say_color skip "  still broken $test_count: $@"
 }
@@ -279,12 +279,10 @@ test_run_ () {
 }
 
 test_skip () {
-	this_test=$(expr "./$0" : '.*/\(t[0-9]*\)-[^/]*$')
-	this_test="$this_test.$(expr "$test_count" + 1)"
 	to_skip=
 	for skp in $GIT_SKIP_TESTS
 	do
-		case "$this_test" in
+		case $this_test.$(($test_count+1)) in
 		$skp)
 			to_skip=t
 		esac
@@ -292,7 +290,7 @@ test_skip () {
 	case "$to_skip" in
 	t)
 		say_color skip >&3 "skipping test: $@"
-		test_count=$(expr "$test_count" + 1)
+		test_count=$(($test_count+1))
 		say_color skip "skip $test_count: $1"
 		: true
 		;;
@@ -370,7 +368,7 @@ test_external () {
 	then
 		# Announce the script to reduce confusion about the
 		# test output that follows.
-		say_color "" " run $(expr "$test_count" + 1): $descr ($*)"
+		say_color "" " run $(($test_count+1)): $descr ($*)"
 		# Run command; redirect its stderr to &4 as in
 		# test_run_, but keep its stdout on our stdout even in
 		# non-verbose mode.
@@ -613,7 +611,8 @@ test_create_repo "$test"
 # in subprocesses like git equals our $PWD (for pathname comparisons).
 cd -P "$test" || exit 1
 
-this_test=$(expr "./$0" : '.*/\(t[0-9]*\)-[^/]*$')
+this_test=${0##*/}
+this_test=${this_test%%-*}
 for skp in $GIT_SKIP_TESTS
 do
 	to_skip=
-- 
1.6.2.1.224.g2225f

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH 05/10] test-lib: Simplify test counting.
  2009-03-18 21:27 [PATCH 00/11] Test on Windows - prequel Johannes Sixt
                   ` (3 preceding siblings ...)
  2009-03-18 21:27 ` [PATCH 04/10] test-lib: Replace uses of $(expr ...) by POSIX shell features Johannes Sixt
@ 2009-03-18 21:27 ` Johannes Sixt
  2009-03-18 22:32   ` Johannes Schindelin
  2009-03-18 21:27 ` [PATCH 06/10] test-lib: Introduce test_chmod and use it instead of update-index --chmod Johannes Sixt
                   ` (6 subsequent siblings)
  11 siblings, 1 reply; 27+ messages in thread
From: Johannes Sixt @ 2009-03-18 21:27 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Johannes Sixt

Since the test case counter was incremented very late, there were a few
users of the counter had to do their own incrementing. Now we increment it
early and simplify these users.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
 t/test-lib.sh |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/t/test-lib.sh b/t/test-lib.sh
index bd8cba1..ace440c 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -242,13 +242,11 @@ test_merge () {
 # the text_expect_* functions instead.
 
 test_ok_ () {
-	test_count=$(($test_count + 1))
 	test_success=$(($test_success + 1))
 	say_color "" "  ok $test_count: $@"
 }
 
 test_failure_ () {
-	test_count=$(($test_count + 1))
 	test_failure=$(($test_failure + 1))
 	say_color error "FAIL $test_count: $1"
 	shift
@@ -257,13 +255,11 @@ test_failure_ () {
 }
 
 test_known_broken_ok_ () {
-	test_count=$(($test_count+1))
 	test_fixed=$(($test_fixed+1))
 	say_color "" "  FIXED $test_count: $@"
 }
 
 test_known_broken_failure_ () {
-	test_count=$(($test_count+1))
 	test_broken=$(($test_broken+1))
 	say_color skip "  still broken $test_count: $@"
 }
@@ -279,10 +275,11 @@ test_run_ () {
 }
 
 test_skip () {
+	test_count=$(($test_count+1))
 	to_skip=
 	for skp in $GIT_SKIP_TESTS
 	do
-		case $this_test.$(($test_count+1)) in
+		case $this_test.$test_count in
 		$skp)
 			to_skip=t
 		esac
@@ -290,7 +287,6 @@ test_skip () {
 	case "$to_skip" in
 	t)
 		say_color skip >&3 "skipping test: $@"
-		test_count=$(($test_count+1))
 		say_color skip "skip $test_count: $1"
 		: true
 		;;
@@ -368,7 +364,7 @@ test_external () {
 	then
 		# Announce the script to reduce confusion about the
 		# test output that follows.
-		say_color "" " run $(($test_count+1)): $descr ($*)"
+		say_color "" " run $test_count: $descr ($*)"
 		# Run command; redirect its stderr to &4 as in
 		# test_run_, but keep its stdout on our stdout even in
 		# non-verbose mode.
-- 
1.6.2.1.224.g2225f

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH 06/10] test-lib: Introduce test_chmod and use it instead of update-index --chmod
  2009-03-18 21:27 [PATCH 00/11] Test on Windows - prequel Johannes Sixt
                   ` (4 preceding siblings ...)
  2009-03-18 21:27 ` [PATCH 05/10] test-lib: Simplify test counting Johannes Sixt
@ 2009-03-18 21:27 ` Johannes Sixt
  2009-03-18 21:27 ` [PATCH 07/10] t7300: fix clean up on Windows Johannes Sixt
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 27+ messages in thread
From: Johannes Sixt @ 2009-03-18 21:27 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Johannes Sixt

This function replaces sequences of 'chmod +x' and 'git update-index
--chmod=+x' in the test suite, whose purpose is to help filesystems
that need core.filemode=false. Two places where only 'chmod +x' was used
we also use this new function.

The function calls 'git update-index --chmod' without checking
core.filemode (unlike some of the call sites did). We do this because the
call sites *expect* that the executable bit ends up in the index (ie. it
is not the purpose of the call sites to *test* whether git treats
'chmod +x' and 'update-index --chmod=+x' correctly). Therefore, on
filesystems with core.filemode=true the 'git update-index --chmod' is a
no-op.

The function uses --add with update-index to help one call site in
t6031-merge-recursive. It makes no difference for the other callers.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
 t/t1410-reflog.sh                      |    4 +---
 t/t3400-rebase.sh                      |    4 ++--
 t/t4006-diff-mode.sh                   |   19 ++++---------------
 t/t4014-format-patch.sh                |    4 +---
 t/t6031-merge-recursive.sh             |    9 ++-------
 t/t9500-gitweb-standalone-no-errors.sh |   18 +++++-------------
 t/test-lib.sh                          |    9 +++++++++
 7 files changed, 24 insertions(+), 43 deletions(-)

diff --git a/t/t1410-reflog.sh b/t/t1410-reflog.sh
index 5b24f05..80af6b9 100755
--- a/t/t1410-reflog.sh
+++ b/t/t1410-reflog.sh
@@ -70,9 +70,7 @@ test_expect_success setup '
 	E=`git rev-parse --verify HEAD:A/B/E` &&
 	check_fsck &&
 
-	chmod +x C &&
-	( test "`git config --bool core.filemode`" != false ||
-	  echo executable >>C ) &&
+	test_chmod +x C &&
 	git add C &&
 	test_tick && git commit -m dragon &&
 	L=`git rev-parse --verify HEAD` &&
diff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh
index be7ae5a..6e391a3 100755
--- a/t/t3400-rebase.sh
+++ b/t/t3400-rebase.sh
@@ -83,9 +83,9 @@ test_expect_success 'rebase a single mode change' '
      git checkout -b modechange HEAD^ &&
      echo 1 > X &&
      git add X &&
-     chmod a+x A &&
+     test_chmod +x A &&
      test_tick &&
-     git commit -m modechange A X &&
+     git commit -m modechange &&
      GIT_TRACE=1 git rebase master
 '
 
diff --git a/t/t4006-diff-mode.sh b/t/t4006-diff-mode.sh
index 4e92fce..8c1b81e 100755
--- a/t/t4006-diff-mode.sh
+++ b/t/t4006-diff-mode.sh
@@ -15,21 +15,10 @@ test_expect_success \
      tree=`git write-tree` &&
      echo $tree'
 
-if [ "$(git config --get core.filemode)" = false ]
-then
-	say 'filemode disabled on the filesystem, using update-index --chmod=+x'
-	test_expect_success \
-	    'git update-index --chmod=+x' \
-	    'git update-index rezrov &&
-	     git update-index --chmod=+x rezrov &&
-	     git diff-index $tree >current'
-else
-	test_expect_success \
-	    'chmod' \
-	    'chmod +x rezrov &&
-	     git update-index rezrov &&
-	     git diff-index $tree >current'
-fi
+test_expect_success \
+    'chmod' \
+    'test_chmod +x rezrov &&
+     git diff-index $tree >current'
 
 _x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
 _x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40"
diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh
index ebfc4a6..f187d15 100755
--- a/t/t4014-format-patch.sh
+++ b/t/t4014-format-patch.sh
@@ -16,9 +16,7 @@ test_expect_success setup '
 	git checkout -b side &&
 
 	for i in 1 2 5 6 A B C 7 8 9 10; do echo "$i"; done >file &&
-	chmod +x elif &&
-	git update-index file elif &&
-	git update-index --chmod=+x elif &&
+	test_chmod +x elif &&
 	git commit -m "Side changes #1" &&
 
 	for i in D E F; do echo "$i"; done >>file &&
diff --git a/t/t6031-merge-recursive.sh b/t/t6031-merge-recursive.sh
index 8073e0c..41c6860 100755
--- a/t/t6031-merge-recursive.sh
+++ b/t/t6031-merge-recursive.sh
@@ -3,9 +3,6 @@
 test_description='merge-recursive: handle file mode'
 . ./test-lib.sh
 
-# Note that we follow "chmod +x F" with "update-index --chmod=+x F" to
-# help filesystems that do not have the executable bit.
-
 test_expect_success 'mode change in one branch: keep changed version' '
 	: >file1 &&
 	git add file1 &&
@@ -15,8 +12,7 @@ test_expect_success 'mode change in one branch: keep changed version' '
 	git add dummy &&
 	git commit -m a &&
 	git checkout -b b1 master &&
-	chmod +x file1 &&
-	git update-index --chmod=+x file1 &&
+	test_chmod +x file1 &&
 	git commit -m b1 &&
 	git checkout a1 &&
 	git merge-recursive master -- a1 b1 &&
@@ -28,8 +24,7 @@ test_expect_success 'mode change in both branches: expect conflict' '
 	git checkout -b a2 master &&
 	: >file2 &&
 	H=$(git hash-object file2) &&
-	chmod +x file2 &&
-	git update-index --add --chmod=+x file2 &&
+	test_chmod +x file2 &&
 	git commit -m a2 &&
 	git checkout -b b2 master &&
 	: >file2 &&
diff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb-standalone-no-errors.sh
index 1b78e28..dce06bc 100755
--- a/t/t9500-gitweb-standalone-no-errors.sh
+++ b/t/t9500-gitweb-standalone-no-errors.sh
@@ -63,14 +63,6 @@ gitweb_run () {
 	# gitweb.log is left for debugging
 }
 
-safe_chmod () {
-	chmod "$1" "$2" &&
-	if [ "$(git config --get core.filemode)" = false ]
-	then
-		git update-index --chmod="$1" "$2"
-	fi
-}
-
 . ./test-lib.sh
 
 perl -MEncode -e 'decode_utf8("", Encode::FB_CROAK)' >/dev/null 2>&1 || {
@@ -242,7 +234,7 @@ test_debug 'cat gitweb.log'
 
 test_expect_success \
 	'commitdiff(0): mode change' \
-	'safe_chmod +x new_file &&
+	'test_chmod +x new_file &&
 	 git commit -a -m "Mode changed." &&
 	 gitweb_run "p=.git;a=commitdiff"'
 test_debug 'cat gitweb.log'
@@ -281,7 +273,7 @@ test_debug 'cat gitweb.log'
 test_expect_success \
 	'commitdiff(0): mode change and modified' \
 	'echo "New line" >> file2 &&
-	 safe_chmod +x file2 &&
+	 test_chmod +x file2 &&
 	 git commit -a -m "Mode change and modification." &&
 	 gitweb_run "p=.git;a=commitdiff"'
 test_debug 'cat gitweb.log'
@@ -308,7 +300,7 @@ test_expect_success \
 	'commitdiff(0): renamed, mode change and modified' \
 	'git mv file3 file2 &&
 	 echo "Propter nomen suum." >> file2 &&
-	 safe_chmod +x file2 &&
+	 test_chmod +x file2 &&
 	 git commit -a -m "File rename, mode change and modification." &&
 	 gitweb_run "p=.git;a=commitdiff"'
 test_debug 'cat gitweb.log'
@@ -425,10 +417,10 @@ test_expect_success \
 	 git add 03-new &&
 	 git mv 04-rename-from 04-rename-to &&
 	 echo "Changed" >> 04-rename-to &&
-	 safe_chmod +x 05-mode-change &&
+	 test_chmod +x 05-mode-change &&
 	 rm -f 06-file-or-symlink && ln -s 01-change 06-file-or-symlink &&
 	 echo "Changed and have mode changed" > 07-change-mode-change	&&
-	 safe_chmod +x 07-change-mode-change &&
+	 test_chmod +x 07-change-mode-change &&
 	 git commit -a -m "Large commit" &&
 	 git checkout master'
 
diff --git a/t/test-lib.sh b/t/test-lib.sh
index ace440c..638cca4 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -238,6 +238,15 @@ test_merge () {
 	git tag "$1"
 }
 
+# This function helps systems where core.filemode=false is set.
+# Use it instead of plain 'chmod +x' to set or unset the executable bit
+# of a file in the working directory and add it to the index.
+
+test_chmod () {
+	chmod "$@" &&
+	git update-index --add "--chmod=$@"
+}
+
 # You are not expected to call test_ok_ and test_failure_ directly, use
 # the text_expect_* functions instead.
 
-- 
1.6.2.1.224.g2225f

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH 07/10] t7300: fix clean up on Windows
  2009-03-18 21:27 [PATCH 00/11] Test on Windows - prequel Johannes Sixt
                   ` (5 preceding siblings ...)
  2009-03-18 21:27 ` [PATCH 06/10] test-lib: Introduce test_chmod and use it instead of update-index --chmod Johannes Sixt
@ 2009-03-18 21:27 ` Johannes Sixt
  2009-03-18 21:27 ` [PATCH 08/10] t2200, t7004: Avoid glob pattern that also matches files Johannes Sixt
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 27+ messages in thread
From: Johannes Sixt @ 2009-03-18 21:27 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Johannes Schindelin, Johannes Sixt

From: Johannes Schindelin <johannes.schindelin@gmx.de>

On Windows, you cannot remove files that are in use, not even with
'rm -rf'.  So we need to run 'exec <foo/bar' inside a subshell lest
removing the whole test repository fail.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
 t/t7300-clean.sh |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/t/t7300-clean.sh b/t/t7300-clean.sh
index 1636fac..929d5d4 100755
--- a/t/t7300-clean.sh
+++ b/t/t7300-clean.sh
@@ -373,9 +373,9 @@ test_expect_success 'removal failure' '
 
 	mkdir foo &&
 	touch foo/bar &&
-	exec <foo/bar &&
-	chmod 0 foo &&
-	test_must_fail git clean -f -d
+	(exec <foo/bar &&
+	 chmod 0 foo &&
+	 test_must_fail git clean -f -d)
 
 '
 chmod 755 foo
-- 
1.6.2.1.224.g2225f

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH 08/10] t2200, t7004: Avoid glob pattern that also matches files
  2009-03-18 21:27 [PATCH 00/11] Test on Windows - prequel Johannes Sixt
                   ` (6 preceding siblings ...)
  2009-03-18 21:27 ` [PATCH 07/10] t7300: fix clean up on Windows Johannes Sixt
@ 2009-03-18 21:27 ` Johannes Sixt
  2009-03-19  0:47   ` Junio C Hamano
  2009-03-18 21:27 ` [PATCH 09/10] t5300, t5302, t5303: Do not use /dev/zero Johannes Sixt
                   ` (3 subsequent siblings)
  11 siblings, 1 reply; 27+ messages in thread
From: Johannes Sixt @ 2009-03-18 21:27 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Johannes Sixt

On Windows, there is an unfortunate interaction between the MSYS bash and
git's command line processing:

- Since Windows's CMD does not do the wildcard expansion, but passes
  arguments like path* through to the programs, the programs must do the
  expansion themselves. This happens in the startup code before main() is
  entered.

- bash, however, passes the argument "path*" to git, assuming that git will
  see the unquoted word unchanged as a single argument.

But actually git expands the unquoted word before main() is entered.

In t2200, not all names that the test case is interested in exist as files
at the time when 'git ls-files' is invoked. git expands "path?" to only
the subset of files the exist, and only that subset was listed, so that the
test failed.  We now list all interesting paths explicitly.

In t7004, git exanded the pattern "*a*" to "actual" (the file that stdout
was redirected to), which is not what the was tested for. We fix it by
renaming the output file (and removing any existing files matching *a*).
This was originally fixed by Johannes Schindelin.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
 t/t2200-add-update.sh |    2 +-
 t/t7004-tag.sh        |    5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/t/t2200-add-update.sh b/t/t2200-add-update.sh
index b2ddf5a..652801e 100755
--- a/t/t2200-add-update.sh
+++ b/t/t2200-add-update.sh
@@ -150,7 +150,7 @@ test_expect_success 'add -u resolves unmerged paths' '
 	echo 2 >path3 &&
 	echo 2 >path5 &&
 	git add -u &&
-	git ls-files -s "path?" >actual &&
+	git ls-files -s path1 path3 path4 path5 path6 >actual &&
 	{
 		echo "100644 $three 0	path1"
 		echo "100644 $one 1	path3"
diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh
index 06e6e17..1c27ffb 100755
--- a/t/t7004-tag.sh
+++ b/t/t7004-tag.sh
@@ -185,8 +185,9 @@ cba
 EOF
 test_expect_success \
 	'listing tags with substring as pattern must print those matching' '
-	git tag -l "*a*" > actual &&
-	test_cmp expect actual
+	rm *a* &&
+	git tag -l "*a*" > current &&
+	test_cmp expect current
 '
 
 cat >expect <<EOF
-- 
1.6.2.1.224.g2225f

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH 09/10] t5300, t5302, t5303: Do not use /dev/zero
  2009-03-18 21:27 [PATCH 00/11] Test on Windows - prequel Johannes Sixt
                   ` (7 preceding siblings ...)
  2009-03-18 21:27 ` [PATCH 08/10] t2200, t7004: Avoid glob pattern that also matches files Johannes Sixt
@ 2009-03-18 21:27 ` Johannes Sixt
  2009-03-18 21:27 ` [PATCH 10/10] t5602: Work around path mangling on MSYS Johannes Sixt
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 27+ messages in thread
From: Johannes Sixt @ 2009-03-18 21:27 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Johannes Sixt

We do not have /dev/zero on Windows. This replaces it by data generated
with printf, perl, or echo. Most of the cases do not depend on that the
data is a stream of zero bytes, so we use something printable; nor is an
unlimited stream of data needed, so we produce only as many bytes as the
test cases need.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
 t/t5300-pack-object.sh                |   17 ++++++++---------
 t/t5302-pack-index.sh                 |    2 +-
 t/t5303-pack-corruption-resilience.sh |   12 +++++++-----
 3 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh
index ccfc64c..e2aa254 100755
--- a/t/t5300-pack-object.sh
+++ b/t/t5300-pack-object.sh
@@ -13,11 +13,10 @@ TRASH=`pwd`
 test_expect_success \
     'setup' \
     'rm -f .git/index*
-     for i in a b c
-     do
-	     dd if=/dev/zero bs=4k count=1 | perl -pe "y/\\000/$i/" >$i &&
-	     git update-index --add $i || return 1
-     done &&
+     perl -e "print \"a\" x 4096;" > a &&
+     perl -e "print \"b\" x 4096;" > b &&
+     perl -e "print \"c\" x 4096;" > c &&
+     git update-index --add a b c &&
      cat c >d && echo foo >>d && git update-index --add d &&
      tree=`git write-tree` &&
      commit=`git commit-tree $tree </dev/null` && {
@@ -221,7 +220,7 @@ test_expect_success \
 test_expect_success \
     'verify-pack catches a corrupted pack signature' \
     'cat test-1-${packname_1}.pack >test-3.pack &&
-     dd if=/dev/zero of=test-3.pack count=1 bs=1 conv=notrunc seek=2 &&
+     echo | dd of=test-3.pack count=1 bs=1 conv=notrunc seek=2 &&
      if git verify-pack test-3.idx
      then false
      else :;
@@ -230,7 +229,7 @@ test_expect_success \
 test_expect_success \
     'verify-pack catches a corrupted pack version' \
     'cat test-1-${packname_1}.pack >test-3.pack &&
-     dd if=/dev/zero of=test-3.pack count=1 bs=1 conv=notrunc seek=7 &&
+     echo | dd of=test-3.pack count=1 bs=1 conv=notrunc seek=7 &&
      if git verify-pack test-3.idx
      then false
      else :;
@@ -239,7 +238,7 @@ test_expect_success \
 test_expect_success \
     'verify-pack catches a corrupted type/size of the 1st packed object data' \
     'cat test-1-${packname_1}.pack >test-3.pack &&
-     dd if=/dev/zero of=test-3.pack count=1 bs=1 conv=notrunc seek=12 &&
+     echo | dd of=test-3.pack count=1 bs=1 conv=notrunc seek=12 &&
      if git verify-pack test-3.idx
      then false
      else :;
@@ -250,7 +249,7 @@ test_expect_success \
     'l=`wc -c <test-3.idx` &&
      l=`expr $l - 20` &&
      cat test-1-${packname_1}.pack >test-3.pack &&
-     dd if=/dev/zero of=test-3.idx count=20 bs=1 conv=notrunc seek=$l &&
+     printf "%20s" "" | dd of=test-3.idx count=20 bs=1 conv=notrunc seek=$l &&
      if git verify-pack test-3.pack
      then false
      else :;
diff --git a/t/t5302-pack-index.sh b/t/t5302-pack-index.sh
index e6f70d4..77982cd 100755
--- a/t/t5302-pack-index.sh
+++ b/t/t5302-pack-index.sh
@@ -208,7 +208,7 @@ test_expect_success \
      obj=`git hash-object file_001` &&
      nr=`index_obj_nr ".git/objects/pack/pack-${pack1}.idx" $obj` &&
      chmod +w ".git/objects/pack/pack-${pack1}.idx" &&
-     dd if=/dev/zero of=".git/objects/pack/pack-${pack1}.idx" conv=notrunc \
+     printf xxxx | dd of=".git/objects/pack/pack-${pack1}.idx" conv=notrunc \
         bs=1 count=4 seek=$((8 + 256 * 4 + `wc -l <obj-list` * 20 + $nr * 4)) &&
      ( while read obj
        do git cat-file -p $obj >/dev/null || exit 1
diff --git a/t/t5303-pack-corruption-resilience.sh b/t/t5303-pack-corruption-resilience.sh
index d4e30fc..5132d41 100755
--- a/t/t5303-pack-corruption-resilience.sh
+++ b/t/t5303-pack-corruption-resilience.sh
@@ -55,6 +55,8 @@ do_corrupt_object() {
     test_must_fail git verify-pack ${pack}.pack
 }
 
+printf '\0' > zero
+
 test_expect_success \
     'initial setup validation' \
     'create_test_files &&
@@ -66,7 +68,7 @@ test_expect_success \
 
 test_expect_success \
     'create corruption in header of first object' \
-    'do_corrupt_object $blob_1 0 < /dev/zero &&
+    'do_corrupt_object $blob_1 0 < zero &&
      test_must_fail git cat-file blob $blob_1 > /dev/null &&
      test_must_fail git cat-file blob $blob_2 > /dev/null &&
      test_must_fail git cat-file blob $blob_3 > /dev/null'
@@ -125,7 +127,7 @@ test_expect_success \
     'create corruption in header of first delta' \
     'create_new_pack &&
      git prune-packed &&
-     do_corrupt_object $blob_2 0 < /dev/zero &&
+     do_corrupt_object $blob_2 0 < zero &&
      git cat-file blob $blob_1 > /dev/null &&
      test_must_fail git cat-file blob $blob_2 > /dev/null &&
      test_must_fail git cat-file blob $blob_3 > /dev/null'
@@ -180,7 +182,7 @@ test_expect_success \
     'corruption in delta base reference of first delta (OBJ_REF_DELTA)' \
     'create_new_pack &&
      git prune-packed &&
-     do_corrupt_object $blob_2 2 < /dev/zero &&
+     do_corrupt_object $blob_2 2 < zero &&
      git cat-file blob $blob_1 > /dev/null &&
      test_must_fail git cat-file blob $blob_2 > /dev/null &&
      test_must_fail git cat-file blob $blob_3 > /dev/null'
@@ -207,7 +209,7 @@ test_expect_success \
     'corruption #0 in delta base reference of first delta (OBJ_OFS_DELTA)' \
     'create_new_pack --delta-base-offset &&
      git prune-packed &&
-     do_corrupt_object $blob_2 2 < /dev/zero &&
+     do_corrupt_object $blob_2 2 < zero &&
      git cat-file blob $blob_1 > /dev/null &&
      test_must_fail git cat-file blob $blob_2 > /dev/null &&
      test_must_fail git cat-file blob $blob_3 > /dev/null'
@@ -259,7 +261,7 @@ test_expect_success \
 
 test_expect_success \
     '... and a redundant pack allows for full recovery too' \
-    'do_corrupt_object $blob_2 2 < /dev/zero &&
+    'do_corrupt_object $blob_2 2 < zero &&
      git cat-file blob $blob_1 > /dev/null &&
      test_must_fail git cat-file blob $blob_2 > /dev/null &&
      test_must_fail git cat-file blob $blob_3 > /dev/null &&
-- 
1.6.2.1.224.g2225f

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH 10/10] t5602: Work around path mangling on MSYS
  2009-03-18 21:27 [PATCH 00/11] Test on Windows - prequel Johannes Sixt
                   ` (8 preceding siblings ...)
  2009-03-18 21:27 ` [PATCH 09/10] t5300, t5302, t5303: Do not use /dev/zero Johannes Sixt
@ 2009-03-18 21:27 ` Johannes Sixt
  2009-03-18 22:47 ` [PATCH 00/11] Test on Windows - prequel Junio C Hamano
  2009-03-19 20:58 ` Johannes Sixt
  11 siblings, 0 replies; 27+ messages in thread
From: Johannes Sixt @ 2009-03-18 21:27 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Johannes Sixt

MSYS's bash rewrites /something/bin/... into a Windows path that looks like
c:/msysgit/something/bin/... before git sees it. But later the test case
verifies that the path was used and compares it to the unmangled version.
This fails, of course. This make the path relative so that the path
mangling is not triggered.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
 t/t5602-clone-remote-exec.sh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/t5602-clone-remote-exec.sh b/t/t5602-clone-remote-exec.sh
index 82b1d1e..deffdae 100755
--- a/t/t5602-clone-remote-exec.sh
+++ b/t/t5602-clone-remote-exec.sh
@@ -18,8 +18,8 @@ test_expect_success 'clone calls git upload-pack unqualified with no -u option'
 '
 
 test_expect_success 'clone calls specified git upload-pack with -u option' '
-	GIT_SSH=./not_ssh git clone -u /something/bin/git-upload-pack localhost:/path/to/repo junk
-	echo "localhost /something/bin/git-upload-pack '\''/path/to/repo'\''" >expected
+	GIT_SSH=./not_ssh git clone -u ./something/bin/git-upload-pack localhost:/path/to/repo junk
+	echo "localhost ./something/bin/git-upload-pack '\''/path/to/repo'\''" >expected
 	test_cmp expected not_ssh_output
 '
 
-- 
1.6.2.1.224.g2225f

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* Re: [PATCH 02/10] test suite: Use 'say' to say something instead of 'test_expect_success'
  2009-03-18 21:27 ` [PATCH 02/10] test suite: Use 'say' to say something instead of 'test_expect_success' Johannes Sixt
@ 2009-03-18 22:07   ` Johannes Schindelin
  2009-03-19  7:48     ` Johannes Sixt
  0 siblings, 1 reply; 27+ messages in thread
From: Johannes Schindelin @ 2009-03-18 22:07 UTC (permalink / raw)
  To: Johannes Sixt; +Cc: Junio C Hamano, git

Hi,

On Wed, 18 Mar 2009, Johannes Sixt wrote:

> Some tests report that some tests will be skipped.  They used
> 'test_exect_success' with a trivially successful test.  Nowadays we have

s/exect/expect/.

> the helper function 'say' for this purpose.
> 
> Signed-off-by: Johannes Sixt <j6t@kdbg.org>

I see that you exchanged one "say_color" by "say".  What is the 
difference?

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 04/10] test-lib: Replace uses of $(expr ...) by POSIX shell features.
  2009-03-18 21:27 ` [PATCH 04/10] test-lib: Replace uses of $(expr ...) by POSIX shell features Johannes Sixt
@ 2009-03-18 22:28   ` Johannes Schindelin
  2009-03-19  7:38     ` Johannes Sixt
  0 siblings, 1 reply; 27+ messages in thread
From: Johannes Schindelin @ 2009-03-18 22:28 UTC (permalink / raw)
  To: Johannes Sixt; +Cc: Junio C Hamano, git

Hi,

On Wed, 18 Mar 2009, Johannes Sixt wrote:

> In particular:
> 
> - Test case counting can be achieved by arithmetic expansion.
> 
> - The name of the test, e.g. t1234, can be computed with ${0%%} and ${0##}.
> 
> Signed-off-by: Johannes Sixt <j6t@kdbg.org>

I guess this makes the tests less slow on Windows?  Do you have numbers?

FWIW I run the tests on Windows with -j10 these days, and they take about 
15 minutes on a quad core 3GHz machine (which I may use from time to time; 
the machine is not mine, otherwise it would run Linux).

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 05/10] test-lib: Simplify test counting.
  2009-03-18 21:27 ` [PATCH 05/10] test-lib: Simplify test counting Johannes Sixt
@ 2009-03-18 22:32   ` Johannes Schindelin
  2009-03-19  7:44     ` Johannes Sixt
  0 siblings, 1 reply; 27+ messages in thread
From: Johannes Schindelin @ 2009-03-18 22:32 UTC (permalink / raw)
  To: Johannes Sixt; +Cc: Junio C Hamano, git

Hi,

On Wed, 18 Mar 2009, Johannes Sixt wrote:

> Since the test case counter was incremented very late, there were a few
> users of the counter had to do their own incrementing. Now we increment it
> early and simplify these users.
> 
> Signed-off-by: Johannes Sixt <j6t@kdbg.org>
> ---
>  t/test-lib.sh |   10 +++-------
>  1 files changed, 3 insertions(+), 7 deletions(-)

Do you not need to adjust t4013 and t5515, too?

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 00/11] Test on Windows - prequel
  2009-03-18 21:27 [PATCH 00/11] Test on Windows - prequel Johannes Sixt
                   ` (9 preceding siblings ...)
  2009-03-18 21:27 ` [PATCH 10/10] t5602: Work around path mangling on MSYS Johannes Sixt
@ 2009-03-18 22:47 ` Junio C Hamano
  2009-03-19  7:28   ` Johannes Sixt
  2009-03-19 20:58 ` Johannes Sixt
  11 siblings, 1 reply; 27+ messages in thread
From: Junio C Hamano @ 2009-03-18 22:47 UTC (permalink / raw)
  To: Johannes Sixt; +Cc: git

Johannes Sixt <j6t@kdbg.org> writes:

>   t7300: fix clean up on Windows
>
> Johannes Sixt (9):
>   t9400, t9401: Do not force hard-linked clone
>   test suite: Use 'say' to say something instead of
>     'test_expect_success'
>   Call 'say' outside test_expect_success
>   test-lib: Replace uses of $(expr ...) by POSIX shell features.
>   test-lib: Simplify test counting.
>   test-lib: Introduce test_chmod and use it instead of update-index
>     --chmod
>   t2200, t7004: Avoid glob pattern that also matches files
>   t5300, t5302, t5303: Do not use /dev/zero
>   t5602: Work around path mangling on MSYS

Do you have an 11-patch series, or 10-patch series with a cover letter?  I
am wondering what happened to [PATCH 11/11].

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 08/10] t2200, t7004: Avoid glob pattern that also matches files
  2009-03-18 21:27 ` [PATCH 08/10] t2200, t7004: Avoid glob pattern that also matches files Johannes Sixt
@ 2009-03-19  0:47   ` Junio C Hamano
  2009-03-19 19:52     ` Johannes Sixt
  0 siblings, 1 reply; 27+ messages in thread
From: Junio C Hamano @ 2009-03-19  0:47 UTC (permalink / raw)
  To: Johannes Sixt; +Cc: git

Johannes Sixt <j6t@kdbg.org> writes:

> On Windows, there is an unfortunate interaction between the MSYS bash and
> git's command line processing:
>
> - Since Windows's CMD does not do the wildcard expansion, but passes
>   arguments like path* through to the programs, the programs must do the
>   expansion themselves. This happens in the startup code before main() is
>   entered.
>
> - bash, however, passes the argument "path*" to git, assuming that git will
>   see the unquoted word unchanged as a single argument.
>
> But actually git expands the unquoted word before main() is entered.

Doesn't this mean on Windows, the glob pathspec git supports is not useful
at all?

I am wondering if we want to treat any feature that involves globs as
unusable like any feature that involves pathnames with a TAB in it.

> In t2200, not all names that the test case is interested in exist as files
> at the time when 'git ls-files' is invoked. git expands "path?" to only
> the subset of files the exist, and only that subset was listed, so that the
> test failed.  We now list all interesting paths explicitly.

But that conversion misses the whole point of that particular test,
doesn't it?  It wants to see path2 that was unmerged and existed only in
the index but not in the work tree has disappeared, while the similarly
unmerged path1 resolved after "add -u".  IOW, you are not testing that
"add -u" notices a removal of path2 from the work tree anymore.

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 00/11] Test on Windows - prequel
  2009-03-18 22:47 ` [PATCH 00/11] Test on Windows - prequel Junio C Hamano
@ 2009-03-19  7:28   ` Johannes Sixt
  0 siblings, 0 replies; 27+ messages in thread
From: Johannes Sixt @ 2009-03-19  7:28 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Junio C Hamano schrieb:
> Do you have an 11-patch series, or 10-patch series with a cover letter?  I
> am wondering what happened to [PATCH 11/11].

It's a 10-patch series, I still haven't learnt to count, and this
format-patch and send-email business causes me head-aches again and again
and again... ;)

I first prepared an 11-patch series, wrote the coverletter, then changed
my mind and prepared a 10-patch series, copied the coverletter including
the Subject: line without updating it.

-- Hannes

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 04/10] test-lib: Replace uses of $(expr ...) by POSIX shell features.
  2009-03-18 22:28   ` Johannes Schindelin
@ 2009-03-19  7:38     ` Johannes Sixt
  2009-03-19 10:27       ` Johannes Schindelin
  0 siblings, 1 reply; 27+ messages in thread
From: Johannes Sixt @ 2009-03-19  7:38 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Junio C Hamano, git

Johannes Schindelin schrieb:
> Hi,
> 
> On Wed, 18 Mar 2009, Johannes Sixt wrote:
> 
>> In particular:
>>
>> - Test case counting can be achieved by arithmetic expansion.
>>
>> - The name of the test, e.g. t1234, can be computed with ${0%%} and ${0##}.
>>
>> Signed-off-by: Johannes Sixt <j6t@kdbg.org>
> 
> I guess this makes the tests less slow on Windows?  Do you have numbers?

Actually, while reading through test-lib.sh I found those expr expressions
quite difficult to understand, and my primary intent was to make the code
more readable. Furthermore, as you can see in the hunk that touches
test_known_broken_{ok,failure}_ that the $(( )) construct is already in
use, so it's also a change to improve consistency.

The shorter runtime (primarily on Windows) is just a nice side effect,
although the gain probably vanishes in the noise.

> FWIW I run the tests on Windows with -j10 these days, and they take about 
> 15 minutes on a quad core 3GHz machine (which I may use from time to time; 
> the machine is not mine, otherwise it would run Linux).

Last time I tried -j<something> it bailed out early. I didn't try again
since then. Sequential tests finish in 30-40 minutes here, but I don't run
SVN tests.

-- Hannes

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 05/10] test-lib: Simplify test counting.
  2009-03-18 22:32   ` Johannes Schindelin
@ 2009-03-19  7:44     ` Johannes Sixt
  0 siblings, 0 replies; 27+ messages in thread
From: Johannes Sixt @ 2009-03-19  7:44 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Junio C Hamano, git

Johannes Schindelin schrieb:
> Hi,
> 
> On Wed, 18 Mar 2009, Johannes Sixt wrote:
> 
>> Since the test case counter was incremented very late, there were a few
>> users of the counter had to do their own incrementing. Now we increment it
>> early and simplify these users.
>>
>> Signed-off-by: Johannes Sixt <j6t@kdbg.org>
>> ---
>>  t/test-lib.sh |   10 +++-------
>>  1 files changed, 3 insertions(+), 7 deletions(-)
> 
> Do you not need to adjust t4013 and t5515, too?

Yes, indeed. That makes sense.

-- Hannes

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 02/10] test suite: Use 'say' to say something instead of   'test_expect_success'
  2009-03-18 22:07   ` Johannes Schindelin
@ 2009-03-19  7:48     ` Johannes Sixt
  2009-03-19 10:29       ` Johannes Schindelin
  0 siblings, 1 reply; 27+ messages in thread
From: Johannes Sixt @ 2009-03-19  7:48 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Junio C Hamano, git

Johannes Schindelin schrieb:
> Hi,
> 
> On Wed, 18 Mar 2009, Johannes Sixt wrote:
> 
>> Some tests report that some tests will be skipped.  They used
>> 'test_exect_success' with a trivially successful test.  Nowadays we have
> 
> s/exect/expect/.
> 
>> the helper function 'say' for this purpose.
>>
>> Signed-off-by: Johannes Sixt <j6t@kdbg.org>
> 
> I see that you exchanged one "say_color" by "say".  What is the 
> difference?

The color. It's a change towards consistency. I figured that the command
to use by the tests is "say", while "say_color" is an implementation
detail of test-lib.sh.

-- Hannes

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 04/10] test-lib: Replace uses of $(expr ...) by POSIX   shell features.
  2009-03-19  7:38     ` Johannes Sixt
@ 2009-03-19 10:27       ` Johannes Schindelin
  0 siblings, 0 replies; 27+ messages in thread
From: Johannes Schindelin @ 2009-03-19 10:27 UTC (permalink / raw)
  To: Johannes Sixt; +Cc: Junio C Hamano, git

Hi,

On Thu, 19 Mar 2009, Johannes Sixt wrote:

> Johannes Schindelin schrieb:
> 
> > On Wed, 18 Mar 2009, Johannes Sixt wrote:
> > 
> >> In particular:
> >>
> >> - Test case counting can be achieved by arithmetic expansion.
> >>
> >> - The name of the test, e.g. t1234, can be computed with ${0%%} and 
> >>   ${0##}.
> >>
> >> Signed-off-by: Johannes Sixt <j6t@kdbg.org>
> > 
> > I guess this makes the tests less slow on Windows?  Do you have 
> > numbers?
> 
> Actually, while reading through test-lib.sh I found those expr 
> expressions quite difficult to understand, and my primary intent was to 
> make the code more readable. Furthermore, as you can see in the hunk 
> that touches test_known_broken_{ok,failure}_ that the $(( )) construct 
> is already in use, so it's also a change to improve consistency.
> 
> The shorter runtime (primarily on Windows) is just a nice side effect, 
> although the gain probably vanishes in the noise.

Actually, I should not have written that mail that late at night: 'expr' 
is a bash builtin.

> > FWIW I run the tests on Windows with -j10 these days, and they take 
> > about 15 minutes on a quad core 3GHz machine (which I may use from 
> > time to time; the machine is not mine, otherwise it would run Linux).
> 
> Last time I tried -j<something> it bailed out early. I didn't try again 
> since then. Sequential tests finish in 30-40 minutes here, but I don't 
> run SVN tests.

In msysGit, I updated the /share/msysGit/run-tests.sh script to make use 
of -j5.  If you work on a newer branch than 'devel', you most probably 
need the changes from 'release-preview', as my 
test-results/<basename>-<pid> patch broke the original assumption of 
run-tests.sh.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 02/10] test suite: Use 'say' to say something instead of 'test_expect_success'
  2009-03-19  7:48     ` Johannes Sixt
@ 2009-03-19 10:29       ` Johannes Schindelin
  2009-03-19 11:16         ` Junio C Hamano
  0 siblings, 1 reply; 27+ messages in thread
From: Johannes Schindelin @ 2009-03-19 10:29 UTC (permalink / raw)
  To: Johannes Sixt; +Cc: Junio C Hamano, git

Hi,

On Thu, 19 Mar 2009, Johannes Sixt wrote:

> Johannes Schindelin schrieb:
> 
> > I see that you exchanged one "say_color" by "say".  What is the 
> > difference?
> 
> The color. It's a change towards consistency. I figured that the command 
> to use by the tests is "say", while "say_color" is an implementation 
> detail of test-lib.sh.

Fair enough.  Could you say that in the commit message, too, so that 
morons like me do not have to ask? ;-)

Thanks,
Dscho

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 02/10] test suite: Use 'say' to say something instead of 'test_expect_success'
  2009-03-19 10:29       ` Johannes Schindelin
@ 2009-03-19 11:16         ` Junio C Hamano
  0 siblings, 0 replies; 27+ messages in thread
From: Junio C Hamano @ 2009-03-19 11:16 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Johannes Sixt, git

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> Hi,
>
> On Thu, 19 Mar 2009, Johannes Sixt wrote:
>
>> Johannes Schindelin schrieb:
>> 
>> > I see that you exchanged one "say_color" by "say".  What is the 
>> > difference?
>> 
>> The color. It's a change towards consistency. I figured that the command 
>> to use by the tests is "say", while "say_color" is an implementation 
>> detail of test-lib.sh.
>
> Fair enough.  Could you say that in the commit message, too,...

Have done so already.

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 08/10] t2200, t7004: Avoid glob pattern that also matches files
  2009-03-19  0:47   ` Junio C Hamano
@ 2009-03-19 19:52     ` Johannes Sixt
  2009-03-19 20:34       ` Junio C Hamano
  0 siblings, 1 reply; 27+ messages in thread
From: Johannes Sixt @ 2009-03-19 19:52 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

On Donnerstag, 19. März 2009, Junio C Hamano wrote:
> Johannes Sixt <j6t@kdbg.org> writes:
> > On Windows, there is an unfortunate interaction between the MSYS bash and
> > git's command line processing:
> >
> > - Since Windows's CMD does not do the wildcard expansion, but passes
> >   arguments like path* through to the programs, the programs must do the
> >   expansion themselves. This happens in the startup code before main() is
> >   entered.
> >
> > - bash, however, passes the argument "path*" to git, assuming that git
> > will see the unquoted word unchanged as a single argument.
> >
> > But actually git expands the unquoted word before main() is entered.
>
> Doesn't this mean on Windows, the glob pathspec git supports is not useful
> at all?

No, it is still useful. There is a difference if I say

   git add "*a*"

from bash or from Windows's CMD. The latter passes the argument to git with 
the dquotes; the startup code removes them and does not expand the wildcard. 
But if bash invokes the command, bash removes the quotes, so that the startup 
code only sees *a* and does the expansion.

> > In t2200, not all names that the test case is interested in exist as
> > files at the time when 'git ls-files' is invoked. git expands "path?" to
> > only the subset of files the exist, and only that subset was listed, so
> > that the test failed.  We now list all interesting paths explicitly.
>
> But that conversion misses the whole point of that particular test,
> doesn't it?  It wants to see path2 that was unmerged and existed only in
> the index but not in the work tree has disappeared, while the similarly
> unmerged path1 resolved after "add -u".  IOW, you are not testing that
> "add -u" notices a removal of path2 from the work tree anymore.

I see. Then I'll just add path2 to the list, OK? It still passes the test.

-- Hannes

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 08/10] t2200, t7004: Avoid glob pattern that also matches files
  2009-03-19 19:52     ` Johannes Sixt
@ 2009-03-19 20:34       ` Junio C Hamano
  0 siblings, 0 replies; 27+ messages in thread
From: Junio C Hamano @ 2009-03-19 20:34 UTC (permalink / raw)
  To: Johannes Sixt; +Cc: git

Johannes Sixt <j6t@kdbg.org> writes:

> No, it is still useful. There is a difference if I say
>
>    git add "*a*"
>
> from bash or from Windows's CMD. The latter passes the argument to git with 
> the dquotes; the startup code removes them and does not expand the wildcard. 
> But if bash invokes the command, bash removes the quotes, so that the startup 
> code only sees *a* and does the expansion.

I can only say "yuck" :-<.

>> > In t2200, not all names that the test case is interested in exist as
>> > files at the time when 'git ls-files' is invoked. git expands "path?" to
>> > only the subset of files the exist, and only that subset was listed, so
>> > that the test failed.  We now list all interesting paths explicitly.
>>
>> But that conversion misses the whole point of that particular test,
>> doesn't it?  It wants to see path2 that was unmerged and existed only in
>> the index but not in the work tree has disappeared, while the similarly
>> unmerged path1 resolved after "add -u".  IOW, you are not testing that
>> "add -u" notices a removal of path2 from the work tree anymore.
>
> I see. Then I'll just add path2 to the list, OK? It still passes the test.

Yeah, as we are not passing --error-unmatch to the command, it should be
the right thing to do.

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 00/11] Test on Windows - prequel
  2009-03-18 21:27 [PATCH 00/11] Test on Windows - prequel Johannes Sixt
                   ` (10 preceding siblings ...)
  2009-03-18 22:47 ` [PATCH 00/11] Test on Windows - prequel Junio C Hamano
@ 2009-03-19 20:58 ` Johannes Sixt
  2009-03-19 23:00   ` Junio C Hamano
  11 siblings, 1 reply; 27+ messages in thread
From: Johannes Sixt @ 2009-03-19 20:58 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

On Mittwoch, 18. März 2009, Johannes Sixt wrote:
> I'm preparing a series of patches that adjust the test suite so that it
> passes on Windows (MinGW port). This is the initial part of it. Another
> dozen or more are to follow. By splitting the series I hope to get
> earlier feedback.
>
> The series is also available from
>
>  git://repo.or.cz/git/mingw/j6t.git for-junio
>
>  http://repo.or.cz/w/git/mingw/j6t.git?a=shortlog;h=refs/heads/for-junio

I've updated the series. Would you please pick up it up from the URL
above?

The changes in particular are:

- [PATCH 02/10] test suite: Use 'say' to say something instead of...

  Updated commit message.

- [PATCH 04/10] test-lib: Replace uses of $(expr ...) by POSIX...

  No changes to t4013 and t5515 anymore; the next patch removes the
  lines that this patch touched.

- [PATCH 05/10] test-lib: Simplify test counting.

  Do not use $test_count+1 in t4013 and t5515.

- [PATCH 08/10] t2200, t7004: Avoid glob pattern that also...

  Added path2 to the list.

Below is the interdiff.

-- Hannes  

diff --git a/t/t2200-add-update.sh b/t/t2200-add-update.sh
index 652801e..5a8d52f 100755
--- a/t/t2200-add-update.sh
+++ b/t/t2200-add-update.sh
@@ -150,7 +150,7 @@ test_expect_success 'add -u resolves unmerged paths' '
 	echo 2 >path3 &&
 	echo 2 >path5 &&
 	git add -u &&
-	git ls-files -s path1 path3 path4 path5 path6 >actual &&
+	git ls-files -s path1 path2 path3 path4 path5 path6 >actual &&
 	{
 		echo "100644 $three 0	path1"
 		echo "100644 $one 1	path3"
diff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh
index 9c30b29..426e64e 100755
--- a/t/t4013-diff-various.sh
+++ b/t/t4013-diff-various.sh
@@ -101,8 +101,7 @@ do
 	'' | '#'*) continue ;;
 	esac
 	test=`echo "$cmd" | sed -e 's|[/ ][/ ]*|_|g'`
-	cnt=$(($test_count+1))
-	pfx=`printf "%04d" $cnt`
+	pfx=`printf "%04d" $test_count`
 	expect="$TEST_DIRECTORY/t4013/diff.$test"
 	actual="$pfx-diff.$test"
 
diff --git a/t/t5515-fetch-merge-logic.sh b/t/t5515-fetch-merge-logic.sh
index 0b39503..dbb927d 100755
--- a/t/t5515-fetch-merge-logic.sh
+++ b/t/t5515-fetch-merge-logic.sh
@@ -129,8 +129,7 @@ do
 	'' | '#'*) continue ;;
 	esac
 	test=`echo "$cmd" | sed -e 's|[/ ][/ ]*|_|g'`
-	cnt=$(($test_count+1))
-	pfx=`printf "%04d" $cnt`
+	pfx=`printf "%04d" $test_count`
 	expect_f="$TEST_DIRECTORY/t5515/fetch.$test"
 	actual_f="$pfx-fetch.$test"
 	expect_r="$TEST_DIRECTORY/t5515/refs.$test"

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* Re: [PATCH 00/11] Test on Windows - prequel
  2009-03-19 20:58 ` Johannes Sixt
@ 2009-03-19 23:00   ` Junio C Hamano
  0 siblings, 0 replies; 27+ messages in thread
From: Junio C Hamano @ 2009-03-19 23:00 UTC (permalink / raw)
  To: Johannes Sixt; +Cc: git

Johannes Sixt <j6t@kdbg.org> writes:

> On Mittwoch, 18. März 2009, Johannes Sixt wrote:
>> I'm preparing a series of patches that adjust the test suite so that it
>> passes on Windows (MinGW port). This is the initial part of it. Another
>> dozen or more are to follow. By splitting the series I hope to get
>> earlier feedback.
>>
>> The series is also available from
>>
>>  git://repo.or.cz/git/mingw/j6t.git for-junio
>>
> I've updated the series. Would you please pick up it up from the URL
> above?

I think you have a typo in the "Use 'say'" one ("In on case").  Here is a
diff from what I queued previously but didn't have a chance to merge to 'pu':

     test suite: Use 'say' to say something instead of 'test_expect_success'

-    Some test scripts report that some tests will be skipped.  They used
+    Some tests report that some tests will be skipped.  They used
     'test_expect_success' with a trivially successful test.  Nowadays we have
     the helper function 'say' for this purpose.

-    t9700-perl-git.sh was using 'say_color' for this kind of reporting; change
-    it to a vanilla 'say' for consistency.
+    In on case, 'say_color skip' is replaced by 'say' because the former is
+    not intended as a public API.

     Signed-off-by: Johannes Sixt <j6t@kdbg.org>
-    Signed-off-by: Junio C Hamano <gitster@pobox.com>

Other than that, the interdiff matches what I expected to see.

Thanks.

^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2009-03-19 23:01 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-18 21:27 [PATCH 00/11] Test on Windows - prequel Johannes Sixt
2009-03-18 21:27 ` [PATCH 01/10] t9400, t9401: Do not force hard-linked clone Johannes Sixt
2009-03-18 21:27 ` [PATCH 02/10] test suite: Use 'say' to say something instead of 'test_expect_success' Johannes Sixt
2009-03-18 22:07   ` Johannes Schindelin
2009-03-19  7:48     ` Johannes Sixt
2009-03-19 10:29       ` Johannes Schindelin
2009-03-19 11:16         ` Junio C Hamano
2009-03-18 21:27 ` [PATCH 03/10] Call 'say' outside test_expect_success Johannes Sixt
2009-03-18 21:27 ` [PATCH 04/10] test-lib: Replace uses of $(expr ...) by POSIX shell features Johannes Sixt
2009-03-18 22:28   ` Johannes Schindelin
2009-03-19  7:38     ` Johannes Sixt
2009-03-19 10:27       ` Johannes Schindelin
2009-03-18 21:27 ` [PATCH 05/10] test-lib: Simplify test counting Johannes Sixt
2009-03-18 22:32   ` Johannes Schindelin
2009-03-19  7:44     ` Johannes Sixt
2009-03-18 21:27 ` [PATCH 06/10] test-lib: Introduce test_chmod and use it instead of update-index --chmod Johannes Sixt
2009-03-18 21:27 ` [PATCH 07/10] t7300: fix clean up on Windows Johannes Sixt
2009-03-18 21:27 ` [PATCH 08/10] t2200, t7004: Avoid glob pattern that also matches files Johannes Sixt
2009-03-19  0:47   ` Junio C Hamano
2009-03-19 19:52     ` Johannes Sixt
2009-03-19 20:34       ` Junio C Hamano
2009-03-18 21:27 ` [PATCH 09/10] t5300, t5302, t5303: Do not use /dev/zero Johannes Sixt
2009-03-18 21:27 ` [PATCH 10/10] t5602: Work around path mangling on MSYS Johannes Sixt
2009-03-18 22:47 ` [PATCH 00/11] Test on Windows - prequel Junio C Hamano
2009-03-19  7:28   ` Johannes Sixt
2009-03-19 20:58 ` Johannes Sixt
2009-03-19 23:00   ` Junio C Hamano

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.