test.pl.in 810 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. my @tstdir;
  9. if ( ! GetOptions( "testdir:s" => \@tstdir ) )
  10. {
  11. print "Usage: ${0} [--testdir=<directory>] [<test_harness.t> ...]\n";
  12. exit 1;
  13. }
  14. my @tests;
  15. if ( scalar( @ARGV ) )
  16. {
  17. @tests = @ARGV;
  18. }
  19. else
  20. {
  21. my @directory = DetermineTestHarnessDirectory( @tstdir );
  22. if ( @directory == 0 )
  23. {
  24. print STDERR "$0: Unable to determine the test harness directory - ABORTING\n";
  25. exit 2;
  26. }
  27. for my $d ( @directory )
  28. {
  29. push (@tests, TestsFrom( $d, 1 ));
  30. }
  31. }
  32. if ( ! scalar( @tests ) )
  33. {
  34. print STDERR "$0: Unable to determine the test harnesses to run - ABORTING\n";
  35. exit 3;
  36. }
  37. use Test::Harness;
  38. runtests( @tests );