]> git.ipfire.org Git - thirdparty/git.git/commitdiff
leak tests: mark passing SANITIZE=leak tests as leak-free
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Wed, 27 Jul 2022 23:13:41 +0000 (01:13 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 27 Jul 2022 23:35:40 +0000 (16:35 -0700)
Mark those remaining tests that pass when run under SANITIZE=leak with
TEST_PASSES_SANITIZE_LEAK=true, these were either omitted in
f346fcb62a0 (Merge branch 'ab/mark-leak-free-tests-even-more',
2021-12-15) and 5a4f8381b68 (Merge branch 'ab/mark-leak-free-tests',
2021-10-25), or have had their memory leaks fixed since then.

With this change there's now a a one-to-one mapping between those
tests that we have opted-in via "TEST_PASSES_SANITIZE_LEAK=true", and
those that pass with the new "check" mode:

GIT_TEST_PASSING_SANITIZE_LEAK=check \
GIT_TEST_SANITIZE_LEAK_LOG=true \
make test SANITIZE=leak

Note that the "GIT_TEST_SANITIZE_LEAK_LOG=true" is needed due to the
edge cases noted in a preceding commit, i.e. in some cases we'd pass
the test itself, but still have outstanding leaks due to ignored exit
codes.

The "GIT_TEST_SANITIZE_LEAK_LOG=true" corrects for that, we're only
marking those tests as passing that really don't have any leaks,
whether that was reflected in their exit code or not.

Note that the change here to "t9100-git-svn-basic.sh" is marking that
test as passing under SANITIZE=leak, we're removing a
"TEST_FAILS_SANITIZE_LEAK=true" line, not
"TEST_PASSES_SANITIZE_LEAK=true". See 7a98d9ab00d (revisions API: have
release_revisions() release "cmdline", 2022-04-13) for the
introduction of that t/lib-git-svn.sh-specific variable.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
37 files changed:
t/t0027-auto-crlf.sh
t/t0032-reftable-unittest.sh
t/t0033-safe-directory.sh
t/t0050-filesystem.sh
t/t0095-bloom.sh
t/t1405-main-ref-store.sh
t/t1407-worktree-ref-store.sh
t/t1418-reflog-exists.sh
t/t1701-racy-split-index.sh
t/t2006-checkout-index-basic.sh
t/t2023-checkout-m.sh
t/t2205-add-worktree-config.sh
t/t3012-ls-files-dedup.sh
t/t4017-diff-retval.sh
t/t4051-diff-function-context.sh
t/t4057-diff-combined-paths.sh
t/t4114-apply-typechange.sh
t/t4301-merge-tree-write-tree.sh
t/t5315-pack-objects-compression.sh
t/t5351-unpack-large-objects.sh
t/t5402-post-merge-hook.sh
t/t5503-tagfollow.sh
t/t6404-recursive-merge.sh
t/t6405-merge-symlinks.sh
t/t6408-merge-up-to-date.sh
t/t6411-merge-filemode.sh
t/t6413-merge-crlf.sh
t/t6425-merge-rename-delete.sh
t/t6431-merge-criscross.sh
t/t7060-wtstatus.sh
t/t7062-wtstatus-ignorecase.sh
t/t7110-reset-merge.sh
t/t7111-reset-table.sh
t/t7609-mergetool--lib.sh
t/t9100-git-svn-basic.sh
t/t9700-perl-git.sh
t/t9901-git-web--browse.sh

index 7f80f463930407410c6d3f671fb1f7833ec3b01e..a22e0e1382c42f192778e34d985c135d8008f232 100755 (executable)
@@ -2,6 +2,7 @@
 
 test_description='CRLF conversion all combinations'
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 compare_files () {
index 0ed14971a5801b68045f27232d9912cc09154a57..471cb37ac28affec3771d0b46e8dae02d4f09716 100755 (executable)
@@ -5,6 +5,7 @@
 
 test_description='reftable unittests'
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 test_expect_success 'unittests' '
index f4d737dadd04a1b582ed765acdddd5ddad14d5de..aecb308cf668057995a167090a421b906983f32b 100755 (executable)
@@ -2,6 +2,7 @@
 
 test_description='verify safe.directory checks'
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 GIT_TEST_ASSUME_DIFFERENT_OWNER=1
index 5c9dc90d0b096d9f104caedeb035b50b919b6811..325eb1c3cd0add75bcaf3b629c2692420c279f8a 100755 (executable)
@@ -5,6 +5,7 @@ test_description='Various filesystem issues'
 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 auml=$(printf '\303\244')
index daeb4a5e3e7514ea0bba1e10af58d5249b45e555..b567383eb836bff0c743522692cecdb354cbd0e6 100755 (executable)
@@ -1,6 +1,8 @@
 #!/bin/sh
 
 test_description='Testing the various Bloom filter computations in bloom.c'
+
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 test_expect_success 'compute unseeded murmur3 hash for empty string' '
index 51f829162819740fea8b080db3be6b422452b366..e4627cf1b61f0b3128a79e28f15a9d5e5693e30c 100755 (executable)
@@ -5,6 +5,7 @@ test_description='test main ref store api'
 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 RUN="test-tool ref-store main"
index ad8006c81397336fc5919858d0b13ec4d564b723..05b1881c5911780b53a3d882dbe1a4dfae0034d8 100755 (executable)
@@ -5,6 +5,7 @@ test_description='test worktree ref store api'
 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 RWT="test-tool ref-store worktree:wt"
index d51ecd5e9250f004e0b0c894b308172237e5666c..2268bca3c11ac8e2d73e3a399b8debc44fc712cb 100755 (executable)
@@ -4,6 +4,7 @@ test_description='Test reflog display routines'
 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 test_expect_success 'setup' '
index 5dc221ef382df13089b84dcb03002c2a8f19a9ba..d8fa489998acc5984da7e21a8a2adf43cfe88cee 100755 (executable)
@@ -5,6 +5,7 @@
 
 test_description='racy split index'
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 test_expect_success 'setup' '
index 7705e3a31708355c05271aa9d5eafa5af359043f..5d119871d416cd4e79b3bff7c56aeac729b276e6 100755 (executable)
@@ -3,6 +3,7 @@
 test_description='basic checkout-index tests
 '
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 test_expect_success 'checkout-index --gobbledegook' '
index 7b327b754494a8ebb27bb11c7f70649063ccd8d2..81e772fb4ebbf1d6c4d156560aa10dfdb02a0852 100755 (executable)
@@ -7,6 +7,7 @@ Ensures that checkout -m on a resolved file restores the conflicted file'
 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 test_expect_success setup '
index 43d950de6400fca709286c5316e71e037791f04f..98265ba1b495eb91df0fa60467ebf0ac932cf1b5 100755 (executable)
@@ -17,6 +17,7 @@ outside the repository.  Two instances for which this can occur are tested:
           repository can be added to the index.
        '
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 test_expect_success '1a: setup--config worktree' '
index 2682b1f43a666564a6f74bd20deca547f721ac34..190e2f6eed758229579a85118106e80d05c8d7d8 100755 (executable)
@@ -2,6 +2,7 @@
 
 test_description='git ls-files --deduplicate test'
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 test_expect_success 'setup' '
index ed461f481e2af5e3d73ac628eeee1fb52218d90b..5bc28ad9f042a0476d94d9e90e5b58073cc17f99 100755 (executable)
@@ -5,6 +5,7 @@ test_description='Return value of diffs'
 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 test_expect_success 'setup' '
index 4838a1df8b4369dc5024cdd7929d851b76482805..725278ad19c720468113659dbcc63aa013ac7de0 100755 (executable)
@@ -2,6 +2,7 @@
 
 test_description='diff function context'
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 dir="$TEST_DIRECTORY/t4051"
index 04b8a1542a8ec3ad2ffc28964f21940d034c2ed6..9a7505cbb8bf900510e8be4fc1a636124deec366 100755 (executable)
@@ -5,6 +5,7 @@ test_description='combined diff show only paths that are different to all parent
 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 # verify that diffc.expect matches output of
index da3e64f8110d54d7243c017a9a614baa7098142f..8ff364076673747adaaa74aec3f0a966caf033e5 100755 (executable)
@@ -7,6 +7,7 @@ test_description='git apply should not get confused with type changes.
 
 '
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 test_expect_success 'setup repository and commits' '
index f091259a55eba49fd632694b08495a4b8e8b0429..a243e3c5176b4ab21defc3fc419d16cbbad618a3 100755 (executable)
@@ -2,6 +2,7 @@
 
 test_description='git merge-tree --write-tree'
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 # This test is ort-specific
index 8bacd96275b0ac881b9202ecaff83394ca562dd2..c80ea9e8b71ee8707c8c1cc4020fb83a1b90029f 100755 (executable)
@@ -2,6 +2,7 @@
 
 test_description='pack-object compression configuration'
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 test_expect_success setup '
index 8ce8aa3b14725796d8de43fdf500064e783114aa..b1703350be348e1874d53ae40023b8139a91ac4a 100755 (executable)
@@ -5,6 +5,7 @@
 
 test_description='git unpack-objects with large objects'
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 prepare_dest () {
index 915af2de95e162a9581ca23a6efb229737e665a6..46ebdfbeebaf522281e8e4aa4c68e9fb33ca8513 100755 (executable)
@@ -7,6 +7,7 @@ test_description='Test the post-merge hook.'
 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 test_expect_success setup '
index 195fc64dd44ae74c1546698e111f1a19c07dbb04..5ebbaa489689dce28d1b47e16b73e19e25183c5f 100755 (executable)
@@ -5,6 +5,7 @@ test_description='test automatic tag following'
 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 # End state of the repository:
index b8735c6db4d7c9cc556231a5b0dab091f2f2eb61..36215518b6eb1a746ded0f9b475a7d3029b807a6 100755 (executable)
@@ -4,6 +4,7 @@ test_description='Test merge without common ancestors'
 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 # This scenario is based on a real-world repository of Shawn Pearce.
index 7435fce71e004095c3a9fe181b038ae77a800192..29e2b25ce5de25f6f97aa6ac967332e7603eb91e 100755 (executable)
@@ -11,6 +11,7 @@ if core.symlinks is false.'
 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 test_expect_success 'setup' '
index 7763c1ba98080d5d1d68e1009fb70f6c80cf479a..8a1ba6d23a7dc4a7ca7a56988f3d945d9af38619 100755 (executable)
@@ -2,6 +2,7 @@
 
 test_description='merge fast-forward and up to date'
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 test_expect_success setup '
index 6ae2489286c278f978c3a87f1015f16fe2bb005f..b6182723aae158acb4e56ab9018c9b30f4f86cd6 100755 (executable)
@@ -4,6 +4,7 @@ test_description='merge: handle file mode'
 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 test_expect_success 'set up mode change in one branch' '
index affea255fe92ca134a553d2a69362a8f8f7a8ab1..b4f4a313f486a583ca62268f2106948cca8d7266 100755 (executable)
@@ -11,6 +11,7 @@ test_description='merge conflict in crlf repo
 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 test_expect_success setup '
index 459b431a60d83c9f1e7c052b9c41491854f9997d..93cd2869b12897b5246a3a977f0cdaf1b2911663 100755 (executable)
@@ -4,6 +4,7 @@ test_description='Merge-recursive rename/delete conflict message'
 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 test_expect_success 'rename/delete' '
index 3824756a02ec31c228e2eeda92fc13a33b1e4b75..3fe14cd73e895fde51b4f711865553e7a142a2ea 100755 (executable)
@@ -2,6 +2,7 @@
 
 test_description='merge-recursive backend test'
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 #         A      <- create some files
index 0f4344c55e6421d605ab7364bc2fedfe9165b02b..aaeb4a533440df495d99e3b123f1640afe4374e7 100755 (executable)
@@ -5,6 +5,7 @@ test_description='basic work tree status reporting'
 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 test_expect_success setup '
index 73709dbeee287932b3d925aad78f5c2d3f216a52..caf372a3d42ac362c96bbbdf340f27688a565130 100755 (executable)
@@ -2,6 +2,7 @@
 
 test_description='git-status with core.ignorecase=true'
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 test_expect_success 'status with hash collisions' '
index 3d62e10b53fe16fd2eae0d0fa0363d8839f97b95..eb881be95b615f53867dbe8f56c6b0f9cc7a9d3c 100755 (executable)
@@ -5,6 +5,7 @@
 
 test_description='Tests for "git reset" with "--merge" and "--keep" options'
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 test_expect_success setup '
index ce421ad5ac4b3a17d0e347a7d86a386e2b14547b..78f25c1c7ead9820ed647711e4749d7e9d444c52 100755 (executable)
@@ -5,6 +5,7 @@
 
 test_description='Tests to check that "reset" options follow a known table'
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 
index 330d6d603d77236788ee932cdcc288731a7aa388..8b1c3bd39f2249417099ea2f24218268925909af 100755 (executable)
@@ -4,6 +4,7 @@ test_description='git mergetool
 
 Testing basic merge tools options'
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 test_expect_success 'mergetool --tool=vimdiff creates the expected layout' '
index 7c5b847f58424dc62c330674971d2d849f77ac4e..fea41b3c3606df1fc6d8111cdd74522532ca8b0b 100755 (executable)
@@ -8,7 +8,6 @@ test_description='git svn basic tests'
 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
-TEST_FAILS_SANITIZE_LEAK=true
 . ./lib-git-svn.sh
 
 prepare_utf8_locale
index a48fac6f07a669a418da405c3b2d42a9b8c446a7..4aa5d90d328aca4adcac5f0d3a2ee4946a393812 100755 (executable)
@@ -4,6 +4,8 @@
 #
 
 test_description='perl interface (Git.pm)'
+
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 . "$TEST_DIRECTORY"/lib-perl.sh
 
index de7152f82713bf797aecd3f53bce6ef006524b7b..19f56e5680f678c22fc80a63907c804448c4b445 100755 (executable)
@@ -5,6 +5,7 @@ test_description='git web--browse basic tests
 
 This test checks that git web--browse can handle various valid URLs.'
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 test_web_browse () {