diff tests/modules.sh @ 1:bc8961a81af6 release

2007-08-13 22:53:14 by steve Initial revision
author steve
date Mon, 13 Aug 2007 22:53:14 +0000
parents
children 8503c495b169
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/modules.sh	Mon Aug 13 22:53:14 2007 +0000
@@ -0,0 +1,35 @@
+#!/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.1.1 2007-08-13 22:53:14 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
+#
+# Steve
+# --
+#
+
+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
+