Skip to content

Instantly share code, notes, and snippets.

@syohex
Created October 6, 2011 14:12
Show Gist options
  • Save syohex/1267487 to your computer and use it in GitHub Desktop.
Save syohex/1267487 to your computer and use it in GitHub Desktop.
Test::LeakTraceを使うテストに Test::Valgrindを使うとエラーになる
% prove --exec 'perl -Iblib/lib -Iblib/arch -MTest::Valgrind' leak.t
# Using valgrind 3.7.0 located at /usr/local/bin/valgrind
# Using suppression file /Users/syohei/.perl/Test-Valgrind/suppressions/1.13/memcheck-3.7.0-aa5062912afa3d247a5c755d0683818d.supp
# Failed test 'Leak_StillReachable'
# at /Users/syohei/perl5/perlbrew/perls/perl-5.14.1/lib/site_perl/5.14.1/darwin-2level/Test/Valgrind/Session.pm line 451.
# got: 1
# expected: 0
#
# 100 bytes in 1 blocks are still reachable in loss record 14 of 23
# realloc (/usr/local/lib/valgrind/vgpreload_memcheck-amd64-darwin.so) [vg_replace_malloc.c:525]
# Perl_safesysrealloc (/Users/syohei/perl5/perlbrew/perls/perl-5.14.1/bin/perl) [?:?]
# set_stateinfo (/Users/syohei/perl5/perlbrew/perls/perl-5.14.1/lib/site_perl/5.14.1/darwin-2level/auto/Test/LeakTrace/LeakTrace.bundle) [?:?]
# leaktrace_runops (/Users/syohei/perl5/perlbrew/perls/perl-5.14.1/lib/site_perl/5.14.1/darwin-2level/auto/Test/LeakTrace/LeakTrace.bundle) [?:?]
# perl_run (/Users/syohei/perl5/perlbrew/perls/perl-5.14.1/bin/perl) [?:?]
# main (/Users/syohei/perl5/perlbrew/perls/perl-5.14.1/bin/perl) [?:?]
# Looks like you failed 1 test of 15.
# Looks like your test exited with 1 just after 15.
leak.t ..
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/15 subtests
Test Summary Report
-------------------
leak.t (Wstat: 256 Tests: 15 Failed: 1)
Failed test: 15
Non-zero exit status: 1
Files=1, Tests=15, 8 wallclock secs ( 0.03 usr 0.01 sys + 7.13 cusr 0.21 csys = 7.38 CPU)
Result: FAIL
#!perl
use strict;
use warnings;
use Test::LeakTrace;
leaktrace {
1;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment