Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
5ac0fa09
Commit
5ac0fa09
authored
Dec 03, 2012
by
Frédéric Buclin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 817634: Tests in t/ should also check themselves where appropriate
r=glob a=LpSolit
parent
0d02249a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
26 deletions
+33
-26
001compile.t
t/001compile.t
+3
-2
005whitespace.t
t/005whitespace.t
+3
-2
006spellcheck.t
t/006spellcheck.t
+25
-22
Files.pm
t/Support/Files.pm
+2
-0
No files found.
t/001compile.t
View file @
5ac0fa09
...
...
@@ -15,7 +15,8 @@ use 5.10.1;
use lib qw(. lib t);
use Config;
use Support::Files;
use Test::More tests => scalar(@Support::Files::testitems);
use Test::More tests => scalar(@Support::Files::testitems)
+ scalar(@Support::Files::test_files);
BEGIN {
use_ok('Bugzilla::Constants');
...
...
@@ -59,7 +60,7 @@ sub compile_file {
ok(!$return_val, $file) or diag('--ERROR');
}
my @testitems =
@Support::Files::testitems
;
my @testitems =
(@Support::Files::testitems, @Support::Files::test_files)
;
my $file_features = map_files_to_features();
# Test the scripts by compiling them
...
...
t/005whitespace.t
View file @
5ac0fa09
...
...
@@ -17,10 +17,11 @@ use Support::Files;
use Support::Templates;
use File::Spec;
use Test::More tests => ( scalar(@Support::Files::testitems)
use Test::More tests => (scalar(@Support::Files::testitems)
+ scalar(@Support::Files::test_files)
+ $Support::Templates::num_actual_files) * 3;
my @testitems =
@Support::Files::testitems
;
my @testitems =
(@Support::Files::testitems, @Support::Files::test_files)
;
for my $path (@Support::Templates::include_paths) {
push(@testitems, map(File::Spec->catfile($path, $_),
Support::Templates::find_actual_files($path)));
...
...
t/006spellcheck.t
View file @
5ac0fa09
...
...
@@ -13,29 +13,29 @@
use lib 't';
use Support::Files;
BEGIN { # yes the indenting is off, deal with it
#add the words to check here:
@evilwords = qw(
anyways
appearence
arbitary
cancelled
critera
databasa
dependan
existance
existant
paramater
refered
repsentation
suported
varsion
);
$testcount = scalar(@Support::Files::testitems);
BEGIN {
#add the words to check here:
@evilwords = qw(
anyways
appearence
arbitary
cancelled
critera
databasa
dependan
existance
existant
paramater
refered
repsentation
suported
varsion
);
}
use Test::More tests => $testcount;
# -1 because 006spellcheck.t must not be checked.
use Test::More tests => scalar(@Support::Files::testitems)
+ scalar(@Support::Files::test_files) - 1;
# Capture the TESTOUT from Test::More or Test::Builder for printing errors.
# This will handle verbosity for us automatically.
...
...
@@ -51,7 +51,7 @@ my $fh;
}
}
my @testitems =
@Support::Files::testitems
;
my @testitems =
(@Support::Files::testitems, @Support::Files::test_files)
;
# at last, here we actually run the test...
my $evilwordsregexp = join('|', @evilwords);
...
...
@@ -59,6 +59,9 @@ my $evilwordsregexp = join('|', @evilwords);
foreach my $file (@testitems) {
$file =~ s/\s.*$//; # nuke everything after the first space (#comment)
next if (!$file); # skip null entries
# Do not try to validate this file as it obviously contains a list
# of wrongly spelled words.
next if ($file eq 't/006spellcheck.t');
if (open (FILE, $file)) { # open the file for reading
...
...
t/Support/Files.pm
View file @
5ac0fa09
...
...
@@ -24,6 +24,8 @@ foreach my $extension (@extensions) {
find
(
sub
{
push
(
@files
,
$
File::Find::
name
)
if
$_
=~
/\.pm$/
;},
$extension
);
}
@test_files
=
glob
(
't/*.t'
);
sub
isTestingFile
{
my
(
$file
)
=
@_
;
my
$exclude
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment