#!/usr/bin/perl -w # Test that each plugin is reference at least once in each theme directory. # # (I can test it's mentioned in each .htm[l] file as there may be a shared # header file or similar). # my @plugins = glob( "../lib/gnump3d/plugins/*.pm" ); my @themes = glob( "../templates/*/" ); my $found = 0; foreach my $plugin ( @plugins ) { if ( $plugin =~ /(.*)\/(.*)\.pm$/ ) { $plugin = $2; } foreach my $dir ( @themes ) { next if ( $dir =~ /CVS/ ); print "Testing for \"$plugin\" in $dir\n"; $found = 0; foreach my $file ( glob ( $dir . "/*" ) ) { print "\tFile: $file\n"; open( FILY, "<$file" ) or die "Cannot open $file - $!"; my @LINES = ; close( FILY ); foreach my $line ( @LINES ) { chomp( $line ); if ( $line =~ /\"\/$plugin/ ) { print "* $line\n"; $found ++; } } } if ( ! $found ) { print "Plugin $plugin not found in $dir\n"; exit 1; } } } exit 0;