git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] t3910: give reason for skipping the test
@ 2012-07-14 17:52 Michael J Gruber
  2012-07-14 18:19 ` Torsten Bögershausen
  0 siblings, 1 reply; 19+ messages in thread
From: Michael J Gruber @ 2012-07-14 17:52 UTC (permalink / raw)
  To: git

t3910 is skipped for most users because it requires a filesystem which
does automatic conversion between different utf-8 types. Currently, this
results in a skipped test with "no reason given".

Use the skip_all mechanism from our test suite so that a reason for
skipping the test is given to the user.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
---
Alternatively, we could set a prerequisite and mark all tests with that.  Since
it's either or for the whole test skip_all seems more appropriate.  In that
case, we can also flatten the else branch, of course. The current patch is
minimally invasive, though.

 t/t3910-mac-os-precompose.sh | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/t/t3910-mac-os-precompose.sh b/t/t3910-mac-os-precompose.sh
index 88b7a20..fb7c7ff 100755
--- a/t/t3910-mac-os-precompose.sh
+++ b/t/t3910-mac-os-precompose.sh
@@ -22,8 +22,11 @@ esac
 rm -rf junk
 
 
-if test "$test_nfd"
+if ! test "$test_nfd"
 then
+	skip_all="filesystem does not convert utf-8 nfd to nfc"
+	test_done
+else
 	# create more utf-8 variables
 	Odiarnfc=`printf '\303\226'`
 	Odiarnfd=`printf 'O\314\210'`
@@ -157,8 +160,6 @@ then
 		precomposeunicode=`git config core.precomposeunicode` &&
 		test "$precomposeunicode" = "true"
 	'
-else
-	 say "Skipping nfc/nfd tests"
 fi
 
 test_done
-- 
1.7.11.2.381.gb6e9843

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

* Re: [PATCH] t3910: give reason for skipping the test
  2012-07-14 17:52 [PATCH] t3910: give reason for skipping the test Michael J Gruber
@ 2012-07-14 18:19 ` Torsten Bögershausen
  2012-07-26 13:39   ` [PATCH 0/5] test-lib: filesystem prerequisites Michael J Gruber
  0 siblings, 1 reply; 19+ messages in thread
From: Torsten Bögershausen @ 2012-07-14 18:19 UTC (permalink / raw)
  To: Michael J Gruber; +Cc: git, Torsten Bögershausen

On 14.07.12 19:52, Michael J Gruber wrote:
> t3910 is skipped for most users because it requires a filesystem which
> does automatic conversion between different utf-8 types. Currently, this
> results in a skipped test with "no reason given".
> 
> Use the skip_all mechanism from our test suite so that a reason for
> skipping the test is given to the user.
> 
> Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
> ---
> Alternatively, we could set a prerequisite and mark all tests with that.  Since
> it's either or for the whole test skip_all seems more appropriate.  In that
> case, we can also flatten the else branch, of course. The current patch is
> minimally invasive, though.

Good point, thanks.

If we spin that idea further,
we could move the whole t3910 into t0050.

That would be nice for all non Mac OS X users in a way that we save CPU time. 
We already detect unicode corruption in t0050. 

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

* [PATCH 0/5] test-lib: filesystem prerequisites
  2012-07-14 18:19 ` Torsten Bögershausen
@ 2012-07-26 13:39   ` Michael J Gruber
  2012-07-26 13:39     ` [PATCH 1/5] test-lib: provide case insensitivity as a prerequisite Michael J Gruber
                       ` (5 more replies)
  0 siblings, 6 replies; 19+ messages in thread
From: Michael J Gruber @ 2012-07-26 13:39 UTC (permalink / raw)
  To: git; +Cc: tboegi

This mini series provides and makes use of test prerequisites for
case insensitivity, symlinks and unicode conversion.

SYMLINKS existed before but was not used in t0050.
CASE_INSENSITIVE_FS was defined in t0003 rather than test-lib (and redone in
t0050).
UTF8_NFD_TO_NFC did not exist but was redone in two ways in two tests.

After this series, all 3 are defined in test-lib and used in the various tests.

Michael J Gruber (5):
  test-lib: provide case insensitivity as a prerequisite
  t0050: use the CASE_INSENSITIVE_FS test prereq
  t0050: use the SYMLINKS test prereq
  test-lib: provide UTF8 behaviour as a prerequisite
  t3910: use the SYMLINKS test prereq

 t/README                     |   9 ++
 t/t0003-attributes.sh        |  10 --
 t/t0050-filesystem.sh        |  64 ++++------
 t/t3910-mac-os-precompose.sh | 281 +++++++++++++++++++++----------------------
 t/test-lib.sh                |  24 ++++
 5 files changed, 189 insertions(+), 199 deletions(-)

Really (-w), it is this besides the tab removals:

 t/README                     |  9 +++++++++
 t/t0003-attributes.sh        | 10 ----------
 t/t0050-filesystem.sh        | 62 ++++++++++++++++++++------------------------------------------
 t/t3910-mac-os-precompose.sh | 25 +++++++------------------
 t/test-lib.sh                | 24 ++++++++++++++++++++++++
 5 files changed, 60 insertions(+), 70 deletions(-)

-- 
1.7.12.rc0.198.gd66b616

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

* [PATCH 1/5] test-lib: provide case insensitivity as a prerequisite
  2012-07-26 13:39   ` [PATCH 0/5] test-lib: filesystem prerequisites Michael J Gruber
@ 2012-07-26 13:39     ` Michael J Gruber
  2012-07-26 13:39     ` [PATCH 2/5] t0050: use the CASE_INSENSITIVE_FS test prereq Michael J Gruber
                       ` (4 subsequent siblings)
  5 siblings, 0 replies; 19+ messages in thread
From: Michael J Gruber @ 2012-07-26 13:39 UTC (permalink / raw)
  To: git; +Cc: tboegi

Case insensitivity plays a role in several tests and is tested in several
tests. Therefore, move the test from t003 into the test lib and use the
prerequisite in t0003.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
---
 t/README              |  4 ++++
 t/t0003-attributes.sh | 10 ----------
 t/test-lib.sh         | 10 ++++++++++
 3 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/t/README b/t/README
index 4c3ea25..5725607 100644
--- a/t/README
+++ b/t/README
@@ -625,6 +625,10 @@ use these, and "test_set_prereq" for how to define your own.
    Git was compiled with USE_LIBPCRE=YesPlease. Wrap any tests
    that use git-grep --perl-regexp or git-grep -P in these.
 
+ - CASE_INSENSITIVE_FS
+
+   Test is run on a case insensitive file system.
+
 Tips for Writing Tests
 ----------------------
 
diff --git a/t/t0003-attributes.sh b/t/t0003-attributes.sh
index 51f3045..febc45c 100755
--- a/t/t0003-attributes.sh
+++ b/t/t0003-attributes.sh
@@ -123,16 +123,6 @@ test_expect_success 'attribute matching is case insensitive when core.ignorecase
 
 '
 
-test_expect_success 'check whether FS is case-insensitive' '
-	mkdir junk &&
-	echo good >junk/CamelCase &&
-	echo bad >junk/camelcase &&
-	if test "$(cat junk/CamelCase)" != good
-	then
-		test_set_prereq CASE_INSENSITIVE_FS
-	fi
-'
-
 test_expect_success CASE_INSENSITIVE_FS 'additional case insensitivity tests' '
 	test_must_fail attr_check a/B/D/g "a/b/d/*" "-c core.ignorecase=0" &&
 	test_must_fail attr_check A/B/D/NO "a/b/d/*" "-c core.ignorecase=0" &&
diff --git a/t/test-lib.sh b/t/test-lib.sh
index bb4f886..57fc1f2 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -666,3 +666,13 @@ rm -f y
 # When the tests are run as root, permission tests will report that
 # things are writable when they shouldn't be.
 test -w / || test_set_prereq SANITY
+
+# check whether FS is case-insensitive
+mkdir junk &&
+echo good >junk/CamelCase && 
+echo bad >junk/camelcase &&
+if test "$(cat junk/CamelCase)" != good
+then
+	test_set_prereq CASE_INSENSITIVE_FS
+fi
+rm -rf junk
-- 
1.7.12.rc0.198.gd66b616

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

* [PATCH 2/5] t0050: use the CASE_INSENSITIVE_FS test prereq
  2012-07-26 13:39   ` [PATCH 0/5] test-lib: filesystem prerequisites Michael J Gruber
  2012-07-26 13:39     ` [PATCH 1/5] test-lib: provide case insensitivity as a prerequisite Michael J Gruber
@ 2012-07-26 13:39     ` Michael J Gruber
  2012-07-26 13:39     ` [PATCH 3/5] t0050: use the SYMLINKS " Michael J Gruber
                       ` (3 subsequent siblings)
  5 siblings, 0 replies; 19+ messages in thread
