]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Fix to make the tests generate the list of files to test instead of having to update...
authorzach%zachlipton.com <>
Mon, 17 Sep 2001 01:35:15 +0000 (01:35 +0000)
committerzach%zachlipton.com <>
Mon, 17 Sep 2001 01:35:15 +0000 (01:35 +0000)
or removed. The main logic is in t/Support/Files.pm, changes to the test files are needed to allow it to function properly.

NOT_PART_OF_BUILD. No review needed for tests at this time.

t/1compile.t
t/2goodperl.t
t/3safesys.t
t/Support/Files.pm

index 7241197ca08a175914773eab1c409a1aeb9f7095..8886d685b83d4f02f15f262c6b3e273b1cb9a76d 100644 (file)
 #################
 #Bugzilla Test 1#
 ###Compilation###
-
-BEGIN { use Test::More tests => 55; }
 BEGIN { use lib 't/'; }
 BEGIN { use Support::Files; }
+BEGIN { $tests = @Support::Files::testitems + 4; }
+BEGIN { use Test::More tests => $tests; }
 
 # First now we test the scripts                                                   
 @testitems = @Support::Files::testitems; 
index ff805b644558ec5678974cbdc7ba2ce3fea47682..8efa8367a60ae62022ff0a557eac3bcc855f912e 100644 (file)
 #Bugzilla Test 2#
 ####GoodPerl#####
 
-BEGIN { use Test::More tests => 102; }
 BEGIN { use lib 't/'; }
 BEGIN { use Support::Files; }
+BEGIN { $tests = @Support::Files::testitems * 2; }
+BEGIN { use Test::More tests => $tests; }
 
 @testitems = @Support::Files::testitems; # get the files to test.
 
index ced6d00edc0449665959a911671f4754745151e9..d114555135a71273b1aef8b67cff35683ae6ce04 100644 (file)
 #Bugzilla Test 3#
 ###Safesystem####
 
-BEGIN { use Test::More tests => 51; }
 BEGIN { use lib 't/'; }
 BEGIN { use Support::Files; }
+BEGIN { $tests = @Support::Files::testitems; }    
+BEGIN { use Test::More tests => $tests; }
 
 @testitems = @Support::Files::testitems; 
 my $verbose = $::ENV{VERBOSE};
index 753e940041c9e1724fe00384e99edc4cfd4a05e8..a2d38638fc7b2e88776675b9d84e492ee67291a9 100644 (file)
 
 package Support::Files;
 
-@testitems = split("\n",qq(
-bug_form.pl #1
-buglist.cgi #2
-changepassword.cgi #3
-checksetup.pl #4
-colchange.cgi #5
-collectstats.pl #6
-createaccount.cgi #7
-createattachment.cgi #8
-defparams.pl #9
-describecomponents.cgi #10
-describekeywords.cgi #11
-doeditparams.cgi #12
-doeditvotes.cgi #13
-duplicates.cgi #14
-editcomponents.cgi #15
-editgroups.cgi #16
-editkeywords.cgi #27
-editmilestones.cgi #18
-editparams.cgi #19
-editproducts.cgi #20
-editusers.cgi #21
-editversions.cgi #22
-enter_bug.cgi #23
-globals.pl #24
-importxml.pl #25
-long_list.cgi #26
-move.pl #27
-new_comment.cgi #28
-post_bug.cgi #29
-process_bug.cgi #30
-query.cgi #31
-queryhelp.cgi #32
-quips.cgi #33
-relogin.cgi #34
-reports.cgi #35
-sanitycheck.cgi #36
-show_activity.cgi #37
-show_bug.cgi #38
-showattachment.cgi #39
-showdependencygraph.cgi #40
-showdependencytree.cgi #41
-showvotes.cgi #42
-syncshadowdb #43
-token.cgi #44
-userprefs.cgi #45
-whineatnews.pl #46
-xml.cgi #47
-attachment.cgi #48
-editattachstatuses.cgi #49
-globals.pl #50
-CGI.pl #51
-));
+@additional_files = ('syncshadowdb');
+@exclude_files    = ('processmail');
+
+$file = '*';
+@files = glob($file);
+
+sub isTestingFile {
+  my ($file) = @_;
+  if ($file =~ /\.cgi$|\.pl$/) {
+    return 1;
+  }
+  my $additional;
+  foreach $additional (@additional_files) {
+    if ($file eq $additional) { return 1; }
+  }
+  my $exclude;
+  foreach $exclude (@exclude_files) {
+       if ($file eq $exclude) { return undef; } # get rid of excluded files.
+  }
+  return undef;
+}
+
+foreach $currentfile (@files) {
+       if (isTestingFile($currentfile)) {
+               push(@testitems,$currentfile);
+       }
+}
+
 
 1;