#!/bin/sh
-export VERBOSE=0
+export TEST_VERBOSE=0
PART1='use Test::Harness qw(&runtests $verbose); $verbose='
PART2='; runtests @ARGV;'
for f in $*; do
if [ $f == "--verbose" ] ; then
- export VERBOSE=1
+ export TEST_VERBOSE=1
fi
done
-/usr/bonsaitools/bin/perl -e "${PART1}${VERBOSE}${PART2}" t/*.t
+/usr/bonsaitools/bin/perl -e "${PART1}${TEST_VERBOSE}${PART2}" t/*.t
-#
+# -*- Mode: perl; indent-tabs-mode: nil -*-
+#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
BEGIN { $tests = @Support::Files::testitems + 4; }
BEGIN { use Test::More tests => $tests; }
-sub foo {
-$warnings = "foo"; #oy!
-}
+use strict;
# First now we test the scripts
-@testitems = @Support::Files::testitems;
+my @testitems = @Support::Files::testitems;
+my %warnings;
+my $verbose = $::ENV{TEST_VERBOSE};
+my $perlapp = $^X;
-my $warnings;
-my $verbose = $::ENV{VERBOSE};
-$perlapp=$^X;
-foreach $file (@testitems) {
+foreach my $file (@testitems) {
$file =~ s/\s.*$//; # nuke everything after the first space (#comment)
next if (!$file); # skip null entries
open (FILE,$file);
if ($bang =~ m/#!\S*perl\s+-.*T/) {
$T = "T";
}
- $command = "$perlapp"." -c$T $file 2>&1";
- $loginfo=`$command`;
-# print '@@'.$loginfo.'##';
- if ($loginfo =~ /syntax ok$/im) {
- $warnings{$_} = 1 foreach ($loginfo =~ /\((W.*?)\)/mg);
- if ($1) {
+ my $command = "$perlapp"." -c$T $file 2>&1";
+ my $loginfo=`$command`;
+ #print '@@'.$loginfo.'##';
+ if ($loginfo =~ /syntax ok$/im) {
+ $warnings{$_} = 1 foreach ($loginfo =~ /\((W.*?)\)/mg);
+ if ($1) {
if ($verbose) { print STDERR $loginfo; }
ok(0,$file."--WARNING");
} else {
- ok(1,$file);
- }
- } else {
+ ok(1,$file);
+ }
+ } else {
if ($verbose) { print STDERR $loginfo; }
- ok(0,$file."--ERROR");
+ ok(0,$file."--ERROR");
}
}
+# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
BEGIN { $tests = @Support::Files::testitems * 2; }
BEGIN { use Test::More tests => $tests; }
-@testitems = @Support::Files::testitems; # get the files to test.
+use strict;
-foreach $file (@testitems) {
+my @testitems = @Support::Files::testitems; # get the files to test.
+my $verbose = $::ENV{TEST_VERBOSE};
+
+foreach my $file (@testitems) {
$file =~ s/\s.*$//; # nuke everything after the first space (#comment)
next if (!$file); # skip null entries
- $filecontent = `cat $file`;
- if ($filecontent !~ /\/usr\/bonsaitools\/bin\/perl/) {
- ok(1,"$file does not have a shebang");
- next;
- } else {
- if ($filecontent =~ m#/usr/bonsaitools/bin/perl -w#) {
- ok(1,"$file uses -w");
- next;
- } else {
- ok(0,"$file is MISSING -w");
- next;
- }
- }
+ my $filecontent = `cat $file`;
+ if ($filecontent !~ /\/usr\/bonsaitools\/bin\/perl/) {
+ ok(1,"$file does not have a shebang");
+ next;
+ } else {
+ if ($filecontent =~ m#/usr/bonsaitools/bin/perl -w#) {
+ ok(1,"$file uses -w");
+ next;
+ } else {
+ ok(0,"$file is MISSING -w");
+ next;
+ }
+ }
}
-foreach $file (@testitems) {
- $file =~ s/\s.*$//; # nuke everything after the first space (#comment)
- next if (!$file); # skip null entries
- $filecontent = `cat $file`;
- if ($filecontent !~ /use strict/) {
- ok(0,"$file DOES NOT use strict");
- } else {
- ok(1,"$file uses strict");
- }
+foreach my $file (@testitems) {
+ $file =~ s/\s.*$//; # nuke everything after the first space (#comment)
+ next if (!$file); # skip null entries
+ my $filecontent = `cat $file`;
+ if ($filecontent !~ /use strict/) {
+ ok(0,"$file DOES NOT use strict");
+ } else {
+ ok(1,"$file uses strict");
+ }
}
+# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
BEGIN { $tests = @Support::Files::testitems; }
BEGIN { use Test::More tests => $tests; }
-@testitems = @Support::Files::testitems;
-my $verbose = $::ENV{VERBOSE};
-$perlapp=$^X;
-foreach $file (@testitems) {
- $file =~ s/\s.*$//; # nuke everything after the first space (#comment)
- next if (!$file); # skip null entries
- $command = "$perlapp -c -It/Support -MSystemexec $file 2>&1";
- $loginfo=`$command`;
- if ($loginfo =~ /arguments for Systemexec::system|exec/im) {
- ok(0,"$file DOES NOT use proper system or exec calls");
- if ($verbose) { print STDERR $loginfo; }
- } else {
- ok(1,"$file uses proper system and exec calls");
- }
+use strict;
+
+my @testitems = @Support::Files::testitems;
+my $verbose = $::ENV{TEST_VERBOSE};
+my $perlapp = $^X;
+
+foreach my $file (@testitems) {
+ $file =~ s/\s.*$//; # nuke everything after the first space (#comment)
+ next if (!$file); # skip null entries
+ my $command = "$perlapp -c -It -MSupport::Systemexec $file 2>&1";
+ my $loginfo=`$command`;
+ if ($loginfo =~ /arguments for Support::Systemexec::(system|exec)/im) {
+ ok(0,"$file DOES NOT use proper system or exec calls");
+ if ($verbose) { print STDERR $loginfo; }
+ } else {
+ ok(1,"$file uses proper system and exec calls");
+ }
}
BEGIN { $tests = @Support::Templates::testitems * 2; }
BEGIN { use Test::More tests => $tests; }
+use strict;
use Template;
my @testitems = @Support::Templates::testitems;
my $include_path = $Support::Templates::include_path;
-my $verbose = $::ENV{VERBOSE};
+my $verbose = $::ENV{TEST_VERBOSE};
# Check to make sure all templates that are referenced in
# Bugzilla exist in the proper place.
#
#################
-#Bugzilla Test 4#
+#Bugzilla Test 5#
#####no_tabs#####
BEGIN { use lib "t/"; }
BEGIN { $tests = @Support::Files::testitems; }
BEGIN { use Test::More tests => $tests; }
+use strict;
+
my @testitems = @Support::Files::testitems;
-my $verbose = $::ENV{VERBOSE};
+my $verbose = $::ENV{TEST_VERBOSE};
foreach my $file (@testitems) {
open (FILE, "$file");
+# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
my ($file) = @_;
my $exclude;
foreach $exclude (@exclude_files) {
- if ($file eq $exclude) { return undef; } # get rid of excluded files.
+ if ($file eq $exclude) { return undef; } # get rid of excluded files.
}
if ($file =~ /\.cgi$|\.pl$/) {
}
foreach $currentfile (@files) {
- if (isTestingFile($currentfile)) {
- push(@testitems,$currentfile);
- }
+ if (isTestingFile($currentfile)) {
+ push(@testitems,$currentfile);
+ }
}
-package Systemexec;
+# -*- Mode: perl; indent-tabs-mode: nil -*-
+
+package Support::Systemexec;
require Exporter;
@ISA = qw(Exporter);
@EXPORT = qw(system exec);
my @lines = <FILE>;
close (FILE);
foreach my $line (@lines) {
- if ($line =~ m/template->process\(\"(.+?)\", .+?\)/) {
+ if ($line =~ m/template->process\(\"(.+?)\", .+?\)/) {
$template = $1;
- push (@testitems, $template) unless $t{$template};
- $t{$template} = 1;
- }
+ push (@testitems, $template) unless $t{$template};
+ $t{$template} = 1;
+ }
}
}