From: Michael J Gruber @ 2012-07-26 13:39 UTC (permalink / raw)
  To: git; +Cc: tboegi


Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
---
 t/t0050-filesystem.sh | 21 ++++++++-------------
 1 file changed, 8 insertions(+), 13 deletions(-)

diff --git a/t/t0050-filesystem.sh b/t/t0050-filesystem.sh
index 1542cf6..df9498b 100755
--- a/t/t0050-filesystem.sh
+++ b/t/t0050-filesystem.sh
@@ -7,23 +7,12 @@ test_description='Various filesystem issues'
 auml=$(printf '\303\244')
 aumlcdiar=$(printf '\141\314\210')
 
-case_insensitive=
 unibad=
 no_symlinks=
 test_expect_success 'see what we expect' '
 
-	test_case=test_expect_success &&
 	test_unicode=test_expect_success &&
 	mkdir junk &&
-	echo good >junk/CamelCase &&
-	echo bad >junk/camelcase &&
-	if test "$(cat junk/CamelCase)" != good
-	then
-		test_case=test_expect_failure &&
-		case_insensitive=t
-	fi &&
-	rm -fr junk &&
-	mkdir junk &&
 	>junk/"$auml" &&
 	case "$(cd junk && echo *)" in
 	"$aumlcdiar")
@@ -41,14 +30,20 @@ test_expect_success 'see what we expect' '
 	}
 '
 
-test "$case_insensitive" &&
+if test_have_prereq CASE_INSENSITIVE_FS
+then
 	say "will test on a case insensitive filesystem"
+	test_case=test_expect_failure
+else
+	test_case=test_expect_success
+fi
+
 test "$unibad" &&
 	say "will test on a unicode corrupting filesystem"
 test "$no_symlinks" &&
 	say "will test on a filesystem lacking symbolic links"
 
-if test "$case_insensitive"
+if test_have_prereq CASE_INSENSITIVE_FS
 then
 test_expect_success "detection of case insensitive filesystem during repo init" '
 
-- 
1.7.12.rc0.198.gd66b616

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

* [PATCH 3/5] t0050: use the SYMLINKS test prereq
  2012-07-26 13:39   ` [PATCH 0/5] test-lib: filesystem prerequisites Michael J Gruber
  2012-07-26 13:39     ` [PATCH 1/5] test-lib: provide case insensitivity as a prerequisite Michael J Gruber
  2012-07-26 13:39     ` [PATCH 2/5] t0050: use the CASE_INSENSITIVE_FS test prereq Michael J Gruber
@ 2012-07-26 13:39     ` Michael J Gruber
  2012-07-26 13:39     ` [PATCH 4/5] test-lib: provide UTF8 behaviour as a prerequisite Michael J Gruber
                       ` (2 subsequent siblings)
  5 siblings, 0 replies; 19+ messages in thread
From: Michael J Gruber @ 2012-07-26 13:39 UTC (permalink / raw)
  To: git; +Cc: tboegi


Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
---
 t/t0050-filesystem.sh | 21 +++++++--------------
 1 file changed, 7 insertions(+), 14 deletions(-)

diff --git a/t/t0050-filesystem.sh b/t/t0050-filesystem.sh
index df9498b..b46ae72 100755
--- a/t/t0050-filesystem.sh
+++ b/t/t0050-filesystem.sh
@@ -8,7 +8,6 @@ auml=$(printf '\303\244')
 aumlcdiar=$(printf '\141\314\210')
 
 unibad=
-no_symlinks=
 test_expect_success 'see what we expect' '
 
 	test_unicode=test_expect_success &&
@@ -21,13 +20,7 @@ test_expect_success 'see what we expect' '
 		;;
 	*)	;;
 	esac &&
-	rm -fr junk &&
-	{
-		ln -s x y 2> /dev/null &&
-		test -h y 2> /dev/null ||
-		no_symlinks=1 &&
-		rm -f y
-	}
+	rm -fr junk
 '
 
 if test_have_prereq CASE_INSENSITIVE_FS
@@ -40,7 +33,7 @@ fi
 
 test "$unibad" &&
 	say "will test on a unicode corrupting filesystem"
-test "$no_symlinks" &&
+test_have_prereq SYMLINKS ||
 	say "will test on a filesystem lacking symbolic links"
 
 if test_have_prereq CASE_INSENSITIVE_FS
@@ -57,18 +50,18 @@ test_expect_success "detection of case insensitive filesystem during repo init"
 '
 fi
 
-if test "$no_symlinks"
+if test_have_prereq SYMLINKS
 then
 test_expect_success "detection of filesystem w/o symlink support during repo init" '
 
-	v=$(git config --bool core.symlinks) &&
-	test "$v" = false
+	test_must_fail git config --bool core.symlinks ||
+	test "$(git config --bool core.symlinks)" = true
 '
 else
 test_expect_success "detection of filesystem w/o symlink support during repo init" '
 
-	test_must_fail git config --bool core.symlinks ||
-	test "$(git config --bool core.symlinks)" = true
+	v=$(git config --bool core.symlinks) &&
+	test "$v" = false
 '
 fi
 
-- 
1.7.12.rc0.198.gd66b616

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

* [PATCH 4/5] test-lib: provide UTF8 behaviour as a prerequisite
  2012-07-26 13:39   ` [PATCH 0/5] test-lib: filesystem prerequisites Michael J Gruber
                       ` (2 preceding siblings ...)
  2012-07-26 13:39     ` [PATCH 3/5] t0050: use the SYMLINKS " Michael J Gruber
@ 2012-07-26 13:39     ` Michael J Gruber
  2012-07-26 13:39     ` [PATCH 5/5] t3910: use the SYMLINKS test prereq Michael J Gruber
  2012-07-26 18:16     ` [PATCH 0/5] test-lib: filesystem prerequisites Junio C Hamano
  5 siblings, 0 replies; 19+ messages in thread
From: Michael J Gruber @ 2012-07-26 13:39 UTC (permalink / raw)
  To: git; +Cc: tboegi

UTF8 behaviour of the filesystem (conversion from nfd to nfc)  plays a
role in several tests and is tested in several tests. Therefore, move
the test from t0050 into the test lib and use the prerequisite in t0050.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
---
 t/README              |  5 +++++
 t/t0050-filesystem.sh | 24 +++++++-----------------
 t/test-lib.sh         | 14 ++++++++++++++
 3 files changed, 26 insertions(+), 17 deletions(-)

diff --git a/t/README b/t/README
index 5725607..e4128e5 100644
--- a/t/README
+++ b/t/README
@@ -629,6 +629,11 @@ use these, and "test_set_prereq" for how to define your own.
 
    Test is run on a case insensitive file system.
 
+ - UTF8_NFD_TO_NFC
+
+   Test is run on a filesystem which converts decomposed utf-8 (nfd)
+   to precomposed utf-8 (nfc).
+
 Tips for Writing Tests
 ----------------------
 
diff --git a/t/t0050-filesystem.sh b/t/t0050-filesystem.sh
index b46ae72..78816d9 100755
--- a/t/t0050-filesystem.sh
+++ b/t/t0050-filesystem.sh
@@ -7,22 +7,6 @@ test_description='Various filesystem issues'
 auml=$(printf '\303\244')
 aumlcdiar=$(printf '\141\314\210')
 
-unibad=
-test_expect_success 'see what we expect' '
-
-	test_unicode=test_expect_success &&
-	mkdir junk &&
-	>junk/"$auml" &&
-	case "$(cd junk && echo *)" in
-	"$aumlcdiar")
-		test_unicode=test_expect_failure &&
-		unibad=t
-		;;
-	*)	;;
-	esac &&
-	rm -fr junk
-'
-
 if test_have_prereq CASE_INSENSITIVE_FS
 then
 	say "will test on a case insensitive filesystem"
@@ -31,8 +15,14 @@ else
 	test_case=test_expect_success
 fi
 
-test "$unibad" &&
+if test_have_prereq UTF8_NFD_TO_NFC
+then
 	say "will test on a unicode corrupting filesystem"
+	test_unicode=test_expect_failure
+else
+	test_unicode=test_expect_success
+fi
+
 test_have_prereq SYMLINKS ||
 	say "will test on a filesystem lacking symbolic links"
 
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 57fc1f2..057ac1d 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -676,3 +676,17 @@ then
 	test_set_prereq CASE_INSENSITIVE_FS
 fi
 rm -rf junk
+
+# check whether FS converts nfd unicode to nfc
+auml=$(printf '\303\244')
+aumlcdiar=$(printf '\141\314\210')
+
+mkdir junk &&
+>junk/"$auml" &&
+case "$(cd junk && echo *)" in
+"$aumlcdiar")
+	test_set_prereq UTF8_NFD_TO_NFC
+	;;
+*)	;;
+esac
+rm -fr junk
-- 
1.7.12.rc0.198.gd66b616

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

