test.pl.in 782 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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 ( !defined( $directory ) )
  23. {
  24. print STDERR "$0: Unable to determine the test harness directory - ABORTING\n";
  25. exit 2;
  26. }
  27. @tests = TestsFrom( $directory, 1 );
  28. }
  29. if ( ! scalar( @tests ) )
  30. {
  31. print STDERR "$0: Unable to determine the test harnesses to run - ABORTING\n";
  32. exit 3;
  33. }
  34. use Test::Harness;
  35. runtests( @tests );