1
0
mirror of synced 2026-04-15 23:51:03 +00:00

2007-09-04 20:30:25 by steve

Added new tests for our modular code.
This commit is contained in:
steve
2007-09-04 20:30:25 +00:00
parent 76ed3abe83
commit 47c7161386
6 changed files with 73 additions and 8 deletions

10
t/00-load.t Executable file
View File

@@ -0,0 +1,10 @@
#!/usr/bin/perl -I../lib -I./lib
use Test::More tests => 2;
BEGIN {
use_ok( 'Xen::Tools' );
use_ok( 'Xen::Tools::Log' );
}
diag( "Testing Xen::Tools $Xen::Tools::VERSION, Perl $], $^X" );

View File

@@ -7,7 +7,7 @@
#
# Steve
# --
# $Id: getopt.t,v 1.1 2007-09-01 19:23:10 steve Exp $
# $Id: getopt.t,v 1.2 2007-09-04 20:30:25 steve Exp $
use strict;
@@ -20,6 +20,9 @@ use Test::More qw( no_plan );
#
foreach my $file ( sort( glob "./bin/*-*" ) )
{
# Skip emacs and CVS backups
next if $file =~ /~$/;
testFile( $file );
}

18
t/pod-coverage.t Executable file
View File

@@ -0,0 +1,18 @@
use strict;
use warnings;
use Test::More;
# Ensure a recent version of Test::Pod::Coverage
my $min_tpc = 1.08;
eval "use Test::Pod::Coverage $min_tpc";
plan skip_all => "Test::Pod::Coverage $min_tpc required for testing POD coverage"
if $@;
# Test::Pod::Coverage doesn't require a minimum Pod::Coverage version,
# but older versions don't recognize some common documentation styles
my $min_pc = 0.17;
eval "use Pod::Coverage $min_pc";
plan skip_all => "Pod::Coverage $min_pc required for testing POD coverage"
if $@;
all_pod_coverage_ok();

16
t/pod.t
View File

@@ -1,17 +1,19 @@
#!/usr/bin/perl -w
#!/usr/bin/perl
#
# Test that the POD we use in our modules is valid.
#
use strict;
use warnings;
use Test::More;
eval "use Test::Pod 1.00";
plan skip_all => "Test::Pod 1.00 required for testing POD" if $@;
# Ensure a recent version of Test::Pod
my $min_tp = 1.08;
eval "use Test::Pod $min_tp";
plan skip_all => "Test::Pod $min_tp required for testing POD" if $@;
#
# Run the test(s).
#
my @poddirs = qw( bin );
all_pod_files_ok( all_pod_files( @poddirs ) );
all_pod_files_ok();

17
t/xen-tools-log.t Executable file
View File

@@ -0,0 +1,17 @@
#!/usr/bin/perl -I../lib -I./lib
use strict;
use warnings;
use Test::More tests => 1;
use File::Temp;
use Xen::Tools::Log;
my $dir = File::Temp::tempdir( CLEANUP => 1 );
my $xtl = Xen::Tools::Log->new( hostname => 'xen-tools-log-test',
logpath => $dir,
);
ok( $xtl->isa('Xen::Tools::Log') );

15
t/xen-tools.t Executable file
View File

@@ -0,0 +1,15 @@
#!/usr/bin/perl -I../lib -I./lib
#
# Test we can load the (stub) Xen::Tools package.
#
use strict;
use warnings;
use Test::More tests => 1;
use Xen::Tools;
my $xt = Xen::Tools->new( hostname => 'xen-tools-test' );
ok( $xt->isa('Xen::Tools') );