This is an automated email from the git hooks/post-receive script. periapt pushed a commit to branch master in repository license-reconcile.
commit 56c84e02bf17ae3eb64d006d624d276219922ff5 Author: Nicholas Bamber <nicho...@periapt.co.uk> Date: Tue Nov 24 17:57:20 2015 +0000 Consolidated TODO list * Consolidated TODO list * Started adding new tests --- debian/changelog | 3 +- debian/control | 3 +- t/08-licensecheck.t | 143 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 147 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index f6dec4e..5f14525 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ license-reconcile (0.10) UNRELEASED; urgency=medium - * Conslidated TODO list + * Consolidated TODO list + * Started adding new tests -- Nicholas Bamber <nicho...@periapt.co.uk> Wed, 18 Nov 2015 15:58:33 +0000 diff --git a/debian/control b/debian/control index e2100f7..2b6cb32 100644 --- a/debian/control +++ b/debian/control @@ -30,7 +30,8 @@ Build-Depends-Indep: devscripts (>= 2.15.9~), libtest-output-perl, libtext-levenshteinxs-perl, libuniversal-require-perl, - libyaml-libyaml-perl + libyaml-libyaml-perl, + libsoftware-license-perl Standards-Version: 3.9.6 Vcs-Browser: https://anonscm.debian.org/cgit/pkg-perl/packages/license-reconcile.git Vcs-Git: git://anonscm.debian.org/pkg-perl/packages/license-reconcile.git diff --git a/t/08-licensecheck.t b/t/08-licensecheck.t new file mode 100644 index 0000000..811adee --- /dev/null +++ b/t/08-licensecheck.t @@ -0,0 +1,143 @@ +#!/usr/bin/perl + +use Test::More tests=>3; +use Test::Deep; +use Test::NoWarnings; +use Debian::LicenseReconcile::LicenseCheck; +use Readonly; +use File::Temp qw(); +use Software::License; +use Data::Dumper; +require UNIVERSAL::require; + +Readonly my @LICENSES => qw( + Apache_2_0 + FreeBSD +); +# GPL_1 +# GPL_2 +# GPL_3 +# LGPL_2 +# LGPL_2_1 +# LGPL_3_0 +# MIT +# Mozilla_2_0 +# QPL_1_0 +# Zlib + + #CC0_1_0 + #GFDL_1_3 + #Artistic_1_0 + #Artistic_2_0 + #Mozilla_1_0 + #None + #PostgreSQL + #AGPL_3 + #SSLeay + #Apache_1_1 + #Mozilla_1_1 + #GFDL_1_2 + #Sun + #BSD + #OpenSSL + #Perl_5 + +my $dir = File::Temp->newdir('t/slgenXXXXX'); +my $year = 2000; +foreach my $license (@LICENSES) { + my $slfile = $dir->dirname . "/$license"; + my $module = "Software::License::$license"; + $module->require; + my $slobj = $module->new({ + holder => 'Testophilus Testownik <tes...@testity.org>', + year=>$year, + }); + open my $fh, '>', $slfile; + print $fh $slobj->notice; + print $fh $slobj->debian_text; + close $fh; + ++$year; +} + +Readonly my $LICENSECHECK => Debian::LicenseReconcile::LicenseCheck->new( + $dir->dirname, + [ + 'Apache (v2.0)'=>'test1', + 'BSD (2 clause)'=>'test2', + 'LGPL (v2.1)'=>'test1', + 'LGPL (v2)'=>'test2', + ], + 1 +); + +isa_ok($LICENSECHECK, 'Debian::LicenseReconcile::LicenseCheck'); +my @data = $LICENSECHECK->get_info; +print Dumper(@data); +cmp_deeply(\@data, bag( + { + file=>'Apache_2_0', + license=>'test1', + copyright=>['Copyright: 2000 by Testophilus Testownik <tes...@testity.org>'], + }, + { + file=>'FreeBSD', + license=>'test2', + copyright=>['Copyright: 2001 by Testophilus Testownik <tes...@testity.org>'], + }, +)); +# { +# file=>ignore(), +# license=>ignore(), +# copyright=>[ignore()], +# }, +# { +# file=>ignore(), +# license=>ignore(), +# copyright=>[ignore()], +# }, +# { +# file=>ignore(), +# license=>ignore(), +# copyright=>[ignore()], +# }, +# { +# file=>ignore(), +# license=>ignore(), +# copyright=>[ignore()], +# }, +# { +# file=>ignore(), +# license=>ignore(), +# copyright=>[ignore()], +# }, +# { +# file=>ignore(), +# license=>ignore(), +# copyright=>[ignore()], +# }, +# { +# file=>ignore(), +# license=>ignore(), +# copyright=>[ignore()], +# }, +# { +# file=>ignore(), +# license=>ignore(), +# copyright=>[ignore()], +# }, +# { +# file=>ignore(), +# license=>ignore(), +# copyright=>[ignore()], +# }, +# { +# file=>ignore(), +# license=>ignore(), +# copyright=>[ignore()], +# }, +# { +# file=>ignore(), +# license=>ignore(), +# copyright=>[ignore()], +# }, +# -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/license-reconcile.git _______________________________________________ Pkg-perl-cvs-commits mailing list Pkg-perl-cvs-commits@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-perl-cvs-commits