aboutsummaryrefslogtreecommitdiffstats
path: root/qtest/QTC/perl/QTC.pm
diff options
context:
space:
mode:
Diffstat (limited to 'qtest/QTC/perl/QTC.pm')
-rw-r--r--qtest/QTC/perl/QTC.pm26
1 files changed, 26 insertions, 0 deletions
diff --git a/qtest/QTC/perl/QTC.pm b/qtest/QTC/perl/QTC.pm
new file mode 100644
index 00000000..2f78b3a6
--- /dev/null
+++ b/qtest/QTC/perl/QTC.pm
@@ -0,0 +1,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
+#