* [PATCH 5/5] t3910: use the SYMLINKS test prereq
  2012-07-26 13:39   ` [PATCH 0/5] test-lib: filesystem prerequisites Michael J Gruber
                       ` (3 preceding siblings ...)
  2012-07-26 13:39     ` [PATCH 4/5] test-lib: provide UTF8 behaviour as a prerequisite Michael J Gruber
@ 2012-07-26 13:39     ` Michael J Gruber
  2012-07-26 18:16     ` [PATCH 0/5] test-lib: filesystem prerequisites Junio C Hamano
  5 siblings, 0 replies; 19+ messages in thread
From: Michael J Gruber @ 2012-07-26 13:39 UTC (permalink / raw)
  To: git; +Cc: tboegi

Besides reusing the new test prerequisite, this fixes also the issue
that the current output is not TAP compliant and produces the output "no
reason given" [for skipping].

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
---
 t/t3910-mac-os-precompose.sh | 281 +++++++++++++++++++++----------------------
 1 file changed, 135 insertions(+), 146 deletions(-)

diff --git a/t/t3910-mac-os-precompose.sh b/t/t3910-mac-os-precompose.sh
index 88b7a20..9244b69 100755
--- a/t/t3910-mac-os-precompose.sh
+++ b/t/t3910-mac-os-precompose.sh
@@ -7,158 +7,147 @@ test_description='utf-8 decomposed (nfd) converted to precomposed (nfc)'
 
 . ./test-lib.sh
 
+if ! test_have_prereq UTF8_NFD_TO_NFC
+then
+	skip_all="filesystem does not convert utf-8 nfd to nfc"
+	test_done
+fi
+
+# create utf-8 variables
 Adiarnfc=`printf '\303\204'`
 Adiarnfd=`printf 'A\314\210'`
 
-# check if the feature is compiled in
-mkdir junk &&
->junk/"$Adiarnfc" &&
-case "$(cd junk && echo *)" in
-	"$Adiarnfd")
-	test_nfd=1
-	;;
-	*)	;;
-esac
-rm -rf junk
+Odiarnfc=`printf '\303\226'`
+Odiarnfd=`printf 'O\314\210'`
+AEligatu=`printf '\303\206'`
+Invalidu=`printf '\303\377'`
 
 
-if test "$test_nfd"
-then
-	# create more utf-8 variables
-	Odiarnfc=`printf '\303\226'`
-	Odiarnfd=`printf 'O\314\210'`
-	AEligatu=`printf '\303\206'`
-	Invalidu=`printf '\303\377'`
+#Create a string with 255 bytes (decomposed)
+Alongd=$Adiarnfd$Adiarnfd$Adiarnfd$Adiarnfd$Adiarnfd$Adiarnfd$Adiarnfd #21 Byte
+Alongd=$Alongd$Alongd$Alongd                                           #63 Byte
+Alongd=$Alongd$Alongd$Alongd$Alongd$Adiarnfd                           #255 Byte
 
+#Create a string with 254 bytes (precomposed)
+Alongc=$AEligatu$AEligatu$AEligatu$AEligatu$AEligatu #10 Byte
+Alongc=$Alongc$Alongc$Alongc$Alongc$Alongc           #50 Byte
+Alongc=$Alongc$Alongc$Alongc$Alongc$Alongc           #250 Byte
+Alongc=$Alongc$AEligatu$AEligatu                     #254 Byte
 
-	#Create a string with 255 bytes (decomposed)
-	Alongd=$Adiarnfd$Adiarnfd$Adiarnfd$Adiarnfd$Adiarnfd$Adiarnfd$Adiarnfd #21 Byte
-	Alongd=$Alongd$Alongd$Alongd                                           #63 Byte
-	Alongd=$Alongd$Alongd$Alongd$Alongd$Adiarnfd                           #255 Byte
-
-	#Create a string with 254 bytes (precomposed)
-	Alongc=$AEligatu$AEligatu$AEligatu$AEligatu$AEligatu #10 Byte
-	Alongc=$Alongc$Alongc$Alongc$Alongc$Alongc           #50 Byte
-	Alongc=$Alongc$Alongc$Alongc$Alongc$Alongc           #250 Byte
-	Alongc=$Alongc$AEligatu$AEligatu                     #254 Byte
-
-	test_expect_success "detect if nfd needed" '
-		precomposeunicode=`git config core.precomposeunicode` &&
-		test "$precomposeunicode" = false &&
-		git config core.precomposeunicode true
-	'
-	test_expect_success "setup" '
-		>x &&
-		git add x &&
-		git commit -m "1st commit" &&
-		git rm x &&
-		git commit -m "rm x"
-	'
-	test_expect_success "setup case mac" '
-		git checkout -b mac_os
-	'
-	# This will test nfd2nfc in readdir()
-	test_expect_success "add file Adiarnfc" '
-		echo f.Adiarnfc >f.$Adiarnfc &&
-		git add f.$Adiarnfc &&
-		git commit -m "add f.$Adiarnfc"
-	'
-	# This will test nfd2nfc in git stage()
-	test_expect_success "stage file d.Adiarnfd/f.Adiarnfd" '
-		mkdir d.$Adiarnfd &&
-		echo d.$Adiarnfd/f.$Adiarnfd >d.$Adiarnfd/f.$Adiarnfd &&
-		git stage d.$Adiarnfd/f.$Adiarnfd &&
-		git commit -m "add d.$Adiarnfd/f.$Adiarnfd"
-	'
-	test_expect_success "add link Adiarnfc" '
-		ln -s d.$Adiarnfd/f.$Adiarnfd l.$Adiarnfc &&
-		git add l.$Adiarnfc &&
-		git commit -m "add l.Adiarnfc"
-	'
-	# This will test git log
-	test_expect_success "git log f.Adiar" '
-		git log f.$Adiarnfc > f.Adiarnfc.log &&
-		git log f.$Adiarnfd > f.Adiarnfd.log &&
-		test -s f.Adiarnfc.log &&
-		test -s f.Adiarnfd.log &&
-		test_cmp f.Adiarnfc.log f.Adiarnfd.log &&
-		rm f.Adiarnfc.log f.Adiarnfd.log
-	'
-	# This will test git ls-files
-	test_expect_success "git lsfiles f.Adiar" '
-		git ls-files f.$Adiarnfc > f.Adiarnfc.log &&
-		git ls-files f.$Adiarnfd > f.Adiarnfd.log &&
-		test -s f.Adiarnfc.log &&
-		test -s f.Adiarnfd.log &&
-		test_cmp f.Adiarnfc.log f.Adiarnfd.log &&
-		rm f.Adiarnfc.log f.Adiarnfd.log
-	'
-	# This will test git mv
-	test_expect_success "git mv" '
-		git mv f.$Adiarnfd f.$Odiarnfc &&
-		git mv d.$Adiarnfd d.$Odiarnfc &&
-		git mv l.$Adiarnfd l.$Odiarnfc &&
-		git commit -m "mv Adiarnfd Odiarnfc"
-	'
-	# Files can be checked out as nfc
-	# And the link has been corrected from nfd to nfc
-	test_expect_success "git checkout nfc" '
-		rm f.$Odiarnfc &&
-		git checkout f.$Odiarnfc
-	'
-	# Make it possible to checkout files with their NFD names
-	test_expect_success "git checkout file nfd" '
-		rm -f f.* &&
-		git checkout f.$Odiarnfd
-	'
-	# Make it possible to checkout links with their NFD names
-	test_expect_success "git checkout link nfd" '
-		rm l.* &&
-		git checkout l.$Odiarnfd
-	'
-	test_expect_success "setup case mac2" '
-		git checkout master &&
-		git reset --hard &&
-		git checkout -b mac_os_2
-	'
-	# This will test nfd2nfc in git commit
-	test_expect_success "commit file d2.Adiarnfd/f.Adiarnfd" '
-		mkdir d2.$Adiarnfd &&
-		echo d2.$Adiarnfd/f.$Adiarnfd >d2.$Adiarnfd/f.$Adiarnfd &&
-		git add d2.$Adiarnfd/f.$Adiarnfd &&
-		git commit -m "add d2.$Adiarnfd/f.$Adiarnfd" -- d2.$Adiarnfd/f.$Adiarnfd
-	'
-	test_expect_success "setup for long decomposed filename" '
-		git checkout master &&
-		git reset --hard &&
-		git checkout -b mac_os_long_nfd_fn
-	'
-	test_expect_success "Add long decomposed filename" '
-		echo longd >$Alongd &&
-		git add * &&
-		git commit -m "Long filename"
-	'
-	test_expect_success "setup for long precomposed filename" '
-		git checkout master &&
-		git reset --hard &&
-		git checkout -b mac_os_long_nfc_fn
-	'
-	test_expect_success "Add long precomposed filename" '
-		echo longc >$Alongc &&
-		git add * &&
-		git commit -m "Long filename"
-	'
-	# Test if the global core.precomposeunicode stops autosensing
-	# Must be the last test case
-	test_expect_success "respect git config --global core.precomposeunicode" '
-		git config --global core.precomposeunicode true &&
-		rm -rf .git &&
-		git init &&
-		precomposeunicode=`git config core.precomposeunicode` &&
-		test "$precomposeunicode" = "true"
-	'
-else
-	 say "Skipping nfc/nfd tests"
-fi
+test_expect_success "detect if nfd needed" '
+	precomposeunicode=`git config core.precomposeunicode` &&
+	test "$precomposeunicode" = false &&
+	git config core.precomposeunicode true
+'
+test_expect_success "setup" '
+	>x &&
+	git add x &&
+	git commit -m "1st commit" &&
+	git rm x &&
+	git commit -m "rm x"
+'
+test_expect_success "setup case mac" '
+	git checkout -b mac_os
+'
+# This will test nfd2nfc in readdir()
+test_expect_success "add file Adiarnfc" '
+	echo f.Adiarnfc >f.$Adiarnfc &&
+	git add f.$Adiarnfc &&
+	git commit -m "add f.$Adiarnfc"
+'
+# This will test nfd2nfc in git stage()
+test_expect_success "stage file d.Adiarnfd/f.Adiarnfd" '
+	mkdir d.$Adiarnfd &&
+	echo d.$Adiarnfd/f.$Adiarnfd >d.$Adiarnfd/f.$Adiarnfd &&
+	git stage d.$Adiarnfd/f.$Adiarnfd &&
+	git commit -m "add d.$Adiarnfd/f.$Adiarnfd"
+'
+test_expect_success "add link Adiarnfc" '
+	ln -s d.$Adiarnfd/f.$Adiarnfd l.$Adiarnfc &&
+	git add l.$Adiarnfc &&
+	git commit -m "add l.Adiarnfc"
+'
+# This will test git log
+test_expect_success "git log f.Adiar" '
+	git log f.$Adiarnfc > f.Adiarnfc.log &&
+	git log f.$Adiarnfd > f.Adiarnfd.log &&
+	test -s f.Adiarnfc.log &&
+	test -s f.Adiarnfd.log &&
+	test_cmp f.Adiarnfc.log f.Adiarnfd.log &&
+	rm f.Adiarnfc.log f.Adiarnfd.log
+'
+# This will test git ls-files
+test_expect_success "git lsfiles f.Adiar" '
+	git ls-files f.$Adiarnfc > f.Adiarnfc.log &&
+	git ls-files f.$Adiarnfd > f.Adiarnfd.log &&
+	test -s f.Adiarnfc.log &&
+	test -s f.Adiarnfd.log &&
+	test_cmp f.Adiarnfc.log f.Adiarnfd.log &&
+	rm f.Adiarnfc.log f.Adiarnfd.log
+'
+# This will test git mv
+test_expect_success "git mv" '
+	git mv f.$Adiarnfd f.$Odiarnfc &&
+	git mv d.$Adiarnfd d.$Odiarnfc &&
+	git mv l.$Adiarnfd l.$Odiarnfc &&
+	git commit -m "mv Adiarnfd Odiarnfc"
+'
+# Files can be checked out as nfc
+# And the link has been corrected from nfd to nfc
+test_expect_success "git checkout nfc" '
+	rm f.$Odiarnfc &&
+	git checkout f.$Odiarnfc
+'
+# Make it possible to checkout files with their NFD names
+test_expect_success "git checkout file nfd" '
+	rm -f f.* &&
+	git checkout f.$Odiarnfd
+'
+# Make it possible to checkout links with their NFD names
+test_expect_success "git checkout link nfd" '
+	rm l.* &&
+	git checkout l.$Odiarnfd
+'
+test_expect_success "setup case mac2" '
+	git checkout master &&
+	git reset --hard &&
+	git checkout -b mac_os_2
+'
+# This will test nfd2nfc in git commit
+test_expect_success "commit file d2.Adiarnfd/f.Adiarnfd" '
+	mkdir d2.$Adiarnfd &&
+	echo d2.$Adiarnfd/f.$Adiarnfd >d2.$Adiarnfd/f.$Adiarnfd &&
+	git add d2.$Adiarnfd/f.$Adiarnfd &&
+	git commit -m "add d2.$Adiarnfd/f.$Adiarnfd" -- d2.$Adiarnfd/f.$Adiarnfd
+'
+test_expect_success "setup for long decomposed filename" '
+	git checkout master &&
+	git reset --hard &&
+	git checkout -b mac_os_long_nfd_fn
+'
+test_expect_success "Add long decomposed filename" '
+	echo longd >$Alongd &&
+	git add * &&
+	git commit -m "Long filename"
+'
+test_expect_success "setup for long precomposed filename" '
+	git checkout master &&
+	git reset --hard &&
+	git checkout -b mac_os_long_nfc_fn
+'
+test_expect_success "Add long precomposed filename" '
+	echo longc >$Alongc &&
+	git add * &&
+	git commit -m "Long filename"
+'
+# Test if the global core.precomposeunicode stops autosensing
+# Must be the last test case
+test_expect_success "respect git config --global core.precomposeunicode" '
+	git config --global core.precomposeunicode true &&
+	rm -rf .git &&
+	git init &&
+	precomposeunicode=`git config core.precomposeunicode` &&
+	test "$precomposeunicode" = "true"
+'
 
 test_done
-- 
1.7.12.rc0.198.gd66b616

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

* Re: [PATCH 0/5] test-lib: filesystem prerequisites
  2012-07-26 13:39   ` [PATCH 0/5] test-lib: filesystem prerequisites Michael J Gruber
                       ` (4 preceding siblings ...)
  2012-07-26 13:39     ` [PATCH 5/5] t3910: use the SYMLINKS test prereq Michael J Gruber
