4
0

test.pl.in 831 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #!/usr/bin/perl -w -I .. -I ../..
  2. #
  3. # Wrapper for running the test harnesses
  4. #
  5. use strict;
  6. use Getopt::Long;
  7. use NPTest qw(DetermineTestHarnessDirectory TestsFrom);
  8. $ENV{LC_ALL} = 'C';
  9. my @tstdir;
  10. if ( ! GetOptions( "testdir:s" => \@tstdir ) )
  11. {
  12. print "Usage: ${0} [--testdir=<directory>] [<test_harness.t> ...]\n";
  13. exit 1;
  14. }
  15. my @tests;
  16. if ( scalar( @ARGV ) )
  17. {
  18. @tests = @ARGV;
  19. }
  20. else
  21. {
  22. my @directory = DetermineTestHarnessDirectory( @tstdir );
  23. if ( @directory == 0 )
  24. {
  25. print STDERR "$0: Unable to determine the test harness directory - ABORTING\n";
  26. exit 2;
  27. }
  28. for my $d ( @directory )
  29. {
  30. push (@tests, TestsFrom( $d, 1 ));
  31. }
  32. }
  33. if ( ! scalar( @tests ) )
  34. {
  35. print STDERR "$0: Unable to determine the test harnesses to run - ABORTING\n";
  36. exit 3;
  37. }
  38. use Test::Harness;
  39. runtests( @tests );