File: test3.t

package info (click to toggle)
libdevel-profile-perl 1.05-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 128 kB
  • sloc: perl: 215; makefile: 2
file content (37 lines) | stat: -rw-r--r-- 596 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# -*- perl -*-

print "1..2\n";
# read the prof.out created by test2.t
open( F, "prof.out" ) || die "cannot open prof.out: $!\n";

# skip top header
while( <F> ){ last if /^\s*$/ }

# skip info header
scalar <F>;

my $pt = 0;
my %f;
while( <F> ){
    chop;
    my @x = split;

    $pt += $x[0];
    $f{$x[-1]} = 1;
}
close F;
unlink "prof.out";

# make sure percents are ok
if( $pt < 98 || $pt > 102 ){
    print "not ok 1\n";
}else{
    print "ok 1\n";
}

# make sure we saw all 3 funcs
if( $f{main::foo} && $f{main::bar} && $f{main::baz} ){
    print "ok 2\n";
}else{
    print "not ok 2\n";
}