@ 2012-07-26 18:16     ` Junio C Hamano
  2012-07-26 18:43       ` Jeff King
  5 siblings, 1 reply; 19+ messages in thread
From: Junio C Hamano @ 2012-07-26 18:16 UTC (permalink / raw)
  To: Michael J Gruber; +Cc: git, tboegi

Michael J Gruber <git@drmicha.warpmail.net> writes:

> This mini series provides and makes use of test prerequisites for
> case insensitivity, symlinks and unicode conversion.
>
> SYMLINKS existed before but was not used in t0050.
> CASE_INSENSITIVE_FS was defined in t0003 rather than test-lib (and redone in
> t0050).
> UTF8_NFD_TO_NFC did not exist but was redone in two ways in two tests.
>
> After this series, all 3 are defined in test-lib and used in the various tests.

Consolidating the logic to set necessary prerequisites used in
various scripts is very good, but I am not sure adding them to
test-lib and run them unconditionally is a good idea.  SYMLINKS is
used by 47 among 595 tests, which is common enough, but the new ones
are not common enough.  I do not think we want to create a temporary
"junk" dir, two temporary "camelcase" files, read and compare them,
when nobody in the script cares.

We do not have to split them into separate include files, though, in
order to avoid such waste.  Instead, you can make the logic to set
prerequisite conditional inside test-lib.sh and update the users.

Something like:

	(in t/test-lib.sh)
	case ",$TEST_WANT_PREREQ," in
	*,CASE_INSENSITIVE_FS,*)
		mkdir junk &&
                echo good >junk/CamelCase &&
                echo bad >junk/camelcase &&
                test "$(cat junk/CamelCase)" == good ||
                test_set_prereq CASE_INSENSITIVE_FS
		rm -fr junk
	esac

	(at the beginning of t/t0003-attributes.sh)
	#!/bin/sh
        test_description=gitattributes
        TEST_WANT_PREREQ=CASE_INSENSITIVE_FS,SYMLINKS
	. ./test-lib.sh

Thanks.

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

* Re: [PATCH 0/5] test-lib: filesystem prerequisites
  2012-07-26 18:16     ` [PATCH 0/5] test-lib: filesystem prerequisites Junio C Hamano
@ 2012-07-26 18:43       ` Jeff King
  2012-07-26 20:10         ` Junio C Hamano
  0 siblings, 1 reply; 19+ messages in thread
From: Jeff King @ 2012-07-26 18:43 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Michael J Gruber, git, tboegi

On Thu, Jul 26, 2012 at 11:16:45AM -0700, Junio C Hamano wrote:

> Consolidating the logic to set necessary prerequisites used in
> various scripts is very good, but I am not sure adding them to
> test-lib and run them unconditionally is a good idea.  SYMLINKS is
> used by 47 among 595 tests, which is common enough, but the new ones
> are not common enough.  I do not think we want to create a temporary
> "junk" dir, two temporary "camelcase" files, read and compare them,
> when nobody in the script cares.
> 
> We do not have to split them into separate include files, though, in
> order to avoid such waste.  Instead, you can make the logic to set
> prerequisite conditional inside test-lib.sh and update the users.
> 
> Something like:
> [...]
> 	(at the beginning of t/t0003-attributes.sh)
> 	#!/bin/sh
>         test_description=gitattributes
>         TEST_WANT_PREREQ=CASE_INSENSITIVE_FS,SYMLINKS
> 	. ./test-lib.sh

That looks like a maintenance annoyance. Can't we just have the
prerequisite-checker lazily perform the test on demand and cache the
result?  It should be OK as long as:

  1. The prereq is careful about its pre- and post- conditions. We
     already make sure to clean up after those tests so as not to taint
     later tests. We would probably want to also make them more careful
     about preconditions like which directory they are in (so, for
     example, refer to "$TRASH_DIRECTORY/junk" and not "junk").

  2. The prereq test does not accidentally munge any existing test
     state from previous tests. That should not be a big deal as long as
     we avoid names like "junk" in favor of more unique names like
     "check-case-sensitivity-prereq".

-Peff

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

* Re: [PATCH 0/5] test-lib: filesystem prerequisites
  2012-07-26 18:43       ` Jeff King
@ 2012-07-26 20:10         ` Junio C Hamano
  2012-07-27  9:31           ` Michael J Gruber
  0 siblings, 1 reply; 19+ messages in thread
From: Junio C Hamano @ 2012-07-26 20:10 UTC (permalink / raw)
  To: Jeff King; +Cc: Michael J Gruber, git, tboegi

Jeff King <peff@peff.net> writes:

> That looks like a maintenance annoyance. Can't we just have the
> prerequisite-checker lazily perform the test on demand and cache the
> result?  It should be OK as long as:
>
>   1. The prereq is careful about its pre- and post- conditions. We
>      already make sure to clean up after those tests so as not to taint
>      later tests. We would probably want to also make them more careful
>      about preconditions like which directory they are in (so, for
>      example, refer to "$TRASH_DIRECTORY/junk" and not "junk").
>
>   2. The prereq test does not accidentally munge any existing test
>      state from previous tests. That should not be a big deal as long as
>      we avoid names like "junk" in favor of more unique names like
>      "check-case-sensitivity-prereq".

Yeah, it is very desirable if we could lazy-eval, and we _should_ be
able to arrange the above.

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

* Re: [PATCH 0/5] test-lib: filesystem prerequisites
  2012-07-26 20:10         ` Junio C Hamano
@ 2012-07-27  9:31           ` Michael J Gruber
  2012-07-27 17:29             ` Junio C Hamano
  0 siblings, 1 reply; 19+ messages in thread
From: Michael J Gruber @ 2012-07-27  9:31 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Jeff King, git, tboegi

Junio C Hamano venit, vidit, dixit 26.07.2012 22:10:
> Jeff King <peff@peff.net> writes:
> 
>> That looks like a maintenance annoyance. Can't we just have the
>> prerequisite-checker lazily perform the test on demand and cache the
>> result?  It should be OK as long as:
>>
>>   1. The prereq is careful about its pre- and post- conditions. We
>>      already make sure to clean up after those tests so as not to taint
>>      later tests. We would probably want to also make them more careful
>>      about preconditions like which directory they are in (so, for
>>      example, refer to "$TRASH_DIRECTORY/junk" and not "junk").
>>
>>   2. The prereq test does not accidentally munge any existing test
>>      state from previous tests. That should not be a big deal as long as
>>      we avoid names like "junk" in favor of more unique names like
>>      "check-case-sensitivity-prereq".
> 
> Yeah, it is very desirable if we could lazy-eval, and we _should_ be
> able to arrange the above.
> 

Yes, lazy-eval looks good and is probably easier than caching.

The adjustments to 1/5 and 4/5 look good.

5/5 needs a fix in the subject line, sorry. It should be:

t3910: use the UTF8_NFD_TO_NFC test prereq

(5/5 hasn't hit next)

Thanks,
Michael

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

* Re: [PATCH 0/5] test-lib: filesystem prerequisites
  2012-07-27  9:31           ` Michael J Gruber
