1
0
mirror of https://github.com/git/git.git synced 2024-09-28 15:01:31 +02:00

Merge branch 'ab/mark-leak-free-tests'

Bunch of tests are marked as "passing leak check".

* ab/mark-leak-free-tests:
  leak tests: mark some misc tests as passing with SANITIZE=leak
  leak tests: mark various "generic" tests as passing with SANITIZE=leak
  leak tests: mark some read-tree tests as passing with SANITIZE=leak
  leak tests: mark some ls-files tests as passing with SANITIZE=leak
  leak tests: mark all checkout-index tests as passing with SANITIZE=leak
  leak tests: mark all trace2 tests as passing with SANITIZE=leak
  leak tests: mark all ls-tree tests as passing with SANITIZE=leak
  leak tests: run various "test-tool" tests in t00*.sh SANITIZE=leak
  leak tests: run various built-in tests in t00*.sh SANITIZE=leak
This commit is contained in:
Junio C Hamano 2021-10-25 16:06:59 -07:00
commit 5a4f8381b6
66 changed files with 86 additions and 0 deletions

@ -2,6 +2,7 @@
test_description='git init' test_description='git init'
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
check_config () { check_config () {

@ -7,6 +7,7 @@ Verify that plumbing commands work when .git is a file
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
objpath() { objpath() {

@ -2,6 +2,7 @@
test_description=gitattributes test_description=gitattributes
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
attr_check_basic () { attr_check_basic () {

@ -1,6 +1,8 @@
#!/bin/sh #!/bin/sh
test_description='signals work as we expect' test_description='signals work as we expect'
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
cat >expect <<EOF cat >expect <<EOF

@ -1,6 +1,8 @@
#!/bin/sh #!/bin/sh
test_description='basic sanity checks for git var' test_description='basic sanity checks for git var'
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
test_expect_success 'get GIT_AUTHOR_IDENT' ' test_expect_success 'get GIT_AUTHOR_IDENT' '

@ -2,6 +2,7 @@
test_description=check-ignore test_description=check-ignore
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
init_vars () { init_vars () {

@ -2,6 +2,7 @@
test_description='racy GIT' test_description='racy GIT'
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
# This test can give false success if your machine is sufficiently # This test can give false success if your machine is sufficiently

@ -1,6 +1,8 @@
#!/bin/sh #!/bin/sh
test_description='test sha1 collision detection' test_description='test sha1 collision detection'
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
TEST_DATA="$TEST_DIRECTORY/t0013" TEST_DATA="$TEST_DIRECTORY/t0013"

@ -2,6 +2,7 @@
test_description='ignore CR in CRLF sequence while computing similiarity' test_description='ignore CR in CRLF sequence while computing similiarity'
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
test_expect_success setup ' test_expect_success setup '

@ -2,6 +2,7 @@
test_description='respect crlf in git archive' test_description='respect crlf in git archive'
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
test_expect_success setup ' test_expect_success setup '

@ -2,6 +2,7 @@
test_description='CRLF renormalization' test_description='CRLF renormalization'
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
test_expect_success setup ' test_expect_success setup '

@ -2,6 +2,7 @@
test_description='CRLF conversion' test_description='CRLF conversion'
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
has_cr() { has_cr() {

@ -2,6 +2,7 @@
test_description='test the Windows-only core.unsetenvvars setting' test_description='test the Windows-only core.unsetenvvars setting'
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
if ! test_have_prereq MINGW if ! test_have_prereq MINGW

@ -2,6 +2,7 @@
test_description='simple command server' test_description='simple command server'
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
test-tool simple-ipc SUPPORTS_SIMPLE_IPC || { test-tool simple-ipc SUPPORTS_SIMPLE_IPC || {

@ -2,6 +2,7 @@
test_description='update-index and add refuse to add beyond symlinks' test_description='update-index and add refuse to add beyond symlinks'
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
test_expect_success SYMLINKS setup ' test_expect_success SYMLINKS setup '

@ -5,6 +5,7 @@
test_description='Test run command' test_description='Test run command'
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
cat >hello-script <<-EOF cat >hello-script <<-EOF

@ -2,6 +2,7 @@
test_description='Test strcmp_offset functionality' test_description='Test strcmp_offset functionality'
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
while read s1 s2 expect while read s1 s2 expect

@ -2,6 +2,7 @@
test_description='Test the dir-iterator functionality' test_description='Test the dir-iterator functionality'
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
test_expect_success 'setup' ' test_expect_success 'setup' '

@ -2,6 +2,7 @@
test_description='Test parse_pathspec_file()' test_description='Test parse_pathspec_file()'
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
test_expect_success 'one item from stdin' ' test_expect_success 'one item from stdin' '

@ -1,6 +1,8 @@
#!/bin/sh #!/bin/sh
test_description='test trace2 facility (normal target)' test_description='test trace2 facility (normal target)'
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
# Turn off any inherited trace2 settings for this test. # Turn off any inherited trace2 settings for this test.

@ -1,6 +1,8 @@
#!/bin/sh #!/bin/sh
test_description='test trace2 facility (perf target)' test_description='test trace2 facility (perf target)'
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
# Turn off any inherited trace2 settings for this test. # Turn off any inherited trace2 settings for this test.

@ -1,6 +1,8 @@
#!/bin/sh #!/bin/sh
test_description='test trace2 facility' test_description='test trace2 facility'
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
# Turn off any inherited trace2 settings for this test. # Turn off any inherited trace2 settings for this test.

@ -71,6 +71,8 @@ In addition:
DF: a special case, where A makes a directory and B makes a file. DF: a special case, where A makes a directory and B makes a file.
' '
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
. "$TEST_DIRECTORY"/lib-read-tree.sh . "$TEST_DIRECTORY"/lib-read-tree.sh
. "$TEST_DIRECTORY"/lib-read-tree-m-3way.sh . "$TEST_DIRECTORY"/lib-read-tree-m-3way.sh

@ -6,6 +6,7 @@
test_description='git read-tree --prefix test. test_description='git read-tree --prefix test.
' '
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
test_expect_success setup ' test_expect_success setup '

@ -5,6 +5,7 @@ test_description='test read-tree into a fresh index file'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
test_expect_success setup ' test_expect_success setup '

@ -2,6 +2,7 @@
test_description='git mktree' test_description='git mktree'
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
test_expect_success setup ' test_expect_success setup '

@ -2,6 +2,7 @@
test_description='read-tree D/F conflict corner cases' test_description='read-tree D/F conflict corner cases'
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
. "$TEST_DIRECTORY"/lib-read-tree.sh . "$TEST_DIRECTORY"/lib-read-tree.sh

@ -1,6 +1,8 @@
#!/bin/sh #!/bin/sh
test_description='check that read-tree rejects confusing paths' test_description='check that read-tree rejects confusing paths'
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
test_expect_success 'create base tree' ' test_expect_success 'create base tree' '

@ -12,6 +12,7 @@ Also make sure that command line parser understands the normal
"flags first and then non flag arguments" command line. "flags first and then non flag arguments" command line.
' '
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
cat >expected <<EOF cat >expected <<EOF

@ -4,6 +4,7 @@ test_description='Test handling of ref names that check-ref-format rejects'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
test_expect_success setup ' test_expect_success setup '

@ -1,6 +1,8 @@
#!/bin/sh #!/bin/sh
test_description='test GIT_CEILING_DIRECTORIES' test_description='test GIT_CEILING_DIRECTORIES'
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
test_prefix() { test_prefix() {

@ -43,6 +43,7 @@ A few rules for repo setup:
# This test heavily relies on the standard error of nested function calls. # This test heavily relies on the standard error of nested function calls.
test_untraceable=UnfortunatelyYes test_untraceable=UnfortunatelyYes
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
here=$(pwd) here=$(pwd)

@ -8,6 +8,7 @@ test_description='git checkout-index -u test.
With -u flag, git checkout-index internally runs the equivalent of With -u flag, git checkout-index internally runs the equivalent of
git update-index --refresh on the checked out entry.' git update-index --refresh on the checked out entry.'
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
test_expect_success \ test_expect_success \

@ -10,6 +10,7 @@ also verifies that such leading path may contain symlinks, unlike
the GIT controlled paths. the GIT controlled paths.
' '
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
test_expect_success 'setup' ' test_expect_success 'setup' '

@ -8,6 +8,7 @@ test_description='git checkout-index --temp test.
With --temp flag, git checkout-index writes to temporary merge files With --temp flag, git checkout-index writes to temporary merge files
rather than the tracked path.' rather than the tracked path.'
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
test_expect_success 'setup' ' test_expect_success 'setup' '

@ -8,6 +8,7 @@ test_description='git checkout-index on filesystem w/o symlinks test.
This tests that git checkout-index creates a symbolic link as a plain This tests that git checkout-index creates a symbolic link as a plain
file if core.symlinks is false.' file if core.symlinks is false.'
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
test_expect_success \ test_expect_success \

@ -12,6 +12,7 @@ into the subdir while keeping the worktree location,
and tries commits from the top and the subdir, checking and tries commits from the top and the subdir, checking
that the commit-hook still gets called.' that the commit-hook still gets called.'
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
COMMIT_FILE="$(pwd)/output" COMMIT_FILE="$(pwd)/output"

@ -11,6 +11,7 @@ The tests in this file exercise parallel checkout's collision detection code in
both these mechanics. both these mechanics.
" "
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
. "$TEST_DIRECTORY/lib-parallel-checkout.sh" . "$TEST_DIRECTORY/lib-parallel-checkout.sh"

@ -2,6 +2,7 @@
test_description='cd_to_toplevel' test_description='cd_to_toplevel'
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
EXEC_PATH="$(git --exec-path)" EXEC_PATH="$(git --exec-path)"

@ -15,6 +15,8 @@ filesystem.
path3/file3 - a file in a directory path3/file3 - a file in a directory
path4 - an empty directory path4 - an empty directory
' '
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
test_expect_success 'setup ' ' test_expect_success 'setup ' '

@ -12,6 +12,8 @@ filesystem.
-foo - a file with a funny name. -foo - a file with a funny name.
-- - another file with a funny name. -- - another file with a funny name.
' '
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
test_expect_success \ test_expect_success \

@ -1,6 +1,8 @@
#!/bin/sh #!/bin/sh
test_description='ls-files --exclude does not affect index files' test_description='ls-files --exclude does not affect index files'
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
test_expect_success 'create repo with file' ' test_expect_success 'create repo with file' '

@ -6,6 +6,7 @@ This test runs git ls-files with various unusual or malformed
command-line arguments. command-line arguments.
' '
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
test_expect_success 'ls-files in empty repository' ' test_expect_success 'ls-files in empty repository' '

@ -1,6 +1,8 @@
#!/bin/sh #!/bin/sh
test_description='overly long paths' test_description='overly long paths'
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
test_expect_success setup ' test_expect_success setup '

@ -2,6 +2,7 @@
test_description='Test the lazy init name hash with various folder structures' test_description='Test the lazy init name hash with various folder structures'
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
if test 1 -eq $(test-tool online-cpus) if test 1 -eq $(test-tool online-cpus)

@ -2,6 +2,7 @@
test_description='wildmatch tests' test_description='wildmatch tests'
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
# Disable expensive chain-lint tests; all of the tests in this script # Disable expensive chain-lint tests; all of the tests in this script

@ -16,6 +16,8 @@ This test runs git ls-tree with the following in a tree.
The new path restriction code should do the right thing for path2 and The new path restriction code should do the right thing for path2 and
path2/baz. Also path0/ should snow nothing. path2/baz. Also path0/ should snow nothing.
' '
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
test_expect_success \ test_expect_success \

@ -19,6 +19,8 @@ This test runs git ls-tree with the following in a tree.
Test the handling of multiple directories which have matching file Test the handling of multiple directories which have matching file
entries. Also test odd filename and missing entries handling. entries. Also test odd filename and missing entries handling.
' '
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
test_expect_success 'setup' ' test_expect_success 'setup' '

@ -2,6 +2,7 @@
test_description='ls-tree with(out) globs' test_description='ls-tree with(out) globs'
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
test_expect_success 'setup' ' test_expect_success 'setup' '

@ -7,6 +7,7 @@ Miscellaneous tests for git ls-tree.
' '
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
test_expect_success 'setup' ' test_expect_success 'setup' '

@ -4,6 +4,7 @@ test_description='basic branch output coloring'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
test_expect_success 'set up some sample branches' ' test_expect_success 'set up some sample branches' '

@ -4,6 +4,7 @@ test_description='tests for the peel_ref optimization of packed-refs'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
test_expect_success 'create annotated tag in refs/tags' ' test_expect_success 'create annotated tag in refs/tags' '

@ -9,6 +9,7 @@ This test tries pathnames with funny characters in the working
tree, index, and tree objects. tree, index, and tree objects.
' '
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
HT=' ' HT=' '

@ -2,6 +2,7 @@
test_description='rm --pathspec-from-file' test_description='rm --pathspec-from-file'
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
test_tick test_tick

@ -5,6 +5,7 @@
test_description='quoted output' test_description='quoted output'
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
FN='濱野' FN='濱野'

@ -6,6 +6,8 @@
test_description='Test diff raw-output. test_description='Test diff raw-output.
' '
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
. "$TEST_DIRECTORY"/lib-read-tree-m-3way.sh . "$TEST_DIRECTORY"/lib-read-tree-m-3way.sh

@ -6,6 +6,7 @@
test_description='Quoting paths in diff output. test_description='Quoting paths in diff output.
' '
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
P0='pathname' P0='pathname'

@ -2,6 +2,7 @@
test_description='diff whitespace error detection' test_description='diff whitespace error detection'
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
test_expect_success setup ' test_expect_success setup '

@ -2,6 +2,7 @@
test_description='diff hunk header truncation' test_description='diff hunk header truncation'
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
N='日本語' N='日本語'

@ -4,6 +4,8 @@
# #
test_description='Test diff/status color escape codes' test_description='Test diff/status color escape codes'
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
ESC=$(printf '\033') ESC=$(printf '\033')

@ -4,6 +4,8 @@
# #
test_description='git merge-tree' test_description='git merge-tree'
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
test_expect_success setup ' test_expect_success setup '

@ -4,6 +4,7 @@ test_description='various Windows-only path tests'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
if test_have_prereq CYGWIN if test_have_prereq CYGWIN

@ -1,6 +1,8 @@
#!/bin/sh #!/bin/sh
test_description='handling of alternates in environment variables' test_description='handling of alternates in environment variables'
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
check_obj () { check_obj () {

@ -1,6 +1,8 @@
#!/bin/sh #!/bin/sh
test_description='corner cases in ident strings' test_description='corner cases in ident strings'
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh . ./test-lib.sh
# confirm that we do not segfault _and_ that we do not say "(null)", as # confirm that we do not segfault _and_ that we do not say "(null)", as

@ -2,6 +2,7 @@
test_description='grep icase on non-English locales' test_description='grep icase on non-English locales'
TEST_PASSES_SANITIZE_LEAK=true
. ./lib-gettext.sh . ./lib-gettext.sh
test_expect_success GETTEXT_ISO_LOCALE 'setup' ' test_expect_success GETTEXT_ISO_LOCALE 'setup' '

@ -2,6 +2,7 @@
test_description='git grep with a binary pattern files' test_description='git grep with a binary pattern files'
TEST_PASSES_SANITIZE_LEAK=true
. ./lib-gettext.sh . ./lib-gettext.sh
nul_match_internal () { nul_match_internal () {