TEST_CREATE_REPO_NO_TEMPLATE=1
. ./test-lib.sh
+if ! test_have_prereq PERL_TEST_HELPERS
+then
+ skip_all='skipping ignores tests; Perl not available'
+ test_done
+fi
+
init_vars () {
global_excludes="global-excludes"
}
)
'
-test_expect_success 'required process filter should process multiple packets' '
+test_expect_success PERL_TEST_HELPERS 'required process filter should process multiple packets' '
test_config_global filter.protocol.process "test-tool rot13-filter --log=debug.log clean smudge" &&
test_config_global filter.protocol.required true &&
)
'
-test_expect_success 'required process filter with clean error should fail' '
+test_expect_success PERL_TEST_HELPERS 'required process filter with clean error should fail' '
test_config_global filter.protocol.process "test-tool rot13-filter --log=debug.log clean smudge" &&
test_config_global filter.protocol.required true &&
rm -rf repo &&
. ./test-lib.sh
+if ! test_have_prereq PERL_TEST_HELPERS
+then
+ skip_all='skipping trace2 tests; Perl not available'
+ test_done
+fi
+
# Turn off any inherited trace2 settings for this test.
sane_unset GIT_TRACE2 GIT_TRACE2_PERF GIT_TRACE2_EVENT
sane_unset GIT_TRACE2_BRIEF
. ./test-lib.sh
+if ! test_have_prereq PERL_TEST_HELPERS
+then
+ skip_all='skipping trace2 tests; Perl not available'
+ test_done
+fi
+
# Turn off any inherited trace2 settings for this test.
sane_unset GIT_TRACE2 GIT_TRACE2_PERF GIT_TRACE2_EVENT
sane_unset GIT_TRACE2_PERF_BRIEF
test_cmp actual expect
'
-test_expect_success 'basic: can write large commit message' '
+test_expect_success PERL_TEST_HELPERS 'basic: can write large commit message' '
test_when_finished "rm -rf repo" &&
git init repo &&
perl -e "
)
'
-test_expect_success 'small block size fails with large reflog message' '
+test_expect_success PERL_TEST_HELPERS 'small block size fails with large reflog message' '
test_when_finished "rm -rf repo" &&
git init repo &&
(
' "$@"
}
-test_expect_success 'cat-file --batch-all-objects --batch ignores replace' '
+test_expect_success PERL_TEST_HELPERS 'cat-file --batch-all-objects --batch ignores replace' '
git cat-file --batch-all-objects --batch >actual.raw &&
extract_batch_output $orig <actual.raw >actual &&
{
grep "too-short tree object" err
'
-test_expect_success 'malformed mode in tree' '
+test_expect_success PERL_TEST_HELPERS 'malformed mode in tree' '
hex_oid=$(echo foo | git hash-object --stdin -w) &&
bin_oid=$(echo $hex_oid | hex2oct) &&
printf "9100644 \0$bin_oid" >tree-with-malformed-mode &&
grep "malformed mode in tree entry" err
'
-test_expect_success 'empty filename in tree' '
+test_expect_success PERL_TEST_HELPERS 'empty filename in tree' '
hex_oid=$(echo foo | git hash-object --stdin -w) &&
bin_oid=$(echo $hex_oid | hex2oct) &&
printf "100644 \0$bin_oid" >tree-with-empty-filename &&
grep "empty filename in tree entry" err
'
-test_expect_success 'duplicate filename in tree' '
+test_expect_success PERL_TEST_HELPERS 'duplicate filename in tree' '
hex_oid=$(echo foo | git hash-object --stdin -w) &&
bin_oid=$(echo $hex_oid | hex2oct) &&
{
test_cmp tree.withsub actual
'
-test_expect_success 'ls-tree output in wrong order given to mktree (1)' '
+test_expect_success PERL_TEST_HELPERS 'ls-tree output in wrong order given to mktree (1)' '
perl -e "print reverse <>" <top |
git mktree >actual &&
test_cmp tree actual
'
-test_expect_success 'ls-tree output in wrong order given to mktree (2)' '
+test_expect_success PERL_TEST_HELPERS 'ls-tree output in wrong order given to mktree (2)' '
perl -e "print reverse <>" <top.withsub |
git mktree >actual &&
test_cmp tree.withsub actual
test_grep ! "fatal: empty filename in tree entry" out
'
-test_expect_success 'tree entry with type mismatch' '
+test_expect_success PERL_TEST_HELPERS 'tree entry with type mismatch' '
test_when_finished "remove_object \$blob" &&
test_when_finished "remove_object \$tree" &&
test_when_finished "remove_object \$commit" &&
test_grep ! "dangling blob" out
'
-test_expect_success 'tree entry with bogus mode' '
+test_expect_success PERL_TEST_HELPERS 'tree entry with bogus mode' '
test_when_finished "remove_object \$blob" &&
test_when_finished "remove_object \$tree" &&
blob=$(echo blob | git hash-object -w --stdin) &&
# Corrupt the checksum on the index and then
# verify that only fsck notices.
-test_expect_success 'detect corrupt index file in fsck' '
+test_expect_success PERL_TEST_HELPERS 'detect corrupt index file in fsck' '
cp .git/index .git/index.backup &&
test_when_finished "mv .git/index.backup .git/index" &&
corrupt_index_checksum &&
test_cmp expected current
'
-test_expect_success 'ls-files -z does not quote funny filename' '
+test_expect_success PERL_TEST_HELPERS 'ls-files -z does not quote funny filename' '
cat >expected <<-\EOF &&
just space
no-funny
test_cmp expected current
'
-test_expect_success 'diff-index -z does not quote funny filename' '
+test_expect_success PERL_TEST_HELPERS 'diff-index -z does not quote funny filename' '
cat >expected <<-\EOF &&
A
tabs ," (dq) and spaces
test_cmp expected current
'
-test_expect_success 'diff-tree -z does not quote funny filename' '
+test_expect_success PERL_TEST_HELPERS 'diff-tree -z does not quote funny filename' '
cat >expected <<-\EOF &&
A
tabs ," (dq) and spaces
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-diff.sh
+if ! test_have_prereq PERL_TEST_HELPERS
+then
+ skip_all='skipping diff various tests; Perl not available'
+ test_done
+fi
+
test_expect_success setup '
GIT_AUTHOR_DATE="2006-06-26 00:00:00 +0000" &&
---
EOF
-test_expect_success 'no threading' '
+test_expect_success PERL_TEST_HELPERS 'no threading' '
git checkout side &&
check_threading expect.no-threading main
'
References: <0>
EOF
-test_expect_success 'thread' '
+test_expect_success PERL_TEST_HELPERS 'thread' '
check_threading expect.thread --thread main
'
-test_expect_success '--thread overrides format.thread=deep' '
+test_expect_success PERL_TEST_HELPERS '--thread overrides format.thread=deep' '
test_config format.thread deep &&
check_threading expect.thread --thread main
'
References: <1>
EOF
-test_expect_success 'thread in-reply-to' '
+test_expect_success PERL_TEST_HELPERS 'thread in-reply-to' '
check_threading expect.in-reply-to --in-reply-to="<test.message>" \
--thread main
'
References: <0>
EOF
-test_expect_success 'thread cover-letter' '
+test_expect_success PERL_TEST_HELPERS 'thread cover-letter' '
check_threading expect.cover-letter --cover-letter --thread main
'
<0>
EOF
-test_expect_success 'thread cover-letter in-reply-to' '
+test_expect_success PERL_TEST_HELPERS 'thread cover-letter in-reply-to' '
check_threading expect.cl-irt --cover-letter \
--in-reply-to="<test.message>" --thread main
'
-test_expect_success 'thread explicit shallow' '
+test_expect_success PERL_TEST_HELPERS 'thread explicit shallow' '
check_threading expect.cl-irt --cover-letter \
--in-reply-to="<test.message>" --thread=shallow main
'
<1>
EOF
-test_expect_success 'thread deep' '
+test_expect_success PERL_TEST_HELPERS 'thread deep' '
check_threading expect.deep --thread=deep main
'
<2>
EOF
-test_expect_success 'thread deep in-reply-to' '
+test_expect_success PERL_TEST_HELPERS 'thread deep in-reply-to' '
check_threading expect.deep-irt --thread=deep \
--in-reply-to="<test.message>" main
'
<2>
EOF
-test_expect_success 'thread deep cover-letter' '
+test_expect_success PERL_TEST_HELPERS 'thread deep cover-letter' '
check_threading expect.deep-cl --cover-letter --thread=deep main
'
<3>
EOF
-test_expect_success 'thread deep cover-letter in-reply-to' '
+test_expect_success PERL_TEST_HELPERS 'thread deep cover-letter in-reply-to' '
check_threading expect.deep-cl-irt --cover-letter \
--in-reply-to="<test.message>" --thread=deep main
'
-test_expect_success 'thread via config' '
+test_expect_success PERL_TEST_HELPERS 'thread via config' '
test_config format.thread true &&
check_threading expect.thread main
'
-test_expect_success 'thread deep via config' '
+test_expect_success PERL_TEST_HELPERS 'thread deep via config' '
test_config format.thread deep &&
check_threading expect.deep main
'
-test_expect_success 'thread config + override' '
+test_expect_success PERL_TEST_HELPERS 'thread config + override' '
test_config format.thread deep &&
check_threading expect.thread --thread main
'
-test_expect_success 'thread config + --no-thread' '
+test_expect_success PERL_TEST_HELPERS 'thread config + --no-thread' '
test_config format.thread deep &&
check_threading expect.no-threading --no-thread main
'
echo NULZbetweenZwords | perl -pe 'y/Z/\000/' > file
-test_expect_success 'force diff with "diff"' '
+test_expect_success PERL_TEST_HELPERS 'force diff with "diff"' '
after=$(git hash-object file) &&
after=$(git rev-parse --short $after) &&
echo >.gitattributes "file diff" &&
test $(wc -l <crlfed.txt) = $(keep_only_cr <crlfed.txt | wc -c)
'
-test_expect_success 'diff --cached' '
+test_expect_success PERL_TEST_HELPERS 'diff --cached' '
test_config core.autocrlf true &&
git add file &&
git update-index --assume-unchanged file &&
EOF
exit 1
-test_expect_success "$test_description" '
+test_expect_success PERL_TEST_HELPERS "$test_description" '
printf "\nx\n" > f &&
before=$(git hash-object f) &&
before=$(git rev-parse --short $before) &&
. ./test-lib.sh
+if ! test_have_prereq PERL_TEST_HELPERS
+then
+ skip_all='skipping diff textconv tests; Perl not available'
+ test_done
+fi
+
find_diff() {
sed '1,/^index /d' | sed '/^-- $/,$d'
}
git config diff.foo.textconv "\"$(pwd)\""/dump
'
-test_expect_success 'rewrite diff respects textconv' '
+test_expect_success PERL_TEST_HELPERS 'rewrite diff respects textconv' '
git diff -B >diff &&
grep "dissimilarity index" diff &&
grep "^-61" diff &&
. ./test-lib.sh
+if ! test_have_prereq PERL_TEST_HELPERS
+then
+ skip_all='skipping diff duplicates tests; Perl not available'
+ test_done
+fi
+
# make_tree_entry <mode> <mode> <sha1>
#
# We have to rely on perl here because not all printfs understand
. ./test-lib.sh
+if ! test_have_prereq PERL_TEST_HELPERS
+then
+ skip_all='skipping apply-binary tests; Perl not available'
+ test_done
+fi
+
test_expect_success 'setup' '
cat >file1 <<-\EOF &&
A quick brown fox jumps over the lazy dog.
. ./test-lib.sh
+if ! test_have_prereq PERL_TEST_HELPERS
+then
+ skip_all='skipping apply reverse tests; Perl not available'
+ test_done
+fi
+
test_expect_success setup '
test_write_lines a b c d e f g h i j k l m n >file1 &&
test_cmp msg out
'
-test_expect_success 'am works with multi-line in-body headers' '
+test_expect_success PERL_TEST_HELPERS 'am works with multi-line in-body headers' '
FORTY="String that has a length of more than forty characters" &&
LONG="$FORTY $FORTY" &&
rm -fr .git/rebase-apply &&
. ./test-lib.sh
+if ! test_have_prereq PERL_TEST_HELPERS
+then
+ skip_all='skipping rerere tests; Perl not available'
+ test_done
+fi
+
test_expect_success 'setup' '
cat >a1 <<-\EOF &&
Some title
test_cmp expect actual
'
-test_expect_success '%(trailers:unfold) unfolds trailers' '
+test_expect_success PERL_TEST_HELPERS '%(trailers:unfold) unfolds trailers' '
git log --no-walk --pretty="%(trailers:unfold)" >actual &&
{
unfold <trailers &&
test_cmp expect actual
'
-test_expect_success ':only and :unfold work together' '
+test_expect_success PERL_TEST_HELPERS ':only and :unfold work together' '
git log --no-walk --pretty="%(trailers:only,unfold)" >actual &&
git log --no-walk --pretty="%(trailers:unfold,only)" >reverse &&
test_cmp actual reverse &&
test_cmp expect actual
'
-test_expect_success '%(trailers:key=foo,unfold) properly unfolds' '
+test_expect_success PERL_TEST_HELPERS '%(trailers:key=foo,unfold) properly unfolds' '
git log --no-walk --pretty="format:%(trailers:key=Signed-Off-by,unfold)" >actual &&
unfold <trailers | grep Signed-off-by >expect &&
test_cmp expect actual
test_cmp expect.out out
}
-test_expect_success 'Bloom reader notices too-small data chunk' '
+test_expect_success PERL_TEST_HELPERS 'Bloom reader notices too-small data chunk' '
check_corrupt_graph BDAT clear 00000000 &&
echo "warning: ignoring too-small changed-path chunk" \
"(4 < 12) in commit-graph file" >expect.err &&
test_cmp expect.err err
'
-test_expect_success 'Bloom reader notices out-of-bounds filter offsets' '
+test_expect_success PERL_TEST_HELPERS 'Bloom reader notices out-of-bounds filter offsets' '
check_corrupt_graph BIDX 12 FFFFFFFF &&
# use grep to avoid depending on exact chunk size
grep "warning: ignoring out-of-range offset (4294967295) for changed-path filter at pos 3 of .git/objects/info/commit-graph" err
'
-test_expect_success 'Bloom reader notices too-small index chunk' '
+test_expect_success PERL_TEST_HELPERS 'Bloom reader notices too-small index chunk' '
# replace the index with a single entry, making most
# lookups out-of-bounds
check_corrupt_graph BIDX clear 00000000 &&
test_cmp expect.err err
'
-test_expect_success 'Bloom reader notices out-of-order index offsets' '
+test_expect_success PERL_TEST_HELPERS 'Bloom reader notices out-of-order index offsets' '
# we do not know any real offsets, but we can pick
# something plausible; we should not get to the point of
# actually reading from the bogus offsets anyway.
. ./test-lib.sh
+if ! test_have_prereq PERL_TEST_HELPERS
+then
+ skip_all='skipping archive corner cases tests; Perl not available'
+ test_done
+fi
+
# the 10knuls.tar file is used to test for an empty git generated tar
# without having to invoke tar because an otherwise valid empty GNU tar
# will be considered broken by {Open,Net}BSD tar
. ./test-lib.sh
+if ! test_have_prereq PERL_TEST_HELPERS
+then
+ skip_all='skipping pack-object tests; Perl not available'
+ test_done
+fi
+
test_expect_success 'setup' '
rm -f .git/index* &&
perl -e "print \"a\" x 4096;" >a &&
git cat-file blob $blob_3 > /dev/null
'
-test_expect_success 'create corruption in data of first object' '
+test_expect_success PERL_TEST_HELPERS 'create corruption in data of first object' '
create_new_pack &&
git prune-packed &&
chmod +w ${pack}.pack &&
git cat-file blob $blob_3 > /dev/null
'
-test_expect_success 'create corruption in data of first delta' '
+test_expect_success PERL_TEST_HELPERS 'create corruption in data of first delta' '
create_new_pack &&
git prune-packed &&
chmod +w ${pack}.pack &&
)
'
- test_expect_success 'pack.preferBitmapTips' '
+ test_expect_success PERL_TEST_HELPERS 'pack.preferBitmapTips' '
git init repo &&
test_when_finished "rm -fr repo" &&
(
# packing heuristics. We double-check that our test case
# actually produces a long chain. If it doesn't, it should be
# adjusted (or scrapped if the heuristics have become too unreliable)
-test_expect_success 'packing produces a long delta' '
+test_expect_success PERL_TEST_HELPERS 'packing produces a long delta' '
# Use --window=0 to make sure we are seeing reused deltas,
# not computing a new long chain.
pack=$(git pack-objects --all --window=0 </dev/null pack) &&
test_cmp expect actual
'
-test_expect_success '--depth limits depth' '
+test_expect_success PERL_TEST_HELPERS '--depth limits depth' '
pack=$(git pack-objects --all --depth=5 </dev/null pack) &&
echo 5 >expect &&
max_chain pack-$pack.pack >actual &&
test_cmp expect actual
'
-test_expect_success '--depth=0 disables deltas' '
+test_expect_success PERL_TEST_HELPERS '--depth=0 disables deltas' '
pack=$(git pack-objects --all --depth=0 </dev/null pack) &&
echo 0 >expect &&
max_chain pack-$pack.pack >actual &&
test_cmp expect actual
'
-test_expect_success 'negative depth disables deltas' '
+test_expect_success PERL_TEST_HELPERS 'negative depth disables deltas' '
pack=$(git pack-objects --all --depth=-1 </dev/null pack) &&
echo 0 >expect &&
max_chain pack-$pack.pack >actual &&
test_cmp expect.out out
}
-test_expect_success 'reader notices too-small oid fanout chunk' '
+test_expect_success PERL_TEST_HELPERS 'reader notices too-small oid fanout chunk' '
# make it big enough that the graph file is plausible,
# otherwise we hit an earlier check
check_corrupt_chunk OIDF clear $(printf "000000%02x" $(test_seq 250)) &&
test_cmp expect.err err
'
-test_expect_success 'reader notices fanout/lookup table mismatch' '
+test_expect_success PERL_TEST_HELPERS 'reader notices fanout/lookup table mismatch' '
check_corrupt_chunk OIDF 1020 "FFFFFFFF" &&
cat >expect.err <<-\EOF &&
error: commit-graph OID lookup chunk is the wrong size
test_cmp expect.err err
'
-test_expect_success 'reader notices out-of-bounds fanout' '
+test_expect_success PERL_TEST_HELPERS 'reader notices out-of-bounds fanout' '
# Rather than try to corrupt a specific hash, we will just
# wreck them all. But we cannot just set them all to 0xFFFFFFFF or
# similar, as they are used for hi/lo starts in a binary search (so if
test_cmp expect.err err
'
-test_expect_success 'reader notices too-small commit data chunk' '
+test_expect_success PERL_TEST_HELPERS 'reader notices too-small commit data chunk' '
check_corrupt_chunk CDAT clear 00000000 &&
cat >expect.err <<-\EOF &&
error: commit-graph commit data chunk is wrong size
test_cmp expect.err err
'
-test_expect_success 'reader notices out-of-bounds extra edge' '
+test_expect_success PERL_TEST_HELPERS 'reader notices out-of-bounds extra edge' '
check_corrupt_chunk EDGE clear &&
cat >expect.err <<-\EOF &&
error: commit-graph extra-edges pointer out of bounds
test_cmp expect.err err
'
-test_expect_success 'reader notices too-small generations chunk' '
+test_expect_success PERL_TEST_HELPERS 'reader notices too-small generations chunk' '
check_corrupt_chunk GDA2 clear 00000000 &&
cat >expect.err <<-\EOF &&
error: commit-graph generations chunk is wrong size
corrupt_chunk_file $midx "$@"
}
-test_expect_success 'reader notices too-small oid fanout chunk' '
+test_expect_success PERL_TEST_HELPERS 'reader notices too-small oid fanout chunk' '
corrupt_chunk OIDF clear 00000000 &&
test_must_fail git log 2>err &&
cat >expect <<-\EOF &&
test_cmp expect err
'
-test_expect_success 'reader notices too-small oid lookup chunk' '
+test_expect_success PERL_TEST_HELPERS 'reader notices too-small oid lookup chunk' '
corrupt_chunk OIDL clear 00000000 &&
test_must_fail git log 2>err &&
cat >expect <<-\EOF &&
test_cmp expect err
'
-test_expect_success 'reader notices too-small pack names chunk' '
+test_expect_success PERL_TEST_HELPERS 'reader notices too-small pack names chunk' '
# There is no NUL to terminate the name here, so the
# chunk is too short.
corrupt_chunk PNAM clear 70656666 &&
test_cmp expect err
'
-test_expect_success 'reader handles unaligned chunks' '
+test_expect_success PERL_TEST_HELPERS 'reader handles unaligned chunks' '
# A 9-byte PNAM means all of the subsequent chunks
# will no longer be 4-byte aligned, but it is still
# a valid one-pack chunk on its own (it is "foo.pack\0").
test_cmp expect.err err
'
-test_expect_success 'reader notices too-small object offset chunk' '
+test_expect_success PERL_TEST_HELPERS 'reader notices too-small object offset chunk' '
corrupt_chunk OOFF clear 00000000 &&
test_must_fail git log 2>err &&
cat >expect <<-\EOF &&
test_cmp expect err
'
-test_expect_success 'reader bounds-checks large offset table' '
+test_expect_success PERL_TEST_HELPERS 'reader bounds-checks large offset table' '
# re-use the objects64 dir here to cheaply get access to a midx
# with large offsets.
git init repo &&
)
'
-test_expect_success 'reader notices too-small revindex chunk' '
+test_expect_success PERL_TEST_HELPERS 'reader notices too-small revindex chunk' '
# We only get a revindex with bitmaps (and likewise only
# load it when they are asked for).
test_config repack.writeBitmaps true &&
test_cmp expect.err err
'
-test_expect_success 'reader notices out-of-bounds fanout' '
+test_expect_success PERL_TEST_HELPERS 'reader notices out-of-bounds fanout' '
# This is similar to the out-of-bounds fanout test in t5318. The values
# in adjacent entries should be large but not identical (they
# are used as hi/lo starts for a binary search, which would then abort
)
'
-test_expect_success 'reader bounds-checks base-graph chunk' '
+test_expect_success PERL_TEST_HELPERS 'reader bounds-checks base-graph chunk' '
git clone --no-hardlinks . corrupt-base-chunk &&
(
cd corrupt-base-chunk &&
)
'
- test_expect_success 'pack.preferBitmapTips' '
+ test_expect_success PERL_TEST_HELPERS 'pack.preferBitmapTips' '
git init repo &&
test_when_finished "rm -fr repo" &&
(
git -C repo-uint32-max commit-graph verify
'
-test_expect_success 'reader notices out-of-bounds generation overflow' '
+test_expect_success PERL_TEST_HELPERS 'reader notices out-of-bounds generation overflow' '
graph=.git/objects/info/commit-graph &&
test_when_finished "rm -rf $graph" &&
git commit-graph write --reachable &&
. ./test-lib.sh
+if ! test_have_prereq PERL_TEST_HELPERS
+then
+ skip_all='skipping pseudo-merge bitmap tests; Perl not available'
+ test_done
+fi
+
test_pseudo_merges () {
test-tool bitmap dump-pseudo-merges
}
'
}
-test_expect_success 'receive-pack de-dupes .have lines' '
+test_expect_success PERL_TEST_HELPERS 'receive-pack de-dupes .have lines' '
git init shared &&
git -C shared commit --allow-empty -m both &&
git clone -s shared fork &&
depacketize | perl -lne '/^(\S+) \.have/ and print $1'
}
-test_expect_success 'with core.alternateRefsCommand' '
+test_expect_success PERL_TEST_HELPERS 'with core.alternateRefsCommand' '
write_script fork/alternate-refs <<-\EOF &&
git --git-dir="$1" for-each-ref \
--format="%(objectname)" \
test_cmp expect actual.haves
'
-test_expect_success 'with core.alternateRefsPrefixes' '
+test_expect_success PERL_TEST_HELPERS 'with core.alternateRefsPrefixes' '
test_config -C fork core.alternateRefsPrefixes "refs/heads/private" &&
git rev-parse private/branch >expect &&
printf "0000" | git receive-pack fork >actual &&
. ./test-lib.sh
+if ! test_have_prereq PERL_TEST_HELPERS
+then
+ skip_all='skipping tagfollow tests; Perl not available'
+ test_done
+fi
+
# End state of the repository:
#
# T - tag1 S - tag2
grep "Cannot demote unterminatedheader" act
'
-test_expect_success 'badFilemode is not a strict error' '
+test_expect_success PERL_TEST_HELPERS 'badFilemode is not a strict error' '
git init --bare badmode.git &&
tree=$(
cd badmode.git &&
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-bundle.sh
+if ! test_have_prereq PERL_TEST_HELPERS
+then
+ skip_all='skipping fetch tests; Perl not available'
+ test_done
+fi
+
D=$(pwd)
test_expect_success setup '
. ./test-lib.sh
+if ! test_have_prereq PERL_TEST_HELPERS
+then
+ skip_all='skipping fetch proxy tests; Perl not available'
+ test_done
+fi
+
test_expect_success 'setup remote repo' '
git init remote &&
(cd remote &&
test_cmp expect dst/push-cert-status
'
-test_expect_success GPG 'inconsistent push options in signed push not allowed' '
+test_expect_success GPG,PERL_TEST_HELPERS 'inconsistent push options in signed push not allowed' '
# First, invoke receive-pack with dummy input to obtain its preamble.
prepare_dst &&
git -C dst config receive.certnonceseed sekrit &&
REPO="$HTTPD_DOCUMENT_ROOT_PATH/repo"
-test_expect_success 'shallow fetches check connectivity before writing shallow file' '
+test_expect_success PERL_TEST_HELPERS 'shallow fetches check connectivity before writing shallow file' '
rm -rf "$REPO" client &&
git init "$REPO" &&
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-httpd.sh
+
+if ! test_have_prereq PERL_TEST_HELPERS
+then
+ skip_all='skipping http fetch smart tests; Perl not available'
+ test_done
+fi
+
test "$HTTP_PROTO" = "HTTP/2" && enable_http2
start_httpd
. ./test-lib.sh
+if ! test_have_prereq PERL_TEST_HELPERS
+then
+ skip_all='skipping http backend content tests; Perl not available'
+ test_done
+fi
+
test_lazy_prereq GZIP 'gzip --version'
verify_http_result() {
git -C replay.git index-pack -v --stdin <tmp.pack
'
-test_expect_success 'clone on case-insensitive fs' '
+test_expect_success PERL_TEST_HELPERS 'clone on case-insensitive fs' '
git init icasefs &&
(
cd icasefs &&
)
'
-test_expect_success CASE_INSENSITIVE_FS 'colliding file detection' '
+test_expect_success PERL_TEST_HELPERS,CASE_INSENSITIVE_FS 'colliding file detection' '
grep X icasefs/warning &&
grep x icasefs/warning &&
test_grep "the following paths have collided" icasefs/warning
}' >"$HTTPD_ROOT_PATH/one-time-perl"
}
-test_expect_success 'upon cloning, check that all refs point to objects' '
+test_expect_success PERL_TEST_HELPERS 'upon cloning, check that all refs point to objects' '
SERVER="$HTTPD_DOCUMENT_ROOT_PATH/server" &&
rm -rf "$SERVER" repo &&
test_create_repo "$SERVER" &&
! test -e "$HTTPD_ROOT_PATH/one-time-perl"
'
-test_expect_success 'when partial cloning, tolerate server not sending target of tag' '
+test_expect_success PERL_TEST_HELPERS 'when partial cloning, tolerate server not sending target of tag' '
SERVER="$HTTPD_DOCUMENT_ROOT_PATH/server" &&
rm -rf "$SERVER" repo &&
test_create_repo "$SERVER" &&
! test -e "$HTTPD_ROOT_PATH/one-time-perl"
'
-test_expect_success 'tolerate server sending REF_DELTA against missing promisor objects' '
+test_expect_success PERL_TEST_HELPERS 'tolerate server sending REF_DELTA against missing promisor objects' '
SERVER="$HTTPD_DOCUMENT_ROOT_PATH/server" &&
rm -rf "$SERVER" repo &&
test_create_repo "$SERVER" &&
test_cmp expect actual
'
-test_expect_success 'ignore very large set of prefixes' '
+test_expect_success PERL_TEST_HELPERS 'ignore very large set of prefixes' '
# generate a large number of ref-prefixes that we expect
# to match nothing; the value here exceeds TOO_MANY_PREFIXES
# from ls-refs.c.
! grep "git< version 2" log
'
-test_expect_success 'when server sends "ready", expect DELIM' '
+test_expect_success PERL_TEST_HELPERS 'when server sends "ready", expect DELIM' '
rm -rf "$HTTPD_DOCUMENT_ROOT_PATH/http_parent" http_child &&
git init "$HTTPD_DOCUMENT_ROOT_PATH/http_parent" &&
test_grep "expected packfile to be sent after .ready." err
'
-test_expect_success 'when server does not send "ready", expect FLUSH' '
+test_expect_success PERL_TEST_HELPERS 'when server does not send "ready", expect FLUSH' '
rm -rf "$HTTPD_DOCUMENT_ROOT_PATH/http_parent" http_child log &&
git init "$HTTPD_DOCUMENT_ROOT_PATH/http_parent" &&
grep "$COMMON" out
'
-test_expect_success 'http:// --negotiate-only without wait-for-done support' '
+test_expect_success PERL_TEST_HELPERS 'http:// --negotiate-only without wait-for-done support' '
SERVER="server" &&
URI="$HTTPD_URL/one_time_perl/server" &&
. ./test-lib.sh
+if ! test_have_prereq PERL_TEST_HELPERS
+then
+ skip_all='skipping upload-pack ref-in-want tests; Perl not available'
+ test_done
+fi
+
get_actual_refs () {
sed -n -e '/wanted-refs/,/0001/{
/wanted-refs/d
. ./test-lib.sh
+if ! test_have_prereq PERL_TEST_HELPERS
+then
+ skip_all='skipping promisor remote capabilities tests; Perl not available'
+ test_done
+fi
+
GIT_TEST_MULTI_PACK_INDEX=0
GIT_TEST_MULTI_PACK_INDEX_WRITE_INCREMENTAL=0
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-t6000.sh # t6xxx specific functions
+if ! test_have_prereq PERL_TEST_HELPERS
+then
+ skip_all='skipping rev-list bisect tests; Perl not available'
+ test_done
+fi
+
# usage: test_bisection max-diff bisect-option head ^prune...
#
# e.g. test_bisection 1 --bisect l1 ^l0
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-t6000.sh # t6xxx specific functions
+if ! test_have_prereq PERL_TEST_HELPERS
+then
+ skip_all='skipping rev-list topo-order tests; Perl not available'
+ test_done
+fi
+
list_duplicates()
{
"$@" | sort | uniq -d
. ./test-lib.sh
+if ! test_have_prereq PERL_TEST_HELPERS
+then
+ skip_all='skipping rev-list with bad commit tests; Perl not available'
+ test_done
+fi
+
# Note:
# - compression level is set to zero to make "corruptions" easier to perform
# - reflog is disabled to avoid extra references which would twart the test
commit five
'
-test_expect_success '--reverse --parents --full-history combines correctly' '
+test_expect_success PERL_TEST_HELPERS '--reverse --parents --full-history combines correctly' '
git rev-list --parents --full-history main -- foo |
perl -e "print reverse <>" > expected &&
git rev-list --reverse --parents --full-history main -- foo \
test_cmp expected actual
'
-test_expect_success '--boundary does too' '
+test_expect_success PERL_TEST_HELPERS '--boundary does too' '
git rev-list --boundary --parents --full-history main ^root -- foo |
perl -e "print reverse <>" > expected &&
git rev-list --boundary --reverse --parents --full-history \
. ./test-lib.sh
+if ! test_have_prereq PERL_TEST_HELPERS
+then
+ skip_all='skipping rev-list unexpected objects tests; Perl not available'
+ test_done
+fi
+
test_expect_success 'setup well-formed objects' '
blob="$(printf "foo" | git hash-object -w --stdin)" &&
tree="$(printf "100644 blob $blob\tfoo" | git mktree)" &&
. ./test-lib.sh
+if ! test_have_prereq PERL_TEST_HELPERS
+then
+ skip_all='skipping rev-list disk usage tests; Perl not available'
+ test_done
+fi
+
# we want a mix of reachable and unreachable, as well as
# objects in the bitmapped pack and some outside of it
test_expect_success 'set up repository' '
. "$TEST_DIRECTORY"/lib-gpg.sh
. "$TEST_DIRECTORY"/lib-terminal.sh
+if ! test_have_prereq PERL_TEST_HELPERS
+then
+ skip_all='skipping for-each-ref tests; Perl not available'
+ test_done
+fi
+
# Mon Jul 3 23:18:43 2006 +0000
datestamp=1151968723
setdate_and_increment () {
export GIT_TRACE2_BRIEF
'
-test_expect_success 'setup large log output' '
+test_expect_success PERL_TEST_HELPERS 'setup large log output' '
perl -e "
print \"this is a long commit message\" x 50000
" >commit-msg &&
. ./test-lib.sh
+if ! test_have_prereq PERL_TEST_HELPERS
+then
+ skip_all='skipping submodule dash URL tests; Perl not available'
+ test_done
+fi
+
test_expect_success 'setup' '
git config --global protocol.file.allow always
'
test_cmp expect output
'
-test_expect_success 'status -z implies porcelain' '
+test_expect_success PERL_TEST_HELPERS 'status -z implies porcelain' '
git status --porcelain |
perl -pe "s/\012/\000/g" >expect &&
git status -z >output &&
. ./test-lib.sh
+if ! test_have_prereq PERL_TEST_HELPERS
+then
+ skip_all='skipping grep binary tests; Perl not available'
+ test_done
+fi
+
test_expect_success 'setup' "
echo 'binaryQfileQm[*]cQ*æQð' | q_to_nul >a &&
git add a &&
TEST_CREATE_REPO_NO_TEMPLATE=1
. ./test-lib.sh
+if ! test_have_prereq PERL_TEST_HELPERS
+then
+ skip_all='skipping annotate tests; Perl not available'
+ test_done
+fi
+
PROG='git annotate'
. "$TEST_DIRECTORY"/annotate-tests.sh
TEST_CREATE_REPO_NO_TEMPLATE=1
. ./test-lib.sh
+if ! test_have_prereq PERL_TEST_HELPERS
+then
+ skip_all='skipping blame colors tests; Perl not available'
+ test_done
+fi
+
PROG='git blame -c'
. "$TEST_DIRECTORY"/annotate-tests.sh
. ./test-lib.sh
+if ! test_have_prereq PERL_TEST_HELPERS
+then
+ skip_all='skipping blame textconv tests; Perl not available'
+ test_done
+fi
+
find_blame() {
sed -e 's/^[^(]*//'
}
git blame --root -C --$output combined >output
'
- test_expect_success "$output output finds correct commits" '
+ test_expect_success PERL_TEST_HELPERS "$output output finds correct commits" '
generate_expect >expect <<-\EOF &&
5 base
1 modified
test_cmp expect actual
'
- test_expect_success "$output output shows correct filenames" '
+ test_expect_success PERL_TEST_HELPERS "$output output shows correct filenames" '
generate_expect >expect <<-\EOF &&
11 one
11 two
test_cmp expect actual
'
- test_expect_success "$output output shows correct previous pointer" '
+ test_expect_success PERL_TEST_HELPERS "$output output shows correct previous pointer" '
generate_expect >expect <<-EOF &&
5 NONE
1 $(git rev-parse modified^) one
TEST_CREATE_REPO_NO_TEMPLATE=1
. ./test-lib.sh
+if ! test_have_prereq PERL_TEST_HELPERS
+then
+ skip_all='skipping blame colors tests; Perl not available'
+ test_done
+fi
+
PROG='git blame -c'
. "$TEST_DIRECTORY"/annotate-tests.sh
test -e file
'
-test_expect_success '(supposedly) non-conflicting change from SVN' '
+test_expect_success PERL_TEST_HELPERS '(supposedly) non-conflicting change from SVN' '
test x"$(sed -n -e 58p < file)" = x58 &&
test x"$(sed -n -e 61p < file)" = x61 &&
svn_cmd co "$svnrepo" tmp &&
git commit -m bye-life life
"
-test_expect_success 'change file but in unrelated area' "
+test_expect_success PERL_TEST_HELPERS 'change file but in unrelated area' "
test x\"\$(sed -n -e 4p < file)\" = x4 &&
test x\"\$(sed -n -e 7p < file)\" = x7 &&
perl -i.bak -p -e 's/^4\$/4444/' file &&
(cd result && git show main:foo)
'
-test_expect_success 'fast-export quotes pathnames' '
+test_expect_success PERL_TEST_HELPERS 'fast-export quotes pathnames' '
git init crazy-paths &&
test_config -C crazy-paths core.protectNTFS false &&
(cd crazy-paths &&
test_cmp expect actual
'
-test_expect_success 'shell complains of overlong commands' '
+test_expect_success PERL_TEST_HELPERS 'shell complains of overlong commands' '
perl -e "print \"a\" x 2**12 for (0..2**19)" |
test_must_fail git shell 2>err &&
grep "too long" err
test -z "$NO_GETTEXT" && test_set_prereq GETTEXT
test -n "$SANITIZE_LEAK" && test_set_prereq SANITIZE_LEAK
test -n "$GIT_VALGRIND_ENABLED" && test_set_prereq VALGRIND
+test -n "$PERL_PATH" && test_set_prereq PERL_TEST_HELPERS
if test -z "$GIT_TEST_CHECK_CACHE_TREE"
then