File: test.pl

package info (click to toggle)
pristine-tar 1.50%2Bnmu2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,116 kB
  • sloc: ansic: 9,417; perl: 2,019; sh: 371; makefile: 211; python: 109
file content (34 lines) | stat: -rw-r--r-- 536 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
use strict;
use warnings;

my $rc     = 0;
my @failed = ();

if (scalar(@ARGV) == 0) {
  @ARGV = glob('test/test_*.sh');
}

for my $test (@ARGV) {
  printf("%s\n", $test);
  printf("%s\n", '-' x length($test));
  printf("\n");

  if (system('bash', $test) != 0) {
    push @failed, $test;
  }
}

if (scalar(@failed) > 0) {
  $rc = 1;
  print "\n";
  print "FAILED TEST FILES:\n";
  print "------------------\n";
  for my $failed (@failed) {
    print "$failed\n";
  }
  print "\n";
} else {
  print "All tests passed!\n";
}

exit($rc);