tests: implicitly skip SYMLINKS tests using <prereq>
Change the tests that skipped due to unavailable SYMLINKS support to
use the three-arg prereq form of test_expect_success.
Now we get an indication of how many tests that need symlinks are
being skipped on platforms that don't support them.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Ævar Arnfjörð Bjarmason15 years agocommitted byJunio C Hamano
@ -6,13 +6,7 @@ test_description='git checkout to switch between branches with symlink<->dir'
@@ -6,13 +6,7 @@ test_description='git checkout to switch between branches with symlink<->dir'
. ./test-lib.sh
if ! test_have_prereq SYMLINKS
then
skip_all="symbolic links not supported - skipping tests"
test_expect_success 'cross renames to be detected for regular files' '
test_expect_success SYMLINKS 'cross renames to be detected for regular files' '
git diff-tree five six -r --name-status -B -M | sort >actual &&
{
@ -67,7 +61,7 @@ test_expect_success 'cross renames to be detected for regular files' '
@@ -67,7 +61,7 @@ test_expect_success 'cross renames to be detected for regular files' '
'
test_expect_success 'cross renames to be detected for typechange' '
test_expect_success SYMLINKS 'cross renames to be detected for typechange' '
git diff-tree one two -r --name-status -B -M | sort >actual &&
{
@ -78,7 +72,7 @@ test_expect_success 'cross renames to be detected for typechange' '
@@ -78,7 +72,7 @@ test_expect_success 'cross renames to be detected for typechange' '
'
test_expect_success 'moves and renames' '
test_expect_success SYMLINKS 'moves and renames' '
git diff-tree three four -r --name-status -B -M | sort >actual &&
@ -9,13 +9,7 @@ test_description='git apply should not get confused with type changes.
@@ -9,13 +9,7 @@ test_description='git apply should not get confused with type changes.
. ./test-lib.sh
if ! test_have_prereq SYMLINKS
then
skip_all='Symbolic links not supported, skipping tests.'
test_done
fi
test_expect_success 'setup repository and commits' '
test_expect_success SYMLINKS 'setup repository and commits' '
echo "hello world" > foo &&
echo "hi planet" > bar &&
git update-index --add foo bar &&
@ -48,7 +42,7 @@ test_expect_success 'setup repository and commits' '
@@ -48,7 +42,7 @@ test_expect_success 'setup repository and commits' '
git branch foo-baz-renamed-from-foo
'
test_expect_success 'file renamed from foo to foo/baz' '
test_expect_success SYMLINKS 'file renamed from foo to foo/baz' '
git checkout -f initial &&
git diff-tree -M -p HEAD foo-baz-renamed-from-foo > patch &&
git apply --index < patch
@ -56,7 +50,7 @@ test_expect_success 'file renamed from foo to foo/baz' '
@@ -56,7 +50,7 @@ test_expect_success 'file renamed from foo to foo/baz' '
test_debug 'cat patch'
test_expect_success 'file renamed from foo/baz to foo' '
test_expect_success SYMLINKS 'file renamed from foo/baz to foo' '
git checkout -f foo-baz-renamed-from-foo &&
git diff-tree -M -p HEAD initial > patch &&
git apply --index < patch
@ -64,7 +58,7 @@ test_expect_success 'file renamed from foo/baz to foo' '
@@ -64,7 +58,7 @@ test_expect_success 'file renamed from foo/baz to foo' '
test_description='merging when a directory was replaced with a symlink'
. ./test-lib.sh
if ! test_have_prereq SYMLINKS
then
skip_all='Symbolic links not supported, skipping tests.'
test_done
fi
test_expect_success 'create a commit where dir a/b changed to symlink' '
test_expect_success SYMLINKS 'create a commit where dir a/b changed to symlink' '
mkdir -p a/b/c a/b-2/c &&
> a/b/c/d &&
> a/b-2/c/d &&
@ -23,7 +17,7 @@ test_expect_success 'create a commit where dir a/b changed to symlink' '
@@ -23,7 +17,7 @@ test_expect_success 'create a commit where dir a/b changed to symlink' '
git commit -m "dir to symlink"
'
test_expect_success 'keep a/b-2/c/d across checkout' '
test_expect_success SYMLINKS 'keep a/b-2/c/d across checkout' '
git checkout HEAD^0 &&
git reset --hard master &&
git rm --cached a/b &&
@ -32,14 +26,14 @@ test_expect_success 'keep a/b-2/c/d across checkout' '
@@ -32,14 +26,14 @@ test_expect_success 'keep a/b-2/c/d across checkout' '
test -f a/b-2/c/d
'
test_expect_success 'checkout should not have deleted a/b-2/c/d' '
test_expect_success SYMLINKS 'checkout should not have deleted a/b-2/c/d' '
git checkout HEAD^0 &&
git reset --hard master &&
git checkout start^0 &&
test -f a/b-2/c/d
'
test_expect_success 'setup for merge test' '
test_expect_success SYMLINKS 'setup for merge test' '
git reset --hard &&
test -f a/b-2/c/d &&
echo x > a/x &&
@ -48,7 +42,7 @@ test_expect_success 'setup for merge test' '
@@ -48,7 +42,7 @@ test_expect_success 'setup for merge test' '
git tag baseline
'
test_expect_success 'do not lose a/b-2/c/d in merge (resolve)' '
test_expect_success SYMLINKS 'do not lose a/b-2/c/d in merge (resolve)' '
git reset --hard &&
git checkout baseline^0 &&
git merge -s resolve master &&
@ -64,7 +58,7 @@ test_expect_failure 'do not lose a/b-2/c/d in merge (recursive)' '
@@ -64,7 +58,7 @@ test_expect_failure 'do not lose a/b-2/c/d in merge (recursive)' '
test -f a/b-2/c/d
'
test_expect_success 'setup a merge where dir a/b-2 changed to symlink' '
test_expect_success SYMLINKS 'setup a merge where dir a/b-2 changed to symlink' '
git reset --hard &&
git checkout start^0 &&
rm -rf a/b-2 &&
@ -74,7 +68,7 @@ test_expect_success 'setup a merge where dir a/b-2 changed to symlink' '
@@ -74,7 +68,7 @@ test_expect_success 'setup a merge where dir a/b-2 changed to symlink' '
git tag test2
'
test_expect_success 'merge should not have conflicts (resolve)' '
test_expect_success SYMLINKS 'merge should not have conflicts (resolve)' '