Commit 7e406183 authored by zach%zachlipton.com's avatar zach%zachlipton.com

Fix to make the tests generate the list of files to test instead of having to…

Fix to make the tests generate the list of files to test instead of having to update the list manually whenever a file is added 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.
parent e8d520f7
...@@ -35,10 +35,10 @@ ...@@ -35,10 +35,10 @@
################# #################
#Bugzilla Test 1# #Bugzilla Test 1#
###Compilation### ###Compilation###
BEGIN { use Test::More tests => 55; }
BEGIN { use lib 't/'; } BEGIN { use lib 't/'; }
BEGIN { use Support::Files; } BEGIN { use Support::Files; }
BEGIN { $tests = @Support::Files::testitems + 4; }
BEGIN { use Test::More tests => $tests; }
# First now we test the scripts # First now we test the scripts
@testitems = @Support::Files::testitems; @testitems = @Support::Files::testitems;
......
...@@ -35,9 +35,10 @@ ...@@ -35,9 +35,10 @@
#Bugzilla Test 2# #Bugzilla Test 2#
####GoodPerl##### ####GoodPerl#####
BEGIN { use Test::More tests => 102; }
BEGIN { use lib 't/'; } BEGIN { use lib 't/'; }
BEGIN { use Support::Files; } 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. @testitems = @Support::Files::testitems; # get the files to test.
......
...@@ -35,9 +35,10 @@ ...@@ -35,9 +35,10 @@
#Bugzilla Test 3# #Bugzilla Test 3#
###Safesystem#### ###Safesystem####
BEGIN { use Test::More tests => 51; }
BEGIN { use lib 't/'; } BEGIN { use lib 't/'; }
BEGIN { use Support::Files; } BEGIN { use Support::Files; }
BEGIN { $tests = @Support::Files::testitems; }
BEGIN { use Test::More tests => $tests; }
@testitems = @Support::Files::testitems; @testitems = @Support::Files::testitems;
my $verbose = $::ENV{VERBOSE}; my $verbose = $::ENV{VERBOSE};
......
...@@ -33,58 +33,33 @@ ...@@ -33,58 +33,33 @@
package Support::Files; package Support::Files;
@testitems = split("\n",qq( @additional_files = ('syncshadowdb');
bug_form.pl #1 @exclude_files = ('processmail');
buglist.cgi #2
changepassword.cgi #3 $file = '*';
checksetup.pl #4 @files = glob($file);
colchange.cgi #5
collectstats.pl #6 sub isTestingFile {
createaccount.cgi #7 my ($file) = @_;
createattachment.cgi #8 if ($file =~ /\.cgi$|\.pl$/) {
defparams.pl #9 return 1;
describecomponents.cgi #10 }
describekeywords.cgi #11 my $additional;
doeditparams.cgi #12 foreach $additional (@additional_files) {
doeditvotes.cgi #13 if ($file eq $additional) { return 1; }
duplicates.cgi #14 }
editcomponents.cgi #15 my $exclude;
editgroups.cgi #16 foreach $exclude (@exclude_files) {
editkeywords.cgi #27 if ($file eq $exclude) { return undef; } # get rid of excluded files.
editmilestones.cgi #18 }
editparams.cgi #19 return undef;
editproducts.cgi #20 }
editusers.cgi #21
editversions.cgi #22 foreach $currentfile (@files) {
enter_bug.cgi #23 if (isTestingFile($currentfile)) {
globals.pl #24 push(@testitems,$currentfile);
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
));
1; 1;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment