From 5be60078c935ed08ee8eb5a32680bdfb6bb5bdf3 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 2 Jul 2007 22:52:14 -0700 Subject: Rewrite "git-frotz" to "git frotz" This uses the remove-dashes target to replace "git-frotz" to "git frotz". Signed-off-by: Junio C Hamano --- t/t4011-diff-symlink.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 't/t4011-diff-symlink.sh') diff --git a/t/t4011-diff-symlink.sh b/t/t4011-diff-symlink.sh index 379a831f0b..c6d13693ba 100755 --- a/t/t4011-diff-symlink.sh +++ b/t/t4011-diff-symlink.sh @@ -23,17 +23,17 @@ EOF test_expect_success \ 'diff new symlink' \ 'ln -s xyzzy frotz && - git-update-index && - tree=$(git-write-tree) && - git-update-index --add frotz && - GIT_DIFF_OPTS=--unified=0 git-diff-index -M -p $tree > current && + git update-index && + tree=$(git write-tree) && + git update-index --add frotz && + GIT_DIFF_OPTS=--unified=0 git diff-index -M -p $tree > current && compare_diff_patch current expected' test_expect_success \ 'diff unchanged symlink' \ - 'tree=$(git-write-tree) && - git-update-index frotz && - test -z "$(git-diff-index --name-only $tree)"' + 'tree=$(git write-tree) && + git update-index frotz && + test -z "$(git diff-index --name-only $tree)"' cat > expected << EOF diff --git a/frotz b/frotz @@ -49,7 +49,7 @@ EOF test_expect_success \ 'diff removed symlink' \ 'rm frotz && - git-diff-index -M -p $tree > current && + git diff-index -M -p $tree > current && compare_diff_patch current expected' cat > expected << EOF @@ -60,7 +60,7 @@ test_expect_success \ 'diff identical, but newly created symlink' \ 'sleep 3 && ln -s xyzzy frotz && - git-diff-index -M -p $tree > current && + git diff-index -M -p $tree > current && compare_diff_patch current expected' cat > expected << EOF @@ -79,7 +79,7 @@ test_expect_success \ 'diff different symlink' \ 'rm frotz && ln -s yxyyz frotz && - git-diff-index -M -p $tree > current && + git diff-index -M -p $tree > current && compare_diff_patch current expected' test_done -- cgit v1.2.3 From bfdbee98109c5ad2dbbc392e7eed1ae688acc039 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 8 Aug 2008 02:26:28 -0700 Subject: tests: use $TEST_DIRECTORY to refer to the t/ directory Many test scripts assumed that they will start in a 'trash' subdirectory that is a single level down from the t/ directory, and referred to their test vector files by asking for files like "../t9999/expect". This will break if we move the 'trash' subdirectory elsewhere. To solve this, we earlier introduced "$TEST_DIRECTORY" so that they can refer to t/ directory reliably. This finally makes all the tests use it to refer to the outside environment. With this patch, and a one-liner not included here (because it would contradict with what Dscho really wants to do): | diff --git a/t/test-lib.sh b/t/test-lib.sh | index 70ea7e0..60e69e4 100644 | --- a/t/test-lib.sh | +++ b/t/test-lib.sh | @@ -485,7 +485,7 @@ fi | . ../GIT-BUILD-OPTIONS | | # Test repository | -test="trash directory" | +test="trash directory/another level/yet another" | rm -fr "$test" || { | trap - exit | echo >&5 "FATAL: Cannot prepare test area" all the tests still pass, but we would want extra sets of eyeballs on this type of change to really make sure. [jc: with help from Stephan Beyer on http-push tests I do not run myself; credits for locating silly quoting errors go to Olivier Marin.] Signed-off-by: Junio C Hamano --- t/t4011-diff-symlink.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 't/t4011-diff-symlink.sh') diff --git a/t/t4011-diff-symlink.sh b/t/t4011-diff-symlink.sh index c6d13693ba..02efecae3a 100755 --- a/t/t4011-diff-symlink.sh +++ b/t/t4011-diff-symlink.sh @@ -7,7 +7,7 @@ test_description='Test diff of symlinks. ' . ./test-lib.sh -. ../diff-lib.sh +. "$TEST_DIRECTORY"/diff-lib.sh cat > expected << EOF diff --git a/frotz b/frotz -- cgit v1.2.3 From 418566b6fdcc0eb1b5549d0742366aa13a7ff277 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 29 Jan 2009 17:30:51 +0100 Subject: Fix 'git diff --no-index' with a non-existing symlink target When trying to find out mode changes, we should not access the symlink targets using stat(); instead we use lstat() so that the diff does not fail trying to find a non-existing symlink target. Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- t/t4011-diff-symlink.sh | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 't/t4011-diff-symlink.sh') diff --git a/t/t4011-diff-symlink.sh b/t/t4011-diff-symlink.sh index 02efecae3a..9055c8b318 100755 --- a/t/t4011-diff-symlink.sh +++ b/t/t4011-diff-symlink.sh @@ -82,4 +82,11 @@ test_expect_success \ git diff-index -M -p $tree > current && compare_diff_patch current expected' +test_expect_success \ + 'diff symlinks with non-existing targets' \ + 'ln -s narf pinky && + ln -s take\ over brain && + test_must_fail git diff --no-index pinky brain > output 2> output.err && + grep narf output && + ! grep error output.err' test_done -- cgit v1.2.3 From 704a3143d5ba0709727430154ef3dad600aad4de Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Wed, 4 Mar 2009 22:38:24 +0100 Subject: Use prerequisite tags to skip tests that depend on symbolic links Many tests depend on that symbolic links work. This introduces a check that sets the prerequisite tag SYMLINKS if the file system supports symbolic links. Since so many tests have to check for this prerequisite, we do the check in test-lib.sh, so that we don't need to repeat the test in many scripts. To check for 'ln -s' failures, you can use a FAT partition on Linux: $ mkdosfs -C git-on-fat 1000000 $ sudo mount -o loop,uid=j6t,gid=users,shortname=winnt git-on-fat /mnt Clone git to /mnt and $ GIT_SKIP_TESTS='t0001.1[34] t0010 t1301 t403[34] t4129.[47] t5701.7 t7701.3 t9100 t9101.26 t9119 t9124.[67] t9200.10 t9600.6' \ make test (These additionally skipped tests depend on POSIX permissions that FAT on Linux does not provide.) Signed-off-by: Johannes Sixt --- t/t4011-diff-symlink.sh | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 't/t4011-diff-symlink.sh') diff --git a/t/t4011-diff-symlink.sh b/t/t4011-diff-symlink.sh index 9055c8b318..3a81309967 100755 --- a/t/t4011-diff-symlink.sh +++ b/t/t4011-diff-symlink.sh @@ -9,6 +9,13 @@ test_description='Test diff of symlinks. . ./test-lib.sh . "$TEST_DIRECTORY"/diff-lib.sh +if ! test_have_prereq SYMLINKS +then + say 'Symbolic links not supported, skipping tests.' + test_done + exit +fi + cat > expected << EOF diff --git a/frotz b/frotz new file mode 120000 -- cgit v1.2.3 From 5dba35912474770d0df45ed801d78c4c9ed5e949 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Fri, 3 Apr 2009 15:31:10 -0400 Subject: tests: remove exit after test_done call test_done always exits, so this line is never executed. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- t/t4011-diff-symlink.sh | 1 - 1 file changed, 1 deletion(-) (limited to 't/t4011-diff-symlink.sh') diff --git a/t/t4011-diff-symlink.sh b/t/t4011-diff-symlink.sh index 3a81309967..d7e327cc5b 100755 --- a/t/t4011-diff-symlink.sh +++ b/t/t4011-diff-symlink.sh @@ -13,7 +13,6 @@ if ! test_have_prereq SYMLINKS then say 'Symbolic links not supported, skipping tests.' test_done - exit fi cat > expected << EOF -- cgit v1.2.3