1 # -*- Mode: perl; indent-tabs-mode: nil -*-
 
   3 # The contents of this file are subject to the Mozilla Public
 
   4 # License Version 1.1 (the "License"); you may not use this file
 
   5 # except in compliance with the License. You may obtain a copy of
 
   6 # the License at http://www.mozilla.org/MPL/
 
   8 # Software distributed under the License is distributed on an "AS
 
   9 # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
 
  10 # implied. See the License for the specific language governing
 
  11 # rights and limitations under the License.
 
  13 # The Original Code are the Bugzilla Tests.
 
  15 # The Initial Developer of the Original Code is Zach Lipton
 
  16 # Portions created by Zach Lipton are
 
  17 # Copyright (C) 2002 Zach Lipton.  All
 
  20 # Contributor(s): Zach Lipton <zach@zachlipton.com>
 
  30 BEGIN { # yes the indenting is off, deal with it
 
  31 #add the words to check here:
 
  54 $testcount = scalar(@Support::Files::testitems);
 
  57 use Test::More tests => $testcount;
 
  59 # Capture the TESTOUT from Test::More or Test::Builder for printing errors.
 
  60 # This will handle verbosity for us automatically.
 
  63     local $^W = 0;  # Don't complain about non-existent filehandles
 
  64     if (-e \*Test::More::TESTOUT) {
 
  65         $fh = \*Test::More::TESTOUT;
 
  66     } elsif (-e \*Test::Builder::TESTOUT) {
 
  67         $fh = \*Test::Builder::TESTOUT;
 
  73 my @testitems = @Support::Files::testitems;
 
  75 # at last, here we actually run the test...
 
  76 my $evilwordsregexp = join('|', @evilwords);
 
  78 foreach my $file (@testitems) {
 
  79     $file =~ s/\s.*$//; # nuke everything after the first space (#comment)
 
  80     next if (!$file); # skip null entries
 
  82     if (open (FILE, $file)) { # open the file for reading
 
  86         while (my $file_line = <FILE>) { # and go through the file line by line
 
  87             if ($file_line =~ /($evilwordsregexp)/i) { # found an evil word
 
  96             ok(0,"$file: found SPELLING ERROR $found_word --WARNING");
 
  98             ok(1,"$file does not contain registered spelling errors");
 
 101         ok(0,"could not open $file for spellcheck --WARNING");