git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Johannes Sixt <j6t@kdbg.org>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>,
	Ramkumar Ramachandra <artagnon@gmail.com>
Subject: [PATCH v2 05/10] t0000: use test_ln_s_add to remove SYMLINKS prerequisite
Date: Fri,  7 Jun 2013 22:53:29 +0200	[thread overview]
Message-ID: <798651d401ecb522aee41a4dddd80ff5701508f6.1370636706.git.j6t@kdbg.org> (raw)
In-Reply-To: <cover.1370076477.git.j6t@kdbg.org>
In-Reply-To: <cover.1370636706.git.j6t@kdbg.org>

t0000-basic hard-codes many object IDs. To cater to file systems that do
not support symbolic links, different IDs are used depending on the
SYMLINKS prerequisite. But we can observe the symbolic links are only
needed to generate index entries. Use test_ln_s_add to generate the
index entries and get rid of explicit SYMLINKS checks.

This undoes the special casing introduced in this test by 704a3143
(Use prerequisite tags to skip tests that depend on symbolic links,
2009-03-04).

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
 t/t0000-basic.sh | 39 ++++++++++-----------------------------
 1 file changed, 10 insertions(+), 29 deletions(-)

diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh
index cefe33d..0f13180 100755
--- a/t/t0000-basic.sh
+++ b/t/t0000-basic.sh
@@ -367,22 +367,6 @@ test_expect_success 'validate object ID of a known tree' '
 
 # Various types of objects
 
-# Some filesystems do not support symblic links; on such systems
-# some expected values are different
-if test_have_prereq SYMLINKS
-then
-	expectfilter=cat
-	expectedtree=087704a96baf1c2d1c869a8b084481e121c88b5b
-	expectedptree1=21ae8269cacbe57ae09138dcc3a2887f904d02b3
-	expectedptree2=3c5e5399f3a333eddecce7a9b9465b63f65f51e2
-else
-	expectfilter='grep -v sym'
-	expectedtree=8e18edf7d7edcf4371a3ac6ae5f07c2641db7c46
-	expectedptree1=cfb8591b2f65de8b8cc1020cd7d9e67e7793b325
-	expectedptree2=ce580448f0148b985a513b693fdf7d802cacb44f
-fi
-
-
 test_expect_success 'adding various types of objects with git update-index --add' '
 	mkdir path2 path3 path3/subp3 &&
 	paths="path0 path2/file2 path3/file3 path3/subp3/file3" &&
@@ -390,10 +374,7 @@ test_expect_success 'adding various types of objects with git update-index --add
 		for p in $paths
 		do
 			echo "hello $p" >$p || exit 1
-			if test_have_prereq SYMLINKS
-			then
-				ln -s "hello $p" ${p}sym || exit 1
-			fi
+			test_ln_s_add "hello $p" ${p}sym || exit 1
 		done
 	) &&
 	find path* ! -type d -print | xargs git update-index --add
@@ -405,7 +386,7 @@ test_expect_success 'showing stage with git ls-files --stage' '
 '
 
 test_expect_success 'validate git ls-files output for a known tree' '
-	$expectfilter >expected <<-\EOF &&
+	cat >expected <<-\EOF &&
 	100644 f87290f8eb2cbbea7857214459a0739927eab154 0	path0
 	120000 15a98433ae33114b085f3eb3bb03b832b3180a01 0	path0sym
 	100644 3feff949ed00a62d9f7af97c15cd8a30595e7ac7 0	path2/file2
@@ -423,14 +404,14 @@ test_expect_success 'writing tree out with git write-tree' '
 '
 
 test_expect_success 'validate object ID for a known tree' '
-	test "$tree" = "$expectedtree"
+	test "$tree" = 087704a96baf1c2d1c869a8b084481e121c88b5b
 '
 
 test_expect_success 'showing tree with git ls-tree' '
     git ls-tree $tree >current
 '
 
-test_expect_success SYMLINKS 'git ls-tree output for a known tree' '
+test_expect_success 'git ls-tree output for a known tree' '
 	cat >expected <<-\EOF &&
 	100644 blob f87290f8eb2cbbea7857214459a0739927eab154	path0
 	120000 blob 15a98433ae33114b085f3eb3bb03b832b3180a01	path0sym
@@ -447,7 +428,7 @@ test_expect_success 'showing tree with git ls-tree -r' '
 '
 
 test_expect_success 'git ls-tree -r output for a known tree' '
-	$expectfilter >expected <<-\EOF &&
+	cat >expected <<-\EOF &&
 	100644 blob f87290f8eb2cbbea7857214459a0739927eab154	path0
 	120000 blob 15a98433ae33114b085f3eb3bb03b832b3180a01	path0sym
 	100644 blob 3feff949ed00a62d9f7af97c15cd8a30595e7ac7	path2/file2
@@ -465,7 +446,7 @@ test_expect_success 'showing tree with git ls-tree -r -t' '
 	git ls-tree -r -t $tree >current
 '
 
-test_expect_success SYMLINKS 'git ls-tree -r output for a known tree' '
+test_expect_success 'git ls-tree -r output for a known tree' '
 	cat >expected <<-\EOF &&
 	100644 blob f87290f8eb2cbbea7857214459a0739927eab154	path0
 	120000 blob 15a98433ae33114b085f3eb3bb03b832b3180a01	path0sym
@@ -487,7 +468,7 @@ test_expect_success 'writing partial tree out with git write-tree --prefix' '
 '
 
 test_expect_success 'validate object ID for a known tree' '
