do_tests 349 B

1234567891011121314151617181920
  1. #!/usr/bin/perl
  2. use strict;
  3. use warnings;
  4. my @tests;
  5. for (glob "test*[0-9]") {
  6. push @tests, $_ if -e "$_.ans";
  7. }
  8. my $num_failed=0;
  9. for my $test (@tests) {
  10. `./$test > $test.out`;
  11. `diff $test.out $test.ans`;
  12. print "$test failed\n" if $?;
  13. $num_failed++ if $?;
  14. }
  15. print scalar @tests . " tests conducted, $num_failed failed.\n";