aboutsummaryrefslogtreecommitdiffstats
path: root/qtest/QTC/perl/QTC.pm
blob: 2f78b3a676223b49be99d3df1eccf29886bb85ff (plain) (blame)
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
# -*- perl -*-

require 5.005;
use strict;
use FileHandle;

package QTC;

sub TC
{
    my ($scope, $case, $n) = @_;
    local $!;
    $n = 0 unless defined $n;
    return unless ($scope eq ($ENV{'TC_SCOPE'} || ""));
    my $filename = $ENV{'TC_FILENAME'} || return;
    my $fh = new FileHandle(">>$filename") or
	die "open test coverage file: $!\n";
    print $fh "$case $n\n";
    $fh->close();
}

1;

#
# END OF QTC
#