Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: fredericd/Koha-Contrib-Tamil
base: 01034b61f8
...
head fork: fredericd/Koha-Contrib-Tamil
compare: a7fed8f985
  • 2 commits
  • 3 files changed
  • 0 commit comments
  • 1 contributor
Showing with 79 additions and 1 deletion.
  1. +4 −0 Changes
  2. +1 −1  dist.ini
  3. +74 −0 t/00-compile.t
View
4 Changes
@@ -1,5 +1,9 @@
Revision history for Perl module Koha::Contrib::Tamil
+0.022 2012-05-10
+
+ - Fix a test failing depending on Koha version
+
0.021 2012-05-09
- Fix a bug in koha_auth preventing loading configuration file
View
2  dist.ini
@@ -4,7 +4,7 @@ license = GPL_3
copyright_holder = Fréderic Démians
copyright_year = 2012
-version = 0.021
+version = 0.022
[@Basic]
View
74 t/00-compile.t
@@ -0,0 +1,74 @@
+#!perl
+
+use strict;
+use warnings;
+use Test::More;
+use File::Find;
+use File::Temp qw{ tempdir };
+
+eval { require C4::Koha; };
+plan skip_all => 'Test irrelevant without Koha library being available' if $@;
+
+my @modules;
+find(
+ sub {
+ return if $File::Find::name !~ /\.pm\z/ ||
+ $File::Find::name =~ /Claimer\.pm/;
+ my $found = $File::Find::name;
+ $found =~ s{^lib/}{};
+ $found =~ s{[/\\]}{::}g;
+ $found =~ s/\.pm$//;
+ # nothing to skip
+ push @modules, $found;
+ },
+ 'lib',
+);
+
+sub _find_scripts {
+ my $dir = shift @_;
+
+ my @found_scripts = ();
+ find(
+ sub {
+ return unless -f;
+ return if /koha-claim/;
+ my $found = $File::Find::name;
+ # nothing to skip
+ open my $FH, '<', $_ or do {
+ note( "Unable to open $found in ( $! ), skipping" );
+ return;
+ };
+ my $shebang = <$FH>;
+ return unless $shebang =~ /^#!.*?\bperl\b\s*$/;
+ push @found_scripts, $found;
+ },
+ $dir,
+ );
+
+ return @found_scripts;
+}
+
+my @scripts;
+do { push @scripts, _find_scripts($_) if -d $_ }
+ for qw{ bin script scripts };
+
+my $plan = scalar(@modules) + scalar(@scripts);
+$plan ? (plan tests => $plan) : (plan skip_all => "no tests to run");
+
+{
+ # fake home for cpan-testers
+ # no fake requested ## local $ENV{HOME} = tempdir( CLEANUP => 1 );
+
+ like( qx{ $^X -Ilib -e "require $_; print '$_ ok'" }, qr/^\s*$_ ok/s, "$_ loaded ok" )
+ for sort @modules;
+
+ SKIP: {
+ eval "use Test::Script 1.05; 1;";
+ skip "Test::Script needed to test script compilation", scalar(@scripts) if $@;
+ foreach my $file ( @scripts ) {
+ my $script = $file;
+ $script =~ s!.*/!!;
+ script_compiles( $file, "$script script compiles" );
+ }
+ }
+}

No commit comments for this range

Something went wrong with that request. Please try again.