summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--t/.gitattributes4
-rw-r--r--t/README8
-rw-r--r--t/lib-bitmap.sh26
-rw-r--r--t/lib-bundle.sh (renamed from t/test-bundle-functions.sh)0
-rw-r--r--t/lib-diff.sh (renamed from t/diff-lib.sh)0
-rw-r--r--t/lib-diff/COPYING (renamed from t/diff-lib/COPYING)0
-rw-r--r--t/lib-diff/README (renamed from t/diff-lib/README)0
-rw-r--r--t/lib-gitweb.sh (renamed from t/gitweb-lib.sh)0
-rwxr-xr-xt/t2104-update-index-skip-worktree.sh5
-rwxr-xr-xt/t3404-rebase-interactive.sh3
-rwxr-xr-xt/t4000-diff-format.sh2
-rwxr-xr-xt/t4001-diff-rename.sh2
-rwxr-xr-xt/t4003-diff-rename-1.sh6
-rwxr-xr-xt/t4004-diff-rename-symlink.sh2
-rwxr-xr-xt/t4005-diff-rename-2.sh6
-rwxr-xr-xt/t4007-rename-3.sh6
-rwxr-xr-xt/t4008-diff-break-rewrite.sh6
-rwxr-xr-xt/t4009-diff-rename-4.sh6
-rwxr-xr-xt/t4010-diff-pathspec.sh2
-rwxr-xr-xt/t4011-diff-symlink.sh2
-rwxr-xr-xt/t4013-diff-various.sh2
-rwxr-xr-xt/t4015-diff-whitespace.sh2
-rwxr-xr-xt/t4027-diff-submodule.sh2
-rwxr-xr-xt/t4034-diff-words.sh2
-rwxr-xr-xt/t4038-diff-combined.sh2
-rwxr-xr-xt/t4061-diff-indent.sh2
-rwxr-xr-xt/t4206-log-follow-harder-copies.sh2
-rwxr-xr-xt/t5310-pack-bitmaps.sh2
-rwxr-xr-xt/t5318-commit-graph.sh2
-rwxr-xr-xt/t5510-fetch.sh2
-rwxr-xr-xt/t6020-bundle-misc.sh2
-rwxr-xr-xt/t6113-rev-list-bitmap-filters.sh1
-rwxr-xr-xt/t6426-merge-skip-unneeded-updates.sh16
-rwxr-xr-xt/t6500-gc.sh4
-rwxr-xr-xt/t7501-commit-basic-functionality.sh2
-rwxr-xr-xt/t9300-fast-import.sh2
-rwxr-xr-xt/t9500-gitweb-standalone-no-errors.sh2
-rwxr-xr-xt/t9501-gitweb-standalone-http-status.sh2
-rwxr-xr-xt/t9502-gitweb-standalone-parse-output.sh2
-rw-r--r--t/test-lib-functions.sh62
-rw-r--r--t/test-lib.sh30
41 files changed, 107 insertions, 124 deletions
diff --git a/t/.gitattributes b/t/.gitattributes
index df05434..dafa17c 100644
--- a/t/.gitattributes
+++ b/t/.gitattributes
@@ -1,13 +1,13 @@
t[0-9][0-9][0-9][0-9]/* -whitespace
/chainlint/*.expect eol=lf
-/diff-lib/* eol=lf
+/lib-diff/* eol=lf
/t0110/url-* binary
/t3206/* eol=lf
/t3900/*.txt eol=lf
/t3901/*.txt eol=lf
-/t4034/*/* eol=lf
/t4013/* eol=lf
/t4018/* eol=lf
+/t4034/*/* eol=lf
/t4051/* eol=lf
/t4100/* eol=lf
/t4101/* eol=lf
diff --git a/t/README b/t/README
index bc57006..593d4a4 100644
--- a/t/README
+++ b/t/README
@@ -917,13 +917,13 @@ library for your script to use.
Check whether a file has the length it is expected to.
- - test_path_is_file <path> [<diagnosis>]
- test_path_is_dir <path> [<diagnosis>]
- test_path_is_missing <path> [<diagnosis>]
+ - test_path_is_file <path>
+ test_path_is_dir <path>
+ test_path_is_missing <path>
Check if the named path is a file, if the named path is a
directory, or if the named path does not exist, respectively,
- and fail otherwise, showing the <diagnosis> text.
+ and fail otherwise.
- test_when_finished <script>
diff --git a/t/lib-bitmap.sh b/t/lib-bitmap.sh
new file mode 100644
index 0000000..fe3f98b
--- /dev/null
+++ b/t/lib-bitmap.sh
@@ -0,0 +1,26 @@
+# Compare a file containing rev-list bitmap traversal output to its non-bitmap
+# counterpart. You can't just use test_cmp for this, because the two produce
+# subtly different output:
+#
+# - regular output is in traversal order, whereas bitmap is split by type,
+# with non-packed objects at the end
+#
+# - regular output has a space and the pathname appended to non-commit
+# objects; bitmap output omits this
+#
+# This function normalizes and compares the two. The second file should
+# always be the bitmap output.
+test_bitmap_traversal () {
+ if test "$1" = "--no-confirm-bitmaps"
+ then
+ shift
+ elif cmp "$1" "$2"
+ then
+ echo >&2 "identical raw outputs; are you sure bitmaps were used?"
+ return 1
+ fi &&
+ cut -d' ' -f1 "$1" | sort >"$1.normalized" &&
+ sort "$2" >"$2.normalized" &&
+ test_cmp "$1.normalized" "$2.normalized" &&
+ rm -f "$1.normalized" "$2.normalized"
+}
diff --git a/t/test-bundle-functions.sh b/t/lib-bundle.sh
index cf7ed81..cf7ed81 100644
--- a/t/test-bundle-functions.sh
+++ b/t/lib-bundle.sh
diff --git a/t/diff-lib.sh b/t/lib-diff.sh
index 2de880f..2de880f 100644
--- a/t/diff-lib.sh
+++ b/t/lib-diff.sh
diff --git a/t/diff-lib/COPYING b/t/lib-diff/COPYING
index 6ff87c4..6ff87c4 100644
--- a/t/diff-lib/COPYING
+++ b/t/lib-diff/COPYING
diff --git a/t/diff-lib/README b/t/lib-diff/README
index 548142c..548142c 100644
--- a/t/diff-lib/README
+++ b/t/lib-diff/README
diff --git a/t/gitweb-lib.sh b/t/lib-gitweb.sh
index 1f32ca6..1f32ca6 100644
--- a/t/gitweb-lib.sh
+++ b/t/lib-gitweb.sh
diff --git a/t/t2104-update-index-skip-worktree.sh b/t/t2104-update-index-skip-worktree.sh
index 7e2e7dd..30666fc 100755
--- a/t/t2104-update-index-skip-worktree.sh
+++ b/t/t2104-update-index-skip-worktree.sh
@@ -9,6 +9,11 @@ test_description='skip-worktree bit test'
sane_unset GIT_TEST_SPLIT_INDEX
+test_set_index_version () {
+ GIT_INDEX_VERSION="$1"
+ export GIT_INDEX_VERSION
+}
+
test_set_index_version 3
cat >expect.full <<EOF
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index 1e738df..28c2d15 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -101,7 +101,8 @@ test_expect_success 'rebase -i with the exec command' '
) &&
test_path_is_file touch-one &&
test_path_is_file touch-two &&
- test_path_is_missing touch-three " (should have stopped before)" &&
+ # Missing because we should have stopped by now.
+ test_path_is_missing touch-three &&
test_cmp_rev C HEAD &&
git rebase --continue &&
test_path_is_file touch-three &&
diff --git a/t/t4000-diff-format.sh b/t/t4000-diff-format.sh
index e5116a7..cce3349 100755
--- a/t/t4000-diff-format.sh
+++ b/t/t4000-diff-format.sh
@@ -7,7 +7,7 @@ test_description='Test built-in diff output engine.
'
. ./test-lib.sh
-. "$TEST_DIRECTORY"/diff-lib.sh
+. "$TEST_DIRECTORY"/lib-diff.sh
echo >path0 'Line 1
Line 2
diff --git a/t/t4001-diff-rename.sh b/t/t4001-diff-rename.sh
index c16486a..2f97007 100755
--- a/t/t4001-diff-rename.sh
+++ b/t/t4001-diff-rename.sh
@@ -7,7 +7,7 @@ test_description='Test rename detection in diff engine.
'
. ./test-lib.sh
-. "$TEST_DIRECTORY"/diff-lib.sh
+. "$TEST_DIRECTORY"/lib-diff.sh
test_expect_success 'setup' '
cat >path0 <<-\EOF &&
diff --git a/t/t4003-diff-rename-1.sh b/t/t4003-diff-rename-1.sh
index df2accb..db07ff3 100755
--- a/t/t4003-diff-rename-1.sh
+++ b/t/t4003-diff-rename-1.sh
@@ -7,11 +7,11 @@ test_description='More rename detection
'
. ./test-lib.sh
-. "$TEST_DIRECTORY"/diff-lib.sh ;# test-lib chdir's into trash
+. "$TEST_DIRECTORY"/lib-diff.sh ;# test-lib chdir's into trash
test_expect_success \
'prepare reference tree' \
- 'cat "$TEST_DIRECTORY"/diff-lib/COPYING >COPYING &&
+ 'cat "$TEST_DIRECTORY"/lib-diff/COPYING >COPYING &&
echo frotz >rezrov &&
git update-index --add COPYING rezrov &&
tree=$(git write-tree) &&
@@ -99,7 +99,7 @@ test_expect_success \
test_expect_success \
'prepare work tree once again' \
- 'cat "$TEST_DIRECTORY"/diff-lib/COPYING >COPYING &&
+ 'cat "$TEST_DIRECTORY"/lib-diff/COPYING >COPYING &&
git update-index --add --remove COPYING COPYING.1'
# tree has COPYING and rezrov. work tree has COPYING and COPYING.1,
diff --git a/t/t4004-diff-rename-symlink.sh b/t/t4004-diff-rename-symlink.sh
index 6e562c8..3d495e3 100755
--- a/t/t4004-diff-rename-symlink.sh
+++ b/t/t4004-diff-rename-symlink.sh
@@ -10,7 +10,7 @@ copy of symbolic links, but should not produce rename/copy followed
by an edit for them.
'
. ./test-lib.sh
-. "$TEST_DIRECTORY"/diff-lib.sh
+. "$TEST_DIRECTORY"/lib-diff.sh
test_expect_success SYMLINKS \
'prepare reference tree' \
diff --git a/t/t4005-diff-rename-2.sh b/t/t4005-diff-rename-2.sh
index d18a804..8647906 100755
--- a/t/t4005-diff-rename-2.sh
+++ b/t/t4005-diff-rename-2.sh
@@ -6,10 +6,10 @@
test_description='Same rename detection as t4003 but testing diff-raw.'
. ./test-lib.sh
-. "$TEST_DIRECTORY"/diff-lib.sh ;# test-lib chdir's into trash
+. "$TEST_DIRECTORY"/lib-diff.sh ;# test-lib chdir's into trash
test_expect_success 'setup reference tree' '
- cat "$TEST_DIRECTORY"/diff-lib/COPYING >COPYING &&
+ cat "$TEST_DIRECTORY"/lib-diff/COPYING >COPYING &&
echo frotz >rezrov &&
git update-index --add COPYING rezrov &&
tree=$(git write-tree) &&
@@ -64,7 +64,7 @@ test_expect_success 'validate output from rename/copy detection (#2)' '
# nows how to say Copy.
test_expect_success 'validate output from rename/copy detection (#3)' '
- cat "$TEST_DIRECTORY"/diff-lib/COPYING >COPYING &&
+ cat "$TEST_DIRECTORY"/lib-diff/COPYING >COPYING &&
git update-index --add --remove COPYING COPYING.1 &&
cat <<-EOF >expected &&
diff --git a/t/t4007-rename-3.sh b/t/t4007-rename-3.sh
index b187b7f..cbb9c62 100755
--- a/t/t4007-rename-3.sh
+++ b/t/t4007-rename-3.sh
@@ -7,17 +7,17 @@ test_description='Rename interaction with pathspec.
'
. ./test-lib.sh
-. "$TEST_DIRECTORY"/diff-lib.sh ;# test-lib chdir's into trash
+. "$TEST_DIRECTORY"/lib-diff.sh ;# test-lib chdir's into trash
test_expect_success 'prepare reference tree' '
mkdir path0 path1 &&
- cp "$TEST_DIRECTORY"/diff-lib/COPYING path0/COPYING &&
+ cp "$TEST_DIRECTORY"/lib-diff/COPYING path0/COPYING &&
git update-index --add path0/COPYING &&
tree=$(git write-tree) &&
echo $tree
'
-blob=$(git hash-object "$TEST_DIRECTORY/diff-lib/COPYING")
+blob=$(git hash-object "$TEST_DIRECTORY/lib-diff/COPYING")
test_expect_success 'prepare work tree' '
cp path0/COPYING path1/COPYING &&
git update-index --add --remove path0/COPYING path1/COPYING
diff --git a/t/t4008-diff-break-rewrite.sh b/t/t4008-diff-break-rewrite.sh
index b1ccd41..2299f27 100755
--- a/t/t4008-diff-break-rewrite.sh
+++ b/t/t4008-diff-break-rewrite.sh
@@ -22,11 +22,11 @@ With -B, this should be detected as two complete rewrites.
Further, with -B and -M together, these should turn into two renames.
'
. ./test-lib.sh
-. "$TEST_DIRECTORY"/diff-lib.sh ;# test-lib chdir's into trash
+. "$TEST_DIRECTORY"/lib-diff.sh ;# test-lib chdir's into trash
test_expect_success setup '
- cat "$TEST_DIRECTORY"/diff-lib/README >file0 &&
- cat "$TEST_DIRECTORY"/diff-lib/COPYING >file1 &&
+ cat "$TEST_DIRECTORY"/lib-diff/README >file0 &&
+ cat "$TEST_DIRECTORY"/lib-diff/COPYING >file1 &&
blob0_id=$(git hash-object file0) &&
blob1_id=$(git hash-object file1) &&
git update-index --add file0 file1 &&
diff --git a/t/t4009-diff-rename-4.sh b/t/t4009-diff-rename-4.sh
index b63bdf0..b1da807 100755
--- a/t/t4009-diff-rename-4.sh
+++ b/t/t4009-diff-rename-4.sh
@@ -7,11 +7,11 @@ test_description='Same rename detection as t4003 but testing diff-raw -z.
'
. ./test-lib.sh
-. "$TEST_DIRECTORY"/diff-lib.sh ;# test-lib chdir's into trash
+. "$TEST_DIRECTORY"/lib-diff.sh ;# test-lib chdir's into trash
test_expect_success \
'prepare reference tree' \
- 'cat "$TEST_DIRECTORY"/diff-lib/COPYING >COPYING &&
+ 'cat "$TEST_DIRECTORY"/lib-diff/COPYING >COPYING &&
echo frotz >rezrov &&
git update-index --add COPYING rezrov &&
orig=$(git hash-object COPYING) &&
@@ -81,7 +81,7 @@ test_expect_success \
test_expect_success \
'prepare work tree once again' \
- 'cat "$TEST_DIRECTORY"/diff-lib/COPYING >COPYING &&
+ 'cat "$TEST_DIRECTORY"/lib-diff/COPYING >COPYING &&
git update-index --add --remove COPYING COPYING.1'
git diff-index -z -C --find-copies-harder $tree >current
diff --git a/t/t4010-diff-pathspec.sh b/t/t4010-diff-pathspec.sh
index 65cc703..1bbced7 100755
--- a/t/t4010-diff-pathspec.sh
+++ b/t/t4010-diff-pathspec.sh
@@ -10,7 +10,7 @@ Prepare:
path1/file1
'
. ./test-lib.sh
-. "$TEST_DIRECTORY"/diff-lib.sh ;# test-lib chdir's into trash
+. "$TEST_DIRECTORY"/lib-diff.sh ;# test-lib chdir's into trash
test_expect_success \
setup \
diff --git a/t/t4011-diff-symlink.sh b/t/t4011-diff-symlink.sh
index 717034b..5a25c25 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
-. "$TEST_DIRECTORY"/diff-lib.sh
+. "$TEST_DIRECTORY"/lib-diff.sh
# Print the short OID of a symlink with the given name.
symlink_oid () {
diff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh
index ce6aa39..fcc30d8 100755
--- a/t/t4013-diff-various.sh
+++ b/t/t4013-diff-various.sh
@@ -9,7 +9,7 @@ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh
-. "$TEST_DIRECTORY"/diff-lib.sh
+. "$TEST_DIRECTORY"/lib-diff.sh
test_expect_success setup '
diff --git a/t/t4015-diff-whitespace.sh b/t/t4015-diff-whitespace.sh
index 8c57422..2c13b62 100755
--- a/t/t4015-diff-whitespace.sh
+++ b/t/t4015-diff-whitespace.sh
@@ -7,7 +7,7 @@ test_description='Test special whitespace in diff engine.
'
. ./test-lib.sh
-. "$TEST_DIRECTORY"/diff-lib.sh
+. "$TEST_DIRECTORY"/lib-diff.sh
test_expect_success "Ray Lehtiniemi's example" '
cat <<-\EOF >x &&
diff --git a/t/t4027-diff-submodule.sh b/t/t4027-diff-submodule.sh
index 894a11b..94ef77e 100755
--- a/t/t4027-diff-submodule.sh
+++ b/t/t4027-diff-submodule.sh
@@ -3,7 +3,7 @@
test_description='difference in submodules'
. ./test-lib.sh
-. "$TEST_DIRECTORY"/diff-lib.sh
+. "$TEST_DIRECTORY"/lib-diff.sh
test_expect_success setup '
test_tick &&
diff --git a/t/t4034-diff-words.sh b/t/t4034-diff-words.sh
index 0c8fb39..56f1e62 100755
--- a/t/t4034-diff-words.sh
+++ b/t/t4034-diff-words.sh
@@ -3,7 +3,7 @@
test_description='word diff colors'
. ./test-lib.sh
-. "$TEST_DIRECTORY"/diff-lib.sh
+. "$TEST_DIRECTORY"/lib-diff.sh
cat >pre.simple <<-\EOF
h(4)
diff --git a/t/t4038-diff-combined.sh b/t/t4038-diff-combined.sh
index 09ad491..aeac203 100755
--- a/t/t4038-diff-combined.sh
+++ b/t/t4038-diff-combined.sh
@@ -6,7 +6,7 @@ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh
-. "$TEST_DIRECTORY"/diff-lib.sh
+. "$TEST_DIRECTORY"/lib-diff.sh
setup_helper () {
one=$1 branch=$2 side=$3 &&
diff --git a/t/t4061-diff-indent.sh b/t/t4061-diff-indent.sh
index bcf7493..7750b87 100755
--- a/t/t4061-diff-indent.sh
+++ b/t/t4061-diff-indent.sh
@@ -7,7 +7,7 @@ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh
-. "$TEST_DIRECTORY"/diff-lib.sh
+. "$TEST_DIRECTORY"/lib-diff.sh
# Compare two diff outputs. Ignore "index" lines, because we don't
# care about SHA-1s or file modes.
diff --git a/t/t4206-log-follow-harder-copies.sh b/t/t4206-log-follow-harder-copies.sh
index ad29e65..4871a5d 100755
--- a/t/t4206-log-follow-harder-copies.sh
+++ b/t/t4206-log-follow-harder-copies.sh
@@ -7,7 +7,7 @@ test_description='Test --follow should always find copies hard in git log.
'
. ./test-lib.sh
-. "$TEST_DIRECTORY"/diff-lib.sh
+. "$TEST_DIRECTORY"/lib-diff.sh
echo >path0 'Line 1
Line 2
diff --git a/t/t5310-pack-bitmaps.sh b/t/t5310-pack-bitmaps.sh
index 5ba7603..40b9f63 100755
--- a/t/t5310-pack-bitmaps.sh
+++ b/t/t5310-pack-bitmaps.sh
@@ -5,6 +5,8 @@ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh
+. "$TEST_DIRECTORY"/lib-bundle.sh
+. "$TEST_DIRECTORY"/lib-bitmap.sh
objpath () {
echo ".git/objects/$(echo "$1" | sed -e 's|\(..\)|\1/|')"
diff --git a/t/t5318-commit-graph.sh b/t/t5318-commit-graph.sh
index 5b15f1a..fa2ba93 100755
--- a/t/t5318-commit-graph.sh
+++ b/t/t5318-commit-graph.sh
@@ -551,7 +551,7 @@ corrupt_graph_and_verify() {
zero_pos=${4:-${orig_size}} &&
printf "$data" | dd of="$objdir/info/commit-graph" bs=1 seek="$pos" conv=notrunc &&
dd of="$objdir/info/commit-graph" bs=1 seek="$zero_pos" if=/dev/null &&
- generate_zero_bytes $(($orig_size - $zero_pos)) >>"$objdir/info/commit-graph" &&
+ test-tool genzeros $(($orig_size - $zero_pos)) >>"$objdir/info/commit-graph" &&
corrupt_graph_verify "$grepstr"
}
diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh
index 42f5503..c1e0eb3 100755
--- a/t/t5510-fetch.sh
+++ b/t/t5510-fetch.sh
@@ -9,7 +9,7 @@ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh
-. "$TEST_DIRECTORY"/test-bundle-functions.sh
+. "$TEST_DIRECTORY"/lib-bundle.sh
D=$(pwd)
diff --git a/t/t6020-bundle-misc.sh b/t/t6020-bundle-misc.sh
index 6249420..da5fe1b 100755
--- a/t/t6020-bundle-misc.sh
+++ b/t/t6020-bundle-misc.sh
@@ -9,7 +9,7 @@ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh
-. "$TEST_DIRECTORY"/test-bundle-functions.sh
+. "$TEST_DIRECTORY"/lib-bundle.sh
# Create a commit or tag and set the variable with the object ID.
test_commit_setvar () {
diff --git a/t/t6113-rev-list-bitmap-filters.sh b/t/t6113-rev-list-bitmap-filters.sh
index 2b551e6..3f88994 100755
--- a/t/t6113-rev-list-bitmap-filters.sh
+++ b/t/t6113-rev-list-bitmap-filters.sh
@@ -2,6 +2,7 @@
test_description='rev-list combining bitmaps and filters'
. ./test-lib.sh
+. "$TEST_DIRECTORY"/lib-bitmap.sh
test_expect_success 'set up bitmapped repo' '
# one commit will have bitmaps, the other will not
diff --git a/t/t6426-merge-skip-unneeded-updates.sh b/t/t6426-merge-skip-unneeded-updates.sh
index d7eeee4..7b5f1c1 100755
--- a/t/t6426-merge-skip-unneeded-updates.sh
+++ b/t/t6426-merge-skip-unneeded-updates.sh
@@ -492,7 +492,9 @@ test_expect_success '3a-L: bq_1->foo/bq_2 on A, foo/->bar/ on B' '
test_cmp expect actual &&
test_must_fail git rev-parse HEAD:bq HEAD:foo/bq &&
- test_path_is_missing bq foo/bq foo/whatever
+ test_path_is_missing bq &&
+ test_path_is_missing foo/bq &&
+ test_path_is_missing foo/whatever
)
'
@@ -522,7 +524,9 @@ test_expect_success '3a-R: bq_1->foo/bq_2 on A, foo/->bar/ on B' '
test_cmp expect actual &&
test_must_fail git rev-parse HEAD:bq HEAD:foo/bq &&
- test_path_is_missing bq foo/bq foo/whatever
+ test_path_is_missing bq &&
+ test_path_is_missing foo/bq &&
+ test_path_is_missing foo/whatever
)
'
@@ -588,7 +592,9 @@ test_expect_success '3b-L: bq_1->foo/bq_2 on A, foo/->bar/ on B' '
test_cmp expect actual &&
test_must_fail git rev-parse HEAD:bq HEAD:foo/bq &&
- test_path_is_missing bq foo/bq foo/whatever
+ test_path_is_missing bq &&
+ test_path_is_missing foo/bq &&
+ test_path_is_missing foo/whatever
)
'
@@ -618,7 +624,9 @@ test_expect_success '3b-R: bq_1->foo/bq_2 on A, foo/->bar/ on B' '
test_cmp expect actual &&
test_must_fail git rev-parse HEAD:bq HEAD:foo/bq &&
- test_path_is_missing bq foo/bq foo/whatever
+ test_path_is_missing bq &&
+ test_path_is_missing foo/bq &&
+ test_path_is_missing foo/whatever
)
'
diff --git a/t/t6500-gc.sh b/t/t6500-gc.sh
index f76586f..60d961b 100755
--- a/t/t6500-gc.sh
+++ b/t/t6500-gc.sh
@@ -78,7 +78,7 @@ test_expect_success 'gc --keep-largest-pack' '
git gc &&
( cd .git/objects/pack && ls *.pack ) >pack-list &&
test_line_count = 1 pack-list &&
- BASE_PACK=.git/objects/pack/pack-*.pack &&
+ cp pack-list base-pack-list &&
test_commit four &&
git repack -d &&
test_commit five &&
@@ -90,7 +90,7 @@ test_expect_success 'gc --keep-largest-pack' '
test_line_count = 2 pack-list &&
awk "/^P /{print \$2}" <.git/objects/info/packs >pack-info &&
test_line_count = 2 pack-info &&
- test_path_is_file $BASE_PACK &&
+ test_path_is_file .git/objects/pack/$(cat base-pack-list) &&
git fsck
)
'
diff --git a/t/t7501-commit-basic-functionality.sh b/t/t7501-commit-basic-functionality.sh
index 0f93618..512ae27 100755
--- a/t/t7501-commit-basic-functionality.sh
+++ b/t/t7501-commit-basic-functionality.sh
@@ -11,7 +11,7 @@ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh
-. "$TEST_DIRECTORY/diff-lib.sh"
+. "$TEST_DIRECTORY/lib-diff.sh"
author='The Real Author <someguy@his.email.org>'
diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
index 8f1caf8..5c47ac4 100755
--- a/t/t9300-fast-import.sh
+++ b/t/t9300-fast-import.sh
@@ -8,7 +8,7 @@ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh
-. "$TEST_DIRECTORY"/diff-lib.sh ;# test-lib chdir's into trash
+. "$TEST_DIRECTORY"/lib-diff.sh ;# test-lib chdir's into trash
verify_packs () {
for p in .git/objects/pack/*.pack
diff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb-standalone-no-errors.sh
index ee8c6e3..0333065 100755
--- a/t/t9500-gitweb-standalone-no-errors.sh
+++ b/t/t9500-gitweb-standalone-no-errors.sh
@@ -13,7 +13,7 @@ or warnings to log.'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
-. ./gitweb-lib.sh
+. ./lib-gitweb.sh
# ----------------------------------------------------------------------
# no commits (empty, just initialized repository)
diff --git a/t/t9501-gitweb-standalone-http-status.sh b/t/t9501-gitweb-standalone-http-status.sh
index 141610d..32814e7 100755
--- a/t/t9501-gitweb-standalone-http-status.sh
+++ b/t/t9501-gitweb-standalone-http-status.sh
@@ -13,7 +13,7 @@ code and message.'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
-. ./gitweb-lib.sh
+. ./lib-gitweb.sh
#
# Gitweb only provides the functionality tested by the 'modification times'
diff --git a/t/t9502-gitweb-standalone-parse-output.sh b/t/t9502-gitweb-standalone-parse-output.sh
index 9cf7ab3..3167473 100755
--- a/t/t9502-gitweb-standalone-parse-output.sh
+++ b/t/t9502-gitweb-standalone-parse-output.sh
@@ -13,7 +13,7 @@ in the HTTP header or the actual script output.'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
-. ./gitweb-lib.sh
+. ./lib-gitweb.sh
# ----------------------------------------------------------------------
# snapshot file name and prefix
diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh
index 05dc2cc..c96a555 100644
--- a/t/test-lib-functions.sh
+++ b/t/test-lib-functions.sh
@@ -32,11 +32,6 @@ test_set_editor () {
export EDITOR
}
-test_set_index_version () {
- GIT_INDEX_VERSION="$1"
- export GIT_INDEX_VERSION
-}
-
test_decode_color () {
awk '
function name(n) {
@@ -116,13 +111,6 @@ remove_cr () {
tr '\015' Q | sed -e 's/Q$//'
}
-# Generate an output of $1 bytes of all zeroes (NULs, not ASCII zeroes).
-# If $1 is 'infinity', output forever or until the receiving pipe stops reading,
-# whichever comes first.
-generate_zero_bytes () {
- test-tool genzeros "$@"
-}
-
# In some bourne shell implementations, the "unset" builtin returns
# nonzero status when a variable to be unset was not set in the first
# place.
@@ -735,34 +723,37 @@ test_external_without_stderr () {
}
# debugging-friendly alternatives to "test [-f|-d|-e]"
-# The commands test the existence or non-existence of $1. $2 can be
-# given to provide a more precise diagnosis.
+# The commands test the existence or non-existence of $1
test_path_is_file () {
+ test "$#" -ne 1 && BUG "1 param"
if ! test -f "$1"
then
- echo "File $1 doesn't exist. $2"
+ echo "File $1 doesn't exist"
false
fi
}
test_path_is_dir () {
+ test "$#" -ne 1 && BUG "1 param"
if ! test -d "$1"
then
- echo "Directory $1 doesn't exist. $2"
+ echo "Directory $1 doesn't exist"
false
fi
}
test_path_exists () {
+ test "$#" -ne 1 && BUG "1 param"
if ! test -e "$1"
then
- echo "Path $1 doesn't exist. $2"
+ echo "Path $1 doesn't exist"
false
fi
}
# Check if the directory exists and is empty as expected, barf otherwise.
test_dir_is_empty () {
+ test "$#" -ne 1 && BUG "1 param"
test_path_is_dir "$1" &&
if test -n "$(ls -a1 "$1" | egrep -v '^\.\.?$')"
then
@@ -774,6 +765,7 @@ test_dir_is_empty () {
# Check if the file exists and has a size greater than zero
test_file_not_empty () {
+ test "$#" = 2 && BUG "2 param"
if ! test -s "$1"
then
echo "'$1' is not a non-empty file."
@@ -782,6 +774,7 @@ test_file_not_empty () {
}
test_path_is_missing () {
+ test "$#" -ne 1 && BUG "1 param"
if test -e "$1"
then
echo "Path exists:"
@@ -818,6 +811,7 @@ test_line_count () {
}
test_file_size () {
+ test "$#" -ne 1 && BUG "1 param"
test-tool path-utils file-size "$1"
}
@@ -990,6 +984,7 @@ test_expect_code () {
# - not all diff versions understand "-u"
test_cmp () {
+ test "$#" -ne 2 && BUG "2 param"
eval "$GIT_TEST_CMP" '"$@"'
}
@@ -1019,6 +1014,7 @@ test_cmp_config () {
# test_cmp_bin - helper to compare binary files
test_cmp_bin () {
+ test "$#" -ne 2 && BUG "2 param"
cmp "$@"
}
@@ -1079,6 +1075,7 @@ verbose () {
# otherwise.
test_must_be_empty () {
+ test "$#" -ne 1 && BUG "1 param"
test_path_is_file "$1" &&
if test -s "$1"
then
@@ -1102,7 +1099,7 @@ test_cmp_rev () {
fi
if test $# != 2
then
- error "bug in the test script: test_cmp_rev requires two revisions, but got $#"
+ BUG "test_cmp_rev requires two revisions, but got $#"
else
local r1 r2
r1=$(git rev-parse --verify "$1") &&
@@ -1213,7 +1210,7 @@ test_atexit () {
# doing so on Bash is better than nothing (the test will
# silently pass on other shells).
test "${BASH_SUBSHELL-0}" = 0 ||
- error "bug in test script: test_atexit does nothing in a subshell"
+ BUG "test_atexit does nothing in a subshell"
test_atexit_cleanup="{ $*
} && (exit \"\$eval_ret\"); eval_ret=\$?; $test_atexit_cleanup"
}
@@ -1611,33 +1608,6 @@ test_set_port () {
eval $var=$port
}
-# Compare a file containing rev-list bitmap traversal output to its non-bitmap
-# counterpart. You can't just use test_cmp for this, because the two produce
-# subtly different output:
-#
-# - regular output is in traversal order, whereas bitmap is split by type,
-# with non-packed objects at the end
-#
-# - regular output has a space and the pathname appended to non-commit
-# objects; bitmap output omits this
-#
-# This function normalizes and compares the two. The second file should
-# always be the bitmap output.
-test_bitmap_traversal () {
- if test "$1" = "--no-confirm-bitmaps"
- then
- shift
- elif cmp "$1" "$2"
- then
- echo >&2 "identical raw outputs; are you sure bitmaps were used?"
- return 1
- fi &&
- cut -d' ' -f1 "$1" | sort >"$1.normalized" &&
- sort "$2" >"$2.normalized" &&
- test_cmp "$1.normalized" "$2.normalized" &&
- rm -f "$1.normalized" "$2.normalized"
-}
-
# Tests for the hidden file attribute on Windows
test_path_is_hidden () {
test_have_prereq MINGW ||
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 431adba..987a6c1 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -453,36 +453,6 @@ export GIT_DEFAULT_HASH
GIT_TRACE_BARE=1
export GIT_TRACE_BARE
-check_var_migration () {
- # the warnings and hints given from this helper depends
- # on end-user settings, which will disrupt the self-test
- # done on the test framework itself.
- case "$GIT_TEST_FRAMEWORK_SELFTEST" in
- t) return ;;
- esac
-
- old_name=$1 new_name=$2
- eval "old_isset=\${${old_name}:+isset}"
- eval "new_isset=\${${new_name}:+isset}"
-
- case "$old_isset,$new_isset" in
- isset,)
- echo >&2 "warning: $old_name is now $new_name"
- echo >&2 "hint: set $new_name too during the transition period"
- eval "$new_name=\$$old_name"
- ;;
- isset,isset)
- # do this later
- # echo >&2 "warning: $old_name is now $new_name"
- # echo >&2 "hint: remove $old_name"
- ;;
- esac
-}
-
-check_var_migration GIT_FSMONITOR_TEST GIT_TEST_FSMONITOR
-check_var_migration TEST_GIT_INDEX_VERSION GIT_TEST_INDEX_VERSION
-check_var_migration GIT_FORCE_PRELOAD_TEST GIT_TEST_PRELOAD_INDEX
-
# Use specific version of the index file format
if test -n "${GIT_TEST_INDEX_VERSION:+isset}"
then