[Pkg-privacy-commits] [msva-perl] 291/356: add unit test harness.
Ximin Luo
infinity0 at moszumanska.debian.org
Mon Aug 24 07:42:06 UTC 2015
This is an automated email from the git hooks/post-receive script.
infinity0 pushed a commit to branch debian
in repository msva-perl.
commit d3bd7816b4b6057e5616c567818ac48c7bfa9028
Author: David Bremner <bremner at debian.org>
Date: Sun Mar 6 14:40:32 2011 -0400
add unit test harness.
The file looks for any files under unit-tests ending in .t, and runs them.
You can use e.g. Test::Simple or Test::More to make such tests.
---
unit-tests/run-tests.pl | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/unit-tests/run-tests.pl b/unit-tests/run-tests.pl
new file mode 100644
index 0000000..e8305ce
--- /dev/null
+++ b/unit-tests/run-tests.pl
@@ -0,0 +1,26 @@
+#!/usr/bin/perl
+use strict;
+
+use TAP::Harness;
+use File::Find;
+use FindBin;
+my $BINDIR;
+BEGIN { $BINDIR = $FindBin::Bin; }
+
+
+my @tests;
+
+sub wanted {
+ push (@tests,$File::Find::name) if -f && m/.*\.t$/;
+}
+
+find(\&wanted, $BINDIR);
+
+print STDERR "found ",scalar(@tests)," tests\n";
+
+my $harness = TAP::Harness->new( { verbosity => 1,
+ lib => [ $BINDIR.'/..'] });
+
+$harness->runtests(@tests);
+
+1;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/msva-perl.git
More information about the Pkg-privacy-commits
mailing list