Ported all tests
This commit is contained in:
parent
734484f48e
commit
83d59837fd
15 changed files with 84 additions and 318 deletions
|
|
@ -8,20 +8,21 @@
|
|||
# http://www.plainblack.com info@plainblack.com
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
# ---- BEGIN DO NOT EDIT ----
|
||||
use FindBin;
|
||||
use strict;
|
||||
use lib '../lib';
|
||||
use Getopt::Long;
|
||||
use lib "$FindBin::Bin/lib";
|
||||
|
||||
use WebGUI::Test;
|
||||
use File::Find;
|
||||
use WebGUI::Session;
|
||||
# ---- END DO NOT EDIT ----
|
||||
use Test::More;
|
||||
|
||||
plan skip_all => 'set TEST_SYNTAX to enable this test' unless $ENV{TEST_SYNTAX};
|
||||
|
||||
use Test::More; # increment this value for each test you create
|
||||
my @modules;
|
||||
my $wgLib = "../lib/";
|
||||
my $wgLib = WebGUI::Test->lib;
|
||||
diag("Checking modules in $wgLib");
|
||||
File::Find::find(\&getWebGUIModules, $wgLib);
|
||||
File::Find::find( \&getWebGUIModules, $wgLib);
|
||||
|
||||
my $numTests = scalar @modules;
|
||||
|
||||
|
|
@ -30,36 +31,11 @@ plan tests => $numTests;
|
|||
diag("Planning on $numTests tests");
|
||||
|
||||
foreach my $package (@modules) {
|
||||
my $returnVal = system("export PERL5LIB=$wgLib; perl -wc $package");
|
||||
my $returnVal = system("$^X -I$wgLib -wc $package");
|
||||
is($returnVal, 0, "syntax check for $package");
|
||||
}
|
||||
|
||||
my $session = initialize(); # this line is required
|
||||
|
||||
# put your tests here
|
||||
|
||||
cleanup($session); # this line is required
|
||||
|
||||
#----------------------------------------
|
||||
sub getWebGUIModules {
|
||||
push(@modules,$File::Find::name) if /\.pm$/;
|
||||
push( @modules, $File::Find::name ) if /\.pm$/;
|
||||
}
|
||||
|
||||
|
||||
# ---- DO NOT EDIT BELOW THIS LINE -----
|
||||
|
||||
sub initialize {
|
||||
$|=1; # disable output buffering
|
||||
my $configFile;
|
||||
GetOptions(
|
||||
'configFile=s'=>\$configFile
|
||||
);
|
||||
exit 1 unless ($configFile);
|
||||
my $session = WebGUI::Session->open("..",$configFile);
|
||||
}
|
||||
|
||||
sub cleanup {
|
||||
my $session = shift;
|
||||
$session->close();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue