1
0
mirror of synced 2026-01-21 09:53:08 +00:00

2005-12-17 14:25:23 by steve

Added test script.
This commit is contained in:
steve 2005-12-17 14:25:23 +00:00
parent 63a7b5d906
commit 3dce31e5ca
3 changed files with 78 additions and 0 deletions

17
tests/Makefile Normal file
View File

@ -0,0 +1,17 @@
all:
@cd ..; perl -MTest::Harness -e '$$Test::Harness::verbose=0; runtests @ARGV;' tests/*.t
verbose:
@cd ..; perl -MTest::Harness -e '$$Test::Harness::verbose=1; runtests @ARGV;' tests/*.t
modules: .PHONY
./modules.sh > modules.t
.PHONY:
true
clean:
rm *~

32
tests/modules.sh Executable file
View File

@ -0,0 +1,32 @@
#!/bin/sh
#
# Automatically attempt to create a test which ensures all the modules
# used in the code are availabe.
#
# Steve
# --
# http://www.steve.org.uk/
#
# $Id: modules.sh,v 1.1 2005-12-17 14:25:23 steve Exp $
#
cat <<EOF
#!/usr/bin/perl -w -I..
#
# Test that all the Perl modules we require are available.
#
# This list is automatically generated by modules.sh
#
use Test::More qw( no_plan );
EOF
for i in `rgrep '^use ' .. | awk '{print $2}' | tr -d \;\(\) | sort | uniq`; \
do \
echo "BEGIN{ use_ok( '$i' ); }"; \
echo "require_ok( '$i' );" ; \
echo -e "\n" ; \
done

29
tests/modules.t Normal file
View File

@ -0,0 +1,29 @@
#!/usr/bin/perl -w -I..
#
# Test that all the Perl modules we require are available.
#
# This list is automatically generated by modules.sh
#
use Test::More qw( no_plan );
BEGIN{ use_ok( 'File::Copy' ); }
require_ok( 'File::Copy' );
BEGIN{ use_ok( 'File::Temp' ); }
require_ok( 'File::Temp' );
BEGIN{ use_ok( 'Getopt::Long' ); }
require_ok( 'Getopt::Long' );
BEGIN{ use_ok( 'strict' ); }
require_ok( 'strict' );
BEGIN{ use_ok( 'Test::More' ); }
require_ok( 'Test::More' );