view tests/modules.sh @ 256:5ea9f2d8bd8e

Don't test for the existance of POSIX.pm, as per http://www.perlmonks.org/?node_id=689911
author Steve Kemp <steve@steve.org.uk>
date Tue, 03 Jun 2008 21:48:39 +0100
parents 00ed5b99ccb0
children
line wrap: on
line source

#!/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/
#
#

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
#
# Steve
# --
#

use Test::More qw( no_plan );

EOF


for i in `rgrep '^use ' .. | grep -v POSIX | awk '{print $2}' | tr -d 
\;\(\) | sort | uniq`; \
    do \
     echo "BEGIN{ use_ok( '$i' ); }"; \
     echo "require_ok( '$i' );" ; \
     echo -e "\n" ; \
done