add leaktrace test
[p5sagit/Config-Any.git] / t / 70-leak.t
CommitLineData
fb0f1150 1use strict;
2use warnings;
3
4use Test::More;
5use Config::Any;
6
7eval { require Test::LeakTrace; };
8
9if( $@ ) {
10 plan skip_all => 'Test::LeakTrace required for this test';
11}
12else {
13 plan tests => 1;
14}
15
16Test::LeakTrace::no_leaks_ok( sub {
17 Config::Any->load_files( {
18 files => [ qw( t/conf/conf.pl ) ],
19 use_ext => 1,
20 flatten_to_hash => 1,
21 force_plugins => [ 'Config::Any::Perl' ],
22 } );
23} );
24
251;
26
27__END__
28t/70-leak.t ..
291..1
30not ok 1 - leaks 1 == 0
31
32# Failed test 'leaks 1 == 0'
33# at t/70-leak.t line 23.
34# got: 1
35# expected: 0
36# leaked SCALAR(0x95049d8) from /usr/lib/perl/5.10/XSLoader.pm line 94.
37# 93: push(@DynaLoader::dl_shared_objects, $file); # record files loaded
38# 94: return &$xs(@_);
39# 95:
40# SV = PV(0x94d6f88) at 0x95049d8
41# REFCNT = 1
42# FLAGS = (POK,pPOK)
43# PV = 0x95035e8 "t/conf/conf.pl"\0
44# CUR = 14
45# LEN = 16
46# Looks like you failed 1 test of 1.
47Dubious, test returned 1 (wstat 256, 0x100)
48Failed 1/1 subtests
49
50Test Summary Report
51-------------------
52t/70-leak.t (Wstat: 256 Tests: 1 Failed: 1)
53 Failed test: 1
54 Non-zero exit status: 1
55Files=1, Tests=1, 0 wallclock secs ( 0.03 usr 0.00 sys + 0.04 cusr 0.00 csys = 0.07 CPU)
56Result: FAIL
57