Use "$maintests" everywhere

This commit is contained in:
Xavier Guimard 2018-02-08 21:55:21 +01:00
parent 5c6e3307bd
commit 204d851792
17 changed files with 53 additions and 53 deletions

View File

@ -5,14 +5,14 @@ use IO::String;
require 't/test-lib.pm';
my $res;
my $mainTests = 8;
my $maintests = 8;
eval { unlink 't/userdb.db' };
SKIP: {
eval { require DBI; require DBD::SQLite; };
if ($@) {
skip 'DBD::SQLite not found', $mainTests;
skip 'DBD::SQLite not found', $maintests;
}
my $dbh = DBI->connect("dbi:SQLite:dbname=t/userdb.db");
$dbh->do('CREATE TABLE users (user text,password text,cn text)');
@ -85,5 +85,5 @@ SKIP: {
clean_sessions();
}
eval { unlink 't/userdb.db' };
count($mainTests);
count($maintests);
done_testing( count() );

View File

@ -81,14 +81,14 @@ use IO::String;
require 't/test-lib.pm';
my $res;
my $mainTests = 6;
my $maintests = 6;
eval { unlink 't/userdb.db' };
SKIP: {
eval { require DBI; require DBD::SQLite; use Digest::SHA };
if ($@) {
skip 'DBD::SQLite not found', $mainTests;
skip 'DBD::SQLite not found', $maintests;
}
my $dbh = DBI->connect("dbi:SQLite:dbname=t/userdb.db");
@ -202,5 +202,5 @@ SKIP: {
clean_sessions();
}
eval { unlink 't/userdb.db' };
count($mainTests);
count($maintests);
done_testing( count() );

View File

@ -5,14 +5,14 @@ use IO::String;
require 't/test-lib.pm';
my $res;
my $mainTests = 3;
my $maintests = 3;
eval { unlink 't/userdb.db' };
SKIP: {
eval { require DBI; require DBD::SQLite; };
if ($@) {
skip 'DBD::SQLite not found', $mainTests;
skip 'DBD::SQLite not found', $maintests;
}
my $dbh = DBI->connect("dbi:SQLite:dbname=t/userdb.db");
$dbh->do('CREATE TABLE users (user text,password text,name text)');
@ -80,5 +80,5 @@ SKIP: {
clean_sessions();
}
eval { unlink 't/userdb.db' };
count($mainTests);
count($maintests);
done_testing( count() );

View File

@ -5,10 +5,10 @@ use IO::String;
require 't/test-lib.pm';
my $res;
my $mainTests = 8;
my $maintests = 8;
SKIP: {
skip 'LLNGTESTLDAP is not set', $mainTests unless ( $ENV{LLNGTESTLDAP} );
skip 'LLNGTESTLDAP is not set', $maintests unless ( $ENV{LLNGTESTLDAP} );
require 't/test-ldap.pm';
my $client = LLNG::Manager::Test->new(
@ -78,6 +78,6 @@ SKIP: {
clean_sessions();
}
count($mainTests);
count($maintests);
stopLdapServer() if $ENV{LLNGTESTLDAP};
done_testing( count() );

View File

@ -5,10 +5,10 @@ use IO::String;
require 't/test-lib.pm';
my $res;
my $mainTests = 3;
my $maintests = 3;
SKIP: {
skip 'LLNGTESTLDAP is not set', $mainTests unless ( $ENV{LLNGTESTLDAP} );
skip 'LLNGTESTLDAP is not set', $maintests unless ( $ENV{LLNGTESTLDAP} );
require 't/test-ldap.pm';
my $client = LLNG::Manager::Test->new(
@ -73,6 +73,6 @@ SKIP: {
$client->logout($id);
clean_sessions();
}
count($mainTests);
count($maintests);
stopLdapServer() if $ENV{LLNGTESTLDAP};
done_testing( count() );

View File

@ -5,10 +5,10 @@ use IO::String;
require 't/test-lib.pm';
my $res;
my $mainTests = 1;
my $maintests = 1;
SKIP: {
skip 'No AD server given', $mainTests unless ( $ENV{ADSERVER} );
skip 'No AD server given', $maintests unless ( $ENV{ADSERVER} );
my $client = LLNG::Manager::Test->new(
{
@ -45,5 +45,5 @@ SKIP: {
clean_sessions();
}
count($mainTests);
count($maintests);
done_testing( count() );

View File

@ -3,11 +3,11 @@ use strict;
use IO::String;
my $res;
my $mainTests = 2;
my $maintests = 2;
require 't/test-lib.pm';
SKIP: {
skip 'REMOTELLNG is not set', $mainTests unless ( $ENV{REMOTELLNG} );
skip 'REMOTELLNG is not set', $maintests unless ( $ENV{REMOTELLNG} );
my $client = LLNG::Manager::Test->new(
{
ini => {
@ -33,5 +33,5 @@ SKIP: {
$client->logout($id);
clean_sessions();
}
count($mainTests);
count($maintests);
done_testing( count() );

View File

@ -5,16 +5,16 @@ use IO::String;
require 't/test-lib.pm';
my $res;
my $mainTests = 2;
my $maintests = 2;
eval { unlink 't/userdb.db' };
SKIP: {
eval { require DBI; require DBD::SQLite; };
if ($@) {
skip 'DBD::SQLite not found', $mainTests;
skip 'DBD::SQLite not found', $maintests;
}
skip 'LLNGTESTLDAP is not set', $mainTests unless ( $ENV{LLNGTESTLDAP} );
skip 'LLNGTESTLDAP is not set', $maintests unless ( $ENV{LLNGTESTLDAP} );
require 't/test-ldap.pm';
my $dbh = DBI->connect("dbi:SQLite:dbname=t/userdb.db");
$dbh->do('CREATE TABLE users (user text,password text,name text)');
@ -73,7 +73,7 @@ SKIP: {
clean_sessions();
}
count($mainTests);
count($maintests);
eval { unlink 't/userdb.db' };
stopLdapServer() if $ENV{LLNGTESTLDAP};
clean_sessions();

View File

@ -9,7 +9,7 @@ BEGIN {
}
eval { unlink 't/userdb.db' };
my $mainTests = 16;
my $maintests = 16;
my $debug = 'error';
my ( $issuer, $sp, $res );
my %handlerOR = ( issuer => [], sp => [] );
@ -17,11 +17,11 @@ my %handlerOR = ( issuer => [], sp => [] );
SKIP: {
eval "use Lasso";
if ($@) {
skip 'Lasso not found', $mainTests;
skip 'Lasso not found', $maintests;
}
eval { require DBI; require DBD::SQLite; };
if ($@) {
skip 'DBD::SQLite not found', $mainTests;
skip 'DBD::SQLite not found', $maintests;
}
my $dbh = DBI->connect("dbi:SQLite:dbname=t/userdb.db");
$dbh->do('CREATE TABLE users (user text,password text,name text,uid text,cn text,mail text)');
@ -176,7 +176,7 @@ SKIP: {
clean_sessions();
}
count($mainTests);
count($maintests);
eval { unlink 't/userdb.db' };
done_testing( count() );

View File

@ -8,7 +8,7 @@ BEGIN {
}
eval { unlink 't/userdb.db' };
my $mainTests = 14;
my $maintests = 14;
my $debug = 'error';
my ( $issuer, $sp, $res );
my %handlerOR = ( issuer => [], sp => [] );
@ -18,7 +18,7 @@ no warnings 'redefine';
SKIP: {
eval { require DBI; require DBD::SQLite; };
if ($@) {
skip 'DBD::SQLite not found', $mainTests;
skip 'DBD::SQLite not found', $maintests;
}
my $dbh = DBI->connect("dbi:SQLite:dbname=t/userdb.db");
$dbh->do(
@ -163,7 +163,7 @@ SKIP: {
clean_sessions();
}
count($mainTests);
count($maintests);
eval { unlink 't/userdb.db' };
done_testing( count() );

View File

@ -8,14 +8,14 @@ BEGIN {
}
my $debug = 'error';
my $mainTests = 18;
my $maintests = 18;
my ( $op, $rp, $res );
my %handlerOR = ( op => [], rp => [] );
SKIP: {
eval { require DBI; require DBD::SQLite; };
if ($@) {
skip 'DBD::SQLite not found', $mainTests;
skip 'DBD::SQLite not found', $maintests;
}
my $dbh = DBI->connect("dbi:SQLite:dbname=t/userdb.db");
$dbh->do('CREATE TABLE users (user text,password text,name text)');
@ -182,7 +182,7 @@ SKIP: {
#print STDERR Dumper($res);
count($mainTests);
count($maintests);
eval { unlink 't/userdb.db' };
done_testing( count() );

View File

@ -5,7 +5,7 @@ use IO::String;
require 't/test-lib.pm';
my $res;
my $mainTests = 0;
my $maintests = 0;
my $client;
eval { unlink 't/userdb.db' };
@ -13,7 +13,7 @@ eval { unlink 't/userdb.db' };
SKIP: {
eval { require DBI; require DBD::SQLite; };
if ($@) {
skip 'DBD::SQLite not found', $mainTests;
skip 'DBD::SQLite not found', $maintests;
}
my $dbh = DBI->connect("dbi:SQLite:dbname=t/userdb.db");
$dbh->do('CREATE TABLE users (user text,password text,name text)');
@ -24,7 +24,7 @@ SKIP: {
expectCookie( try('dwho') );
expectCookie( try('dvador') );
}
count($mainTests);
count($maintests);
clean_sessions();
eval { unlink 't/userdb.db' };
done_testing( count() );

View File

@ -5,7 +5,7 @@ use IO::String;
require 't/test-lib.pm';
my $res;
my $mainTests = 0;
my $maintests = 0;
my $client;
eval { unlink 't/userdb.db' };
@ -13,7 +13,7 @@ eval { unlink 't/userdb.db' };
SKIP: {
eval { require DBI; require DBD::SQLite; };
if ($@) {
skip 'DBD::SQLite not found', $mainTests;
skip 'DBD::SQLite not found', $maintests;
}
my $dbh = DBI->connect("dbi:SQLite:dbname=t/userdb.db");
$dbh->do('CREATE TABLE users (user text,password text,name text)');
@ -39,7 +39,7 @@ SKIP: {
expectCookie( try('dvador') );
expectReject( try('dwho'), 5 );
}
count($mainTests);
count($maintests);
clean_sessions();
eval { unlink 't/userdb.db' };
done_testing( count() );

View File

@ -5,7 +5,7 @@ use IO::String;
require 't/test-lib.pm';
my $res;
my $mainTests = 0;
my $maintests = 0;
my $client;
eval { unlink 't/userdb.db' };
@ -13,7 +13,7 @@ eval { unlink 't/userdb.db' };
SKIP: {
eval { require DBI; require DBD::SQLite; };
if ($@) {
skip 'DBD::SQLite not found', $mainTests;
skip 'DBD::SQLite not found', $maintests;
}
my $dbh = DBI->connect("dbi:SQLite:dbname=t/userdb.db");
$dbh->do('CREATE TABLE users (user text,password text,name text)');
@ -39,7 +39,7 @@ SKIP: {
expectCookie( try('dvador') );
expectReject( try('dwho') );
}
count($mainTests);
count($maintests);
clean_sessions();
eval { unlink 't/userdb.db' };
done_testing( count() );

View File

@ -4,14 +4,14 @@ use IO::String;
my $res;
my $file = 't/notifications.db';
my $mainTests = 6;
my $maintests = 6;
eval { unlink $file };
require 't/test-lib.pm';
SKIP: {
eval { require DBI; require DBD::SQLite; };
if ($@) {
skip 'DBD::SQLite not found', $mainTests;
skip 'DBD::SQLite not found', $maintests;
}
my $dbh = DBI->connect("dbi:SQLite:dbname=$file");
@ -122,6 +122,6 @@ q{INSERT INTO notifications VALUES ('dwho','testref','2016-05-30 00:00:00',?,nul
}
count($mainTests);
count($maintests);
done_testing( count() );

View File

@ -4,7 +4,7 @@ use IO::String;
my $res;
my $file = 't/notifications.db';
my $mainTests = 6;
my $maintests = 6;
eval { unlink $file };
require 't/test-lib.pm';
@ -16,7 +16,7 @@ SKIP: {
require XML::LibXSLT;
};
if ($@) {
skip 'DBD::SQLite or XML::Lib* not found', $mainTests;
skip 'DBD::SQLite or XML::Lib* not found', $maintests;
}
my $dbh = DBI->connect("dbi:SQLite:dbname=$file");
@ -121,6 +121,6 @@ qq{INSERT INTO notifications VALUES ('dwho','testref','2016-05-30 00:00:00','<?x
}
count($mainTests);
count($maintests);
done_testing( count() );

View File

@ -6,12 +6,12 @@ require 't/test-lib.pm';
my $res;
my $file = 't/20160530_dwho_dGVzdHJlZg==.xml';
my $mainTests = 6;
my $maintests = 6;
SKIP: {
eval { require XML::LibXML; require XML::LibXSLT; };
if ($@) {
skip 'XML::LibX* not found', $mainTests;
skip 'XML::LibX* not found', $maintests;
}
open F, "> $file" or die($!);
@ -108,5 +108,5 @@ SKIP: {
}
count($mainTests);
count($maintests);
done_testing( count() );