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-emptyok 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-directoriesok 2 - .git/objects should have 3 subdirectories
expecting success:
:ok 3 - success is reported like this
checking known breakage:
falsenot 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/shtest_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=yesok 6 - test runs if prerequisite is satisfied
skipping test: unmet prerequisite causes test to be skipped
donthaveit=nook 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=yesok 8 # skip test runs if prerequisites are satisfied (missing HAVETHIS,HAVEIT)
skipping test: unmet prerequisites causes test to be skipped
donthaveit=nook 9 # skip unmet prerequisites causes test to be skipped (missing HAVEIT,DONTHAVEIT)
skipping test: unmet prerequisites causes test to be skipped
donthaveiteither=nook 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