@ 2012-07-27 17:29             ` Junio C Hamano
  2012-07-30  9:56               ` Michael J Gruber
  2012-07-30  9:57               ` [PATCHv2 5/5] t3910: use the UTF8_NFD_TO_NFC test prereq Michael J Gruber
  0 siblings, 2 replies; 19+ messages in thread
From: Junio C Hamano @ 2012-07-27 17:29 UTC (permalink / raw)
  To: Michael J Gruber; +Cc: Jeff King, git, tboegi

Michael J Gruber <git@drmicha.warpmail.net> writes:

> 5/5 needs a fix in the subject line, sorry. It should be:
>
> t3910: use the UTF8_NFD_TO_NFC test prereq
>
> (5/5 hasn't hit next)

That is because I thought that you would like the lazy-probe and
that you would be capable of rerolling it on your own ;-)

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

* Re: [PATCH 0/5] test-lib: filesystem prerequisites
  2012-07-27 17:29             ` Junio C Hamano
@ 2012-07-30  9:56               ` Michael J Gruber
  2012-07-30  9:57               ` [PATCHv2 5/5] t3910: use the UTF8_NFD_TO_NFC test prereq Michael J Gruber
  1 sibling, 0 replies; 19+ messages in thread
From: Michael J Gruber @ 2012-07-30  9:56 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Jeff King, git, tboegi

Junio C Hamano venit, vidit, dixit 27.07.2012 19:29:
> Michael J Gruber <git@drmicha.warpmail.net> writes:
> 
>> 5/5 needs a fix in the subject line, sorry. It should be:
>>
>> t3910: use the UTF8_NFD_TO_NFC test prereq
>>
>> (5/5 hasn't hit next)
> 
> That is because I thought that you would like the lazy-probe and
> that you would be capable of rerolling it on your own ;-)
> 

Well, I do like the lazy-probe, and I would like to lazy-probe ;)

Due to the nice design of test_lazy_prereq, the test scripts don't need
any adjustment in order to get lazy. Now, that's what I call lazy!

So, 5/5 does not need any reroll, right? Anyway, 5/5 with the proper
subject line comes in a minute.

And thanks for the un-lazy lazyfing reroll of 1/5 and 4/5.

Michael

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

* [PATCHv2 5/5] t3910: use the UTF8_NFD_TO_NFC test prereq
  2012-07-27 17:29             ` Junio C Hamano
  2012-07-30  9:56               ` Michael J Gruber
