File: do_tests

package info (click to toggle)
uthash 2.3.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,788 kB
  • sloc: ansic: 9,838; makefile: 178; perl: 88; sh: 37; cpp: 30
file content (21 lines) | stat: -rwxr-xr-x 367 bytes parent folder | download | duplicates (15)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/perl

use strict;
use warnings;

my @tests;
for (glob "test*[0-9]") {
    push @tests, $_ if -e "$_.ans";
}

my $num_failed=0;

for my $test (@tests) {
    `./$test > $test.out`;
    `diff $test.out $test.ans`;
    print "$test failed\n" if $?;
    $num_failed++ if $?;
}

print scalar @tests . " tests conducted, $num_failed failed.\n";
exit $num_failed;