-	test "$ptree" = "$expectedptree1"
+	test "$ptree" = 21ae8269cacbe57ae09138dcc3a2887f904d02b3
 '
 
 test_expect_success 'writing partial tree out with git write-tree --prefix' '
@@ -495,7 +476,7 @@ test_expect_success 'writing partial tree out with git write-tree --prefix' '
 '
 
 test_expect_success 'validate object ID for a known tree' '
-	test "$ptree" = "$expectedptree2"
+	test "$ptree" = 3c5e5399f3a333eddecce7a9b9465b63f65f51e2
 '
 
 test_expect_success 'put invalid objects into the index' '
@@ -529,7 +510,7 @@ test_expect_success 'git read-tree followed by write-tree should be idempotent'
 '
 
 test_expect_success 'validate git diff-files output for a know cache/work tree state' '
-	$expectfilter >expected <<\EOF &&
+	cat >expected <<\EOF &&
 :100644 100644 f87290f8eb2cbbea7857214459a0739927eab154 0000000000000000000000000000000000000000 M	path0
 :120000 120000 15a98433ae33114b085f3eb3bb03b832b3180a01 0000000000000000000000000000000000000000 M	path0sym
 :100644 100644 3feff949ed00a62d9f7af97c15cd8a30595e7ac7 0000000000000000000000000000000000000000 M	path2/file2
@@ -553,7 +534,7 @@ test_expect_success 'no diff after checkout and git update-index --refresh' '
 '
 
 ################################################################
-P=$expectedtree
+P=087704a96baf1c2d1c869a8b084481e121c88b5b
 
 test_expect_success 'git commit-tree records the correct tree in a commit' '
 	commit0=$(echo NO | git commit-tree $P) &&
-- 
1.8.3.rc1.32.g8b61cbb

  parent reply	other threads:[~2013-06-07 20:53 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-01  9:34 [PATCH 00/11] Increase test coverage on Windows by removing SYMLINKS from many tests Johannes Sixt
2013-06-01  9:34 ` [PATCH 01/11] test-chmtime: Fix exit code on Windows Johannes Sixt
2013-06-01  9:34 ` [PATCH 02/11] t2100: modernize style and unroll a loop of test cases Johannes Sixt
2013-06-01  9:34 ` [PATCH 03/11] t3010: modernize style Johannes Sixt
2013-06-01  9:34 ` [PATCH 04/11] tests: introduce test_ln_s and test_ln_s_add Johannes Sixt
2013-06-01 11:11   ` Ramkumar Ramachandra
2013-06-01 15:06     ` Johannes Sixt
2013-06-01 17:10       ` Ramkumar Ramachandra
2013-06-01  9:34 ` [PATCH 05/11] tests: use test_ln_s_add to remove SYMLINKS prerequisite (trivial cases) Johannes Sixt
2013-06-04 21:06   ` Junio C Hamano
2013-06-05 19:32     ` Johannes Sixt
2013-06-04 21:55   ` Junio C Hamano
2013-06-05 20:07     ` Johannes Sixt
2013-06-01  9:34 ` [PATCH 06/11] t0000: use test_ln_s_add to remove SYMLINKS prerequisite Johannes Sixt
2013-06-01  9:34 ` [PATCH 07/11] t2100: " Johannes Sixt
2013-06-04 22:04   ` Junio C Hamano
2013-06-05 20:23     ` Johannes Sixt
2013-06-01  9:34 ` [PATCH 08/11] t3030: " Johannes Sixt
2013-06-01  9:34 ` [PATCH 09/11] t3100: " Johannes Sixt
2013-06-01  9:34 ` [PATCH 10/11] t3509, t4023, t4114: " Johannes Sixt
2013-06-02 23:44   ` Junio C Hamano
2013-06-01  9:34 ` [PATCH 11/11] t6035: " Johannes Sixt
2013-06-07 20:53 ` [PATCH v2 00/10] Increase test coverage on Windows by removing SYMLINKS from many tests Johannes Sixt
2013-06-07 20:53   ` [PATCH v2 01/10] test-chmtime: Fix exit code on Windows Johannes Sixt
2013-11-20 14:00     ` Erik Faye-Lund
2013-06-07 20:53   ` [PATCH v2 02/10] t3010: modernize style Johannes Sixt
2013-06-07 20:53   ` [PATCH v2 03/10] tests: introduce test_ln_s_add Johannes Sixt
2013-06-07 20:53   ` [PATCH v2 04/10] tests: use test_ln_s_add to remove SYMLINKS prerequisite (trivial cases) Johannes Sixt
2013-06-07 20:53   ` Johannes Sixt [this message]
2013-06-07 20:53   ` [PATCH v2 06/10] t3030: use test_ln_s_add to remove SYMLINKS prerequisite Johannes Sixt
2013-06-07 20:53   ` [PATCH v2 07/10] t3100: " Johannes Sixt
2013-06-07 20:53   ` [PATCH v2 08/10] t3509, t4023, t4114: " Johannes Sixt
2013-06-07 20:53   ` [PATCH v2 09/10] t6035: " Johannes Sixt
2013-06-07 20:53   ` [PATCH v2 10/10] t4011: " Johannes Sixt
2013-06-07 22:04   ` [PATCH v2 00/10] Increase test coverage on Windows by removing SYMLINKS from many tests Junio C Hamano

Reply instructions:

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

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

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=798651d401ecb522aee41a4dddd80ff5701508f6.1370636706.git.j6t@kdbg.org \
    --to=j6t@kdbg.org \
    --cc=artagnon@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

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

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).