@ 2012-07-30  9:57               ` Michael J Gruber
  2012-07-30 15:29                 ` Junio C Hamano
  2012-08-04  5:37                 ` Torsten Bögershausen
  1 sibling, 2 replies; 19+ messages in thread
From: Michael J Gruber @ 2012-07-30  9:57 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Jeff King, tboegi

Besides reusing the new test prerequisite, this fixes also the issue
that the current output is not TAP compliant and produces the output "no
reason given" [for skipping].

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
---
Same patch, new subject line which matches the actual patch. Yeah.

 t/t3910-mac-os-precompose.sh | 281 +++++++++++++++++++++----------------------
 1 file changed, 135 insertions(+), 146 deletions(-)

diff --git a/t/t3910-mac-os-precompose.sh b/t/t3910-mac-os-precompose.sh
index 88b7a20..9244b69 100755
--- a/t/t3910-mac-os-precompose.sh
+++ b/t/t3910-mac-os-precompose.sh
@@ -7,158 +7,147 @@ test_description='utf-8 decomposed (nfd) converted to precomposed (nfc)'
 
 . ./test-lib.sh
 
+if ! test_have_prereq UTF8_NFD_TO_NFC
+then
+	skip_all="filesystem does not convert utf-8 nfd to nfc"
+	test_done
+fi
+
+# create utf-8 variables
 Adiarnfc=`printf '\303\204'`
 Adiarnfd=`printf 'A\314\210'`
 
-# check if the feature is compiled in
-mkdir junk &&
->junk/"$Adiarnfc" &&
-case "$(cd junk && echo *)" in
-	"$Adiarnfd")
-	test_nfd=1
-	;;
-	*)	;;
-esac
-rm -rf junk
+Odiarnfc=`printf '\303\226'`
+Odiarnfd=`printf 'O\314\210'`
+AEligatu=`printf '\303\206'`
+Invalidu=`printf '\303\377'`
 
 
-if test "$test_nfd"
-then
-	# create more utf-8 variables
-	Odiarnfc=`printf '\303\226'`
-	Odiarnfd=`printf 'O\314\210'`
-	AEligatu=`printf '\303\206'`
-	Invalidu=`printf '\303\377'`
+#Create a string with 255 bytes (decomposed)
+Alongd=$Adiarnfd$Adiarnfd$Adiarnfd$Adiarnfd$Adiarnfd$Adiarnfd$Adiarnfd #21 Byte
+Alongd=$Alongd$Alongd$Alongd                                           #63 Byte
+Alongd=$Alongd$Alongd$Alongd$Alongd$Adiarnfd                           #255 Byte
 
+#Create a string with 254 bytes (precomposed)
+Alongc=$AEligatu$AEligatu$AEligatu$AEligatu$AEligatu #10 Byte
+Alongc=$Alongc$Alongc$Alongc$Alongc$Alongc           #50 Byte
+Alongc=$Alongc$Alongc$Alongc$Alongc$Alongc           #250 Byte
+Alongc=$Alongc$AEligatu$AEligatu                     #254 Byte
 
-	#Create a string with 255 bytes (decomposed)
-	Alongd=$Adiarnfd$Adiarnfd$Adiarnfd$Adiarnfd$Adiarnfd$Adiarnfd$Adiarnfd #21 Byte
-	Alongd=$Alongd$Alongd$Alongd                                           #63 Byte
-	Alongd=$Alongd$Alongd$Alongd$Alongd$Adiarnfd                           #255 Byte
-
-	#Create a string with 254 bytes (precomposed)
-	Alongc=$AEligatu$AEligatu$AEligatu$AEligatu$AEligatu #10 Byte
-	Alongc=$Alongc$Alongc$Alongc$Alongc$Alongc           #50 Byte
-	Alongc=$Alongc$Alongc$Alongc$Alongc$Alongc           #250 Byte
-	Alongc=$Alongc$AEligatu$AEligatu                     #254 Byte
-
-	test_expect_success "detect if nfd needed" '
-		precomposeunicode=`git config core.precomposeunicode` &&
-		test "$precomposeunicode" = false &&
-		git config core.precomposeunicode true
-	'
-	test_expect_success "setup" '
-		>x &&
-		git add x &&
-		git commit -m "1st commit" &&
-		git rm x &&
-		git commit -m "rm x"
-	'
-	test_expect_success "setup case mac" '
-		git checkout -b mac_os
-	'
-	# This will test nfd2nfc in readdir()
-	test_expect_success "add file Adiarnfc" '
-		echo f.Adiarnfc >f.$Adiarnfc &&
-		git add f.$Adiarnfc &&
-		git commit -m "add f.$Adiarnfc"
-	'
-	# This will test nfd2nfc in git stage()
-	test_expect_success "stage file d.Adiarnfd/f.Adiarnfd" '
-		mkdir d.$Adiarnfd &&
-		echo d.$Adiarnfd/f.$Adiarnfd >d.$Adiarnfd/f.$Adiarnfd &&
-		git stage d.$Adiarnfd/f.$Adiarnfd &&
-		git commit -m "add d.$Adiarnfd/f.$Adiarnfd"
-	'
-	test_expect_success "add link Adiarnfc" '
-		ln -s d.$Adiarnfd/f.$Adiarnfd l.$Adiarnfc &&
-		git add l.$Adiarnfc &&
-		git commit -m "add l.Adiarnfc"
-	'
-	# This will test git log
-	test_expect_success "git log f.Adiar" '
-		git log f.$Adiarnfc > f.Adiarnfc.log &&
-		git log f.$Adiarnfd > f.Adiarnfd.log &&
-		test -s f.Adiarnfc.log &&
-		test -s f.Adiarnfd.log &&
-		test_cmp f.Adiarnfc.log f.Adiarnfd.log &&
-		rm f.Adiarnfc.log f.Adiarnfd.log
-	'
-	# This will test git ls-files
-	test_expect_success "git lsfiles f.Adiar" '
-		git ls-files f.$Adiarnfc > f.Adiarnfc.log &&
-		git ls-files f.$Adiarnfd > f.Adiarnfd.log &&
-		test -s f.Adiarnfc.log &&
-		test -s f.Adiarnfd.log &&
-		test_cmp f.Adiarnfc.log f.Adiarnfd.log &&
-		rm f.Adiarnfc.log f.Adiarnfd.log
-	'
-	# This will test git mv
-	test_expect_success "git mv" '
-		git mv f.$Adiarnfd f.$Odiarnfc &&
-		git mv d.$Adiarnfd d.$Odiarnfc &&
-		git mv l.$Adiarnfd l.$Odiarnfc &&
-		git commit -m "mv Adiarnfd Odiarnfc"
-	'
-	# Files can be checked out as nfc
-	# And the link has been corrected from nfd to nfc
-	test_expect_success "git checkout nfc" '
-		rm f.$Odiarnfc &&
-		git checkout f.$Odiarnfc
-	'
-	# Make it possible to checkout files with their NFD names
-	test_expect_success "git checkout file nfd" '
-		rm -f f.* &&
-		git checkout f.$Odiarnfd
-	'
-	# Make it possible to checkout links with their NFD names
-	test_expect_success "git checkout link nfd" '
-		rm l.* &&
-		git checkout l.$Odiarnfd
-	'
-	test_expect_success "setup case mac2" '
-		git checkout master &&
-		git reset --hard &&
-		git checkout -b mac_os_2
-	'
-	# This will test nfd2nfc in git commit
-	test_expect_success "commit file d2.Adiarnfd/f.Adiarnfd" '
-		mkdir d2.$Adiarnfd &&
-		echo d2.$Adiarnfd/f.$Adiarnfd >d2.$Adiarnfd/f.$Adiarnfd &&
-		git add d2.$Adiarnfd/f.$Adiarnfd &&
-		git commit -m "add d2.$Adiarnfd/f.$Adiarnfd" -- d2.$Adiarnfd/f.$Adiarnfd
-	'
-	test_expect_success "setup for long decomposed filename" '
-		git checkout master &&
-		git reset --hard &&
-		git checkout -b mac_os_long_nfd_fn
-	'
-	test_expect_success "Add long decomposed filename" '
-		echo longd >$Alongd &&
-		git add * &&
-		git commit -m "Long filename"
-	'
-	test_expect_success "setup for long precomposed filename" '
-		git checkout master &&
-		git reset --hard &&
-		git checkout -b mac_os_long_nfc_fn
-	'
-	test_expect_success "Add long precomposed filename" '
-		echo longc >$Alongc &&
-		git add * &&
-		git commit -m "Long filename"
-	'
-	# Test if the global core.precomposeunicode stops autosensing
-	# Must be the last test case
-	test_expect_success "respect git config --global core.precomposeunicode" '
-		git config --global core.precomposeunicode true &&
-		rm -rf .git &&
-		git init &&
-		precomposeunicode=`git config core.precomposeunicode` &&
-		test "$precomposeunicode" = "true"
-	'
-else
-	 say "Skipping nfc/nfd tests"
-fi
+test_expect_success "detect if nfd needed" '
+	precomposeunicode=`git config core.precomposeunicode` &&
+	test "$precomposeunicode" = false &&
+	git config core.precomposeunicode true
+'
+test_expect_success "setup" '
+	>x &&
+	git add x &&
+	git commit -m "1st commit" &&
+	git rm x &&
+	git commit -m "rm x"
+'
+test_expect_success "setup case mac" '
+	git checkout -b mac_os
+'
+# This will test nfd2nfc in readdir()
+test_expect_success "add file Adiarnfc" '
+	echo f.Adiarnfc >f.$Adiarnfc &&
+	git add f.$Adiarnfc &&
+	git commit -m "add f.$Adiarnfc"
+'
+# This will test nfd2nfc in git stage()
+test_expect_success "stage file d.Adiarnfd/f.Adiarnfd" '
+	mkdir d.$Adiarnfd &&
+	echo d.$Adiarnfd/f.$Adiarnfd >d.$Adiarnfd/f.$Adiarnfd &&
+	git stage d.$Adiarnfd/f.$Adiarnfd &&
+	git commit -m "add d.$Adiarnfd/f.$Adiarnfd"
+'
+test_expect_success "add link Adiarnfc" '
+	ln -s d.$Adiarnfd/f.$Adiarnfd l.$Adiarnfc &&
+	git add l.$Adiarnfc &&
+	git commit -m "add l.Adiarnfc"
+'
+# This will test git log
+test_expect_success "git log f.Adiar" '
+	git log f.$Adiarnfc > f.Adiarnfc.log &&
+	git log f.$Adiarnfd > f.Adiarnfd.log &&
+	test -s f.Adiarnfc.log &&
+	test -s f.Adiarnfd.log &&
+	test_cmp f.Adiarnfc.log f.Adiarnfd.log &&
+	rm f.Adiarnfc.log f.Adiarnfd.log
+'
+# This will test git ls-files
+test_expect_success "git lsfiles f.Adiar" '
+	git ls-files f.$Adiarnfc > f.Adiarnfc.log &&
+	git ls-files f.$Adiarnfd > f.Adiarnfd.log &&
+	test -s f.Adiarnfc.log &&
+	test -s f.Adiarnfd.log &&
+	test_cmp f.Adiarnfc.log f.Adiarnfd.log &&
+	rm f.Adiarnfc.log f.Adiarnfd.log
+'
+# This will test git mv
+test_expect_success "git mv" '
+	git mv f.$Adiarnfd f.$Odiarnfc &&
+	git mv d.$Adiarnfd d.$Odiarnfc &&
+	git mv l.$Adiarnfd l.$Odiarnfc &&
+	git commit -m "mv Adiarnfd Odiarnfc"
+'
+# Files can be checked out as nfc
+# And the link has been corrected from nfd to nfc
+test_expect_success "git checkout nfc" '
+	rm f.$Odiarnfc &&
+	git checkout f.$Odiarnfc
+'
+# Make it possible to checkout files with their NFD names
+test_expect_success "git checkout file nfd" '
+	rm -f f.* &&
+	git checkout f.$Odiarnfd
+'
+# Make it possible to checkout links with their NFD names
+test_expect_success "git checkout link nfd" '
+	rm l.* &&
+	git checkout l.$Odiarnfd
+'
+test_expect_success "setup case mac2" '
+	git checkout master &&
+	git reset --hard &&
+	git checkout -b mac_os_2
+'
+# This will test nfd2nfc in git commit
+test_expect_success "commit file d2.Adiarnfd/f.Adiarnfd" '
+	mkdir d2.$Adiarnfd &&
+	echo d2.$Adiarnfd/f.$Adiarnfd >d2.$Adiarnfd/f.$Adiarnfd &&
+	git add d2.$Adiarnfd/f.$Adiarnfd &&
+	git commit -m "add d2.$Adiarnfd/f.$Adiarnfd" -- d2.$Adiarnfd/f.$Adiarnfd
+'
+test_expect_success "setup for long decomposed filename" '
+	git checkout master &&
+	git reset --hard &&
+	git checkout -b mac_os_long_nfd_fn
+'
+test_expect_success "Add long decomposed filename" '
+	echo longd >$Alongd &&
+	git add * &&
+	git commit -m "Long filename"
+'
+test_expect_success "setup for long precomposed filename" '
+	git checkout master &&
+	git reset --hard &&
+	git checkout -b mac_os_long_nfc_fn
+'
+test_expect_success "Add long precomposed filename" '
+	echo longc >$Alongc &&
+	git add * &&
+	git commit -m "Long filename"
+'
+# Test if the global core.precomposeunicode stops autosensing
+# Must be the last test case
+test_expect_success "respect git config --global core.precomposeunicode" '
+	git config --global core.precomposeunicode true &&
+	rm -rf .git &&
+	git init &&
+	precomposeunicode=`git config core.precomposeunicode` &&
+	test "$precomposeunicode" = "true"
+'
 
 test_done
-- 
1.7.12.rc0.227.g767c5be

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

* Re: [PATCHv2 5/5] t3910: use the UTF8_NFD_TO_NFC test prereq
  2012-07-30  9:57               ` [PATCHv2 5/5] t3910: use the UTF8_NFD_TO_NFC test prereq Michael J Gruber
