From f31cd40f7a014c076615c4a1c28b989162a6ca9d Mon Sep 17 00:00:00 2001 From: Ton Voon Date: Thu, 21 Aug 2008 15:18:58 +0000 Subject: Correctly link to included libtap. Simplify invoking test scripts. Removed basename test as we should use base_name from GNUlib which is tested separately git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2042 f882894a-f735-0410-b71e-b25c423dba1c --- lib/tests/test_all.t | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 lib/tests/test_all.t (limited to 'lib/tests/test_all.t') diff --git a/lib/tests/test_all.t b/lib/tests/test_all.t new file mode 100755 index 00000000..1fae81a8 --- /dev/null +++ b/lib/tests/test_all.t @@ -0,0 +1,38 @@ +#!/usr/bin/perl +# Creates $file.t for each @ARGV +# Then calls runtests for all these files + +use strict; +use Test::Harness; +use Getopt::Std; + +my $opts = {}; +getopts("v", $opts) or die "Getopt failed"; + +$Test::Harness::verbose = $opts->{v}; +$Test::Harness::switches=""; + +my $special_errors = { + test_ini => "please enable parse-ini to test", + test_opts => "please enable parse-ini to test", +}; +my $default_error = "could not compile"; + +my @tests; +foreach my $file (@ARGV) { + my $file_t = "$file.t"; + my $error = $special_errors->{ $file } || $default_error; + open F, ">", $file_t or die "Cannot open $file_t for writing"; + print F < "./$file not compiled - $error"; +} +exec "./$file"; +EOF + close F; + push @tests, $file_t; +} +chmod 0750, @tests; +runtests @tests; +unlink @tests; -- cgit v1.2.3-74-g34f1