File: check_endless_loop.pl

package info (click to toggle)
liblouis 2.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 7,764 kB
  • sloc: ansic: 12,667; sh: 8,825; makefile: 855; perl: 91; python: 18
file content (21 lines) | stat: -rwxr-xr-x 611 bytes parent folder | download
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 warnings;
use strict;
$|++;

# Test a specific table with lou_checktable which causes an endless loop.
#
# Copyright (C) 2010 by Swiss Library for the Blind, Visually Impaired and Print Disabled
#
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved.

my $table="loop.ctb";

$SIG{ALRM} = sub { die "lou_checktable on $table stuck in endless loop\n" };

alarm 5;
system("lou_checktable $table --quiet") == 0 
    or die "lou_checktable on $table failed\n";
alarm 0;