@ 2012-07-30 15:29                 ` Junio C Hamano
  2012-08-04  5:37                 ` Torsten Bögershausen
  1 sibling, 0 replies; 19+ messages in thread
From: Junio C Hamano @ 2012-07-30 15:29 UTC (permalink / raw)
  To: Michael J Gruber; +Cc: git, Jeff King, tboegi

Michael J Gruber <git@drmicha.warpmail.net> writes:

> Besides reusing the new test prerequisite, this fixes also the issue
> that the current output is not TAP compliant and produces the output "no
> reason given" [for skipping].
>
> Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
> ---
> Same patch, new subject line which matches the actual patch. Yeah.

Thanks; queued.

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

* Re: [PATCHv2 5/5] t3910: use the UTF8_NFD_TO_NFC test prereq
  2012-07-30  9:57               ` [PATCHv2 5/5] t3910: use the UTF8_NFD_TO_NFC test prereq Michael J Gruber
  2012-07-30 15:29                 ` Junio C Hamano
@ 2012-08-04  5:37                 ` Torsten Bögershausen
  2012-08-04 22:04                   ` Junio C Hamano
  1 sibling, 1 reply; 19+ messages in thread
From: Torsten Bögershausen @ 2012-08-04  5:37 UTC (permalink / raw)
  To: Michael J Gruber; +Cc: git, Junio C Hamano, Jeff King, tboegi

Am 2012-07-30 11:57, schrieb Michael J Gruber:
(Sorry being late)

That line:
>skip_all="filesystem does not convert utf-8 nfd to nfc"

shouldn't it be the other way around?
skip_all="filesystem does not convert utf-8 nfc to nfd"

(and may be the following may be more easy to read:)
skip_all="filesystem does not decompose unicode"


Side note: t0050 uses another term:
"will test on a unicode corrupting filesystem"

/Torsten

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

* Re: [PATCHv2 5/5] t3910: use the UTF8_NFD_TO_NFC test prereq
  2012-08-04  5:37                 ` Torsten Bögershausen
@ 2012-08-04 22:04                   ` Junio C Hamano
  2012-08-06 12:44                     ` Michael J Gruber
  0 siblings, 1 reply; 19+ messages in thread
From: Junio C Hamano @ 2012-08-04 22:04 UTC (permalink / raw)
  To: Torsten Bögershausen; +Cc: Michael J Gruber, git, Jeff King

Torsten Bögershausen <tboegi@web.de> writes:

> Am 2012-07-30 11:57, schrieb Michael J Gruber:
> (Sorry being late)
>
> That line:
>>skip_all="filesystem does not convert utf-8 nfd to nfc"
>
> shouldn't it be the other way around?
> skip_all="filesystem does not convert utf-8 nfc to nfd"
>
> (and may be the following may be more easy to read:)
> skip_all="filesystem does not decompose unicode"
>
>
> Side note: t0050 uses another term:
> "will test on a unicode corrupting filesystem"

I am OK with either of the last two.  Thanks for noticing.

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

* Re: [PATCHv2 5/5] t3910: use the UTF8_NFD_TO_NFC test prereq
  2012-08-04 22:04                   ` Junio C Hamano
@ 2012-08-06 12:44                     ` Michael J Gruber
  0 siblings, 0 replies; 19+ messages in thread
From: Michael J Gruber @ 2012-08-06 12:44 UTC (permalink / raw)
  To: Junio C Hamano, Torsten Bögershausen; +Cc: Git Mailing List

Junio C Hamano venit, vidit, dixit 05.08.2012 00:04:
> Torsten Bögershausen <tboegi@web.de> writes:
> 
>> Am 2012-07-30 11:57, schrieb Michael J Gruber:
>> (Sorry being late)
>>
>> That line:
>>> skip_all="filesystem does not convert utf-8 nfd to nfc"
>>
>> shouldn't it be the other way around?
>> skip_all="filesystem does not convert utf-8 nfc to nfd"
>>
>> (and may be the following may be more easy to read:)
>> skip_all="filesystem does not decompose unicode"
>>
>>
>> Side note: t0050 uses another term:
>> "will test on a unicode corrupting filesystem"
> 
> I am OK with either of the last two.  Thanks for noticing.

I had taken the test description from t3910. But that referred to Git's
undoing of the conversion done by the filesystem...

It's best to have it analogous to t0050 as in Junio's fixup.

Thanks!
Michael
[resent with cc: list...]

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

end of thread, other threads:[~2012-08-06 12:44 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-14 17:52 [PATCH] t3910: give reason for skipping the test Michael J Gruber
2012-07-14 18:19 ` Torsten Bögershausen
2012-07-26 13:39   ` [PATCH 0/5] test-lib: filesystem prerequisites Michael J Gruber
2012-07-26 13:39     ` [PATCH 1/5] test-lib: provide case insensitivity as a prerequisite Michael J Gruber
2012-07-26 13:39     ` [PATCH 2/5] t0050: use the CASE_INSENSITIVE_FS test prereq Michael J Gruber
2012-07-26 13:39     ` [PATCH 3/5] t0050: use the SYMLINKS " Michael J Gruber
2012-07-26 13:39     ` [PATCH 4/5] test-lib: provide UTF8 behaviour as a prerequisite Michael J Gruber
2012-07-26 13:39     ` [PATCH 5/5] t3910: use the SYMLINKS test prereq Michael J Gruber
2012-07-26 18:16     ` [PATCH 0/5] test-lib: filesystem prerequisites Junio C Hamano
2012-07-26 18:43       ` Jeff King
2012-07-26 20:10         ` Junio C Hamano
2012-07-27  9:31           ` Michael J Gruber
2012-07-27 17:29             ` Junio C Hamano
2012-07-30  9:56               ` Michael J Gruber
2012-07-30  9:57               ` [PATCHv2 5/5] t3910: use the UTF8_NFD_TO_NFC test prereq Michael J Gruber
2012-07-30 15:29                 ` Junio C Hamano
2012-08-04  5:37                 ` Torsten Bögershausen
2012-08-04 22:04                   ` Junio C Hamano
2012-08-06 12:44                     ` Michael J Gruber

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).