git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: How do I run tests under Valgrind?

From
Ramkumar Ramachandra <artagnon@gmail.com>
Date
Sep 17, 2012, 17:23 UTC
Message-ID
<CALkWK0m378ApSwa1xiYUqEjMny5m0wt3KacqdDRU1qt=cw6k8g@mail.gmail.com>
In-Reply-To
<20120917172022.GA1179@sigill.intra.peff.net>
Hi Peff,
Jeff King wrote:
> No, that should work (and it does work here). I assume you can pass
> t0000 without --valgrind?

Yes. Here's the output from running it with --valgrind. I'm digging deeper to see what went wrong.

make_valgrind_symlink:6: permission denied:
/home/artagnon/src/git/t/../git-instaweb
./test-lib.sh:487: no matches found:
/home/artagnon/svn/prefix/svn-trunk/bin:/home/artagnon/bin:/home/artagnon/bin/depot_tools:/home/artagnon/.ruby/bin:/home/artagnon/.python/bin:/home/artagnon/.cabal/bin:/home/artagnon/svn/prefix/svn-trunk/bin:/home/artagnon/bin:/home/artagnon/bin/depot_tools:/home/artagnon/.ruby/bin:/home/artagnon/.python/bin:/home/artagnon/.cabal/bin:/home/artagnon/bin:/usr/local/bin:/usr/bin:/bin:/usr/games:/home/artagnon/.ec2/bin:/home/artagnon/.ec2/bin/git-*
Initialized empty Git repository in /home/artagnon/src/git/t/trash
directory.test-lib/.git/
expecting success:
        find .git/objects -type f -print >should-be-empty &&
        test_line_count = 0 should-be-empty
ok 1 - .git/objects should be empty after git init in an empty repo
expecting success:
        find .git/objects -type d -print >full-of-directories &&
        test_line_count = 3 full-of-directories
ok 2 - .git/objects should have 3 subdirectories
expecting success:
        :
ok 3 - success is reported like this
checking known breakage:
        false
not ok 4 - pretend we have a known breakage # TODO known breakage
expecting success:
        mkdir passing-todo &&
        (cd passing-todo &&
        cat >passing-todo.sh <<-EOF &&
        #!/bin/sh
        test_description='A passing TODO test
        This is run in a sub test-lib so that we do not get incorrect
        passing metrics
        '
        # Point to the t/test-lib.sh, which isn't in ../ as usual
        TEST_DIRECTORY="/home/artagnon/src/git/t"
        . "$TEST_DIRECTORY"/test-lib.sh
        test_expect_failure 'pretend we have fixed a known breakage' '
                :
        '
        test_done
        EOF
        chmod +x passing-todo.sh &&
        ./passing-todo.sh >out 2>err &&
        ! test -s err &&
        sed -e 's/^> //' >expect <<-\EOF &&
        > ok 1 - pretend we have fixed a known breakage # TODO known breakage
        > # fixed 1 known breakage(s)
        > # passed all 1 test(s)
        > 1..1
        EOF
        test_cmp expect out)

test_cmp:1: command not found: diff -u not ok - 5 pretend we have fixed a known breakage (run in sub test-lib) # # mkdir passing-todo && # (cd passing-todo && # cat >passing-todo.sh <<-EOF && # #!/bin/sh # # test_description='A passing TODO test # # This is run in a sub test-lib so that we do not get incorrect # passing metrics # ' # # # Point to the t/test-lib.sh, which isn't in ../ as usual # TEST_DIRECTORY="/home/artagnon/src/git/t" # . "$TEST_DIRECTORY"/test-lib.sh # # test_expect_failure 'pretend we have fixed a known breakage' ' # : # ' # # test_done # EOF # chmod +x passing-todo.sh && # ./passing-todo.sh >out 2>err && # ! test -s err && # sed -e 's/^> //' >expect <<-\EOF && # > ok 1 - pretend we have fixed a known breakage # TODO known breakage # > # fixed 1 known breakage(s) # > # passed all 1 test(s) # > 1..1 # EOF # test_cmp expect out) #

expecting success:
        test_have_prereq HAVEIT &&
        haveit=yes
ok 6 - test runs if prerequisite is satisfied
skipping test: unmet prerequisite causes test to be skipped
        donthaveit=no
ok 7 # skip unmet prerequisite causes test to be skipped (missing DONTHAVEIT)
skipping test: test runs if prerequisites are satisfied
        test_have_prereq HAVEIT &&
        test_have_prereq HAVETHIS &&
        haveit=yes
ok 8 # skip test runs if prerequisites are satisfied (missing HAVETHIS,HAVEIT)
skipping test: unmet prerequisites causes test to be skipped
        donthaveit=no

ok 9 # skip unmet prerequisites causes test to be skipped (missing HAVEIT,DONTHAVEIT)

skipping test: unmet prerequisites causes test to be skipped
        donthaveiteither=no

ok 10 # skip unmet prerequisites causes test to be skipped (missing DONTHAVEIT,HAVEIT)

bug in test framework: multiple prerequisite tags do not work reliably
FATAL: Unexpected exit with code 1
> It seems very odd that valgrind would have an impact here, since those
> tests are not even running git.
Yeah, I know!
Ram
Previous: Jeff KingNext: Jeff King
Message 3 of 37 in “How do I run tests under Valgrind?”
  1. Ramkumar RamachandraSep 17, 2012
  2. Jeff KingSep 17, 2012
  3. Ramkumar RamachandraSep 17, 2012
  4. Jeff KingSep 17, 2012
  5. Ramkumar RamachandraSep 17, 2012
  6. Jeff KingSep 17, 2012
  7. Johannes SixtSep 17, 2012
  8. Jeff KingSep 17, 2012
  9. Ramkumar RamachandraSep 17, 2012
  10. Jeff KingSep 17, 2012
  11. Ramkumar RamachandraSep 21, 2012
  12. Ramkumar RamachandraSep 21, 2012
  13. Stefano LattariniSep 21, 2012
  14. Ramkumar RamachandraSep 21, 2012
  15. Ramkumar RamachandraSep 21, 2012
  16. Jeff KingSep 21, 2012
  17. Stefano LattariniSep 22, 2012
  18. Jeff KingSep 22, 2012
  19. Stefano LattariniSep 22, 2012
  20. Junio C HamanoSep 22, 2012
  21. t/test-lib.sh: do not trust $SHELLRamkumar Ramachandra, Sep 21, 2012
  22. Jeff KingSep 21, 2012
  23. Ramkumar RamachandraSep 21, 2012
  24. Jeff KingSep 21, 2012
  25. Ramkumar RamachandraSep 21, 2012
  26. Andreas SchwabSep 21, 2012
  27. Junio C HamanoSep 21, 2012
  28. Ramkumar RamachandraSep 22, 2012
  29. Junio C HamanoSep 22, 2012
  30. Ramkumar RamachandraSep 22, 2012
  31. Ramkumar RamachandraSep 22, 2012
  32. Junio C HamanoSep 22, 2012
  33. Ramkumar RamachandraSep 26, 2012
  34. Junio C HamanoSep 21, 2012
  35. Jeff KingSep 21, 2012
  36. Andreas SchwabSep 21, 2012
  37. Jeff KingSep 21, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.