Debian Codegraph @

tests/check_endless_loop.pl

raw
1 #!/usr/bin/perl
2 use warnings;
3 use strict;
4 use Cwd 'abs_path';
5 $|++;
6
7 # Test a specific table with lou_checktable which causes an endless loop.
8 #
9 # Copyright (C) 2010,2018 by Swiss Library for the Blind, Visually Impaired and Print Disabled
10 #
11 # Copying and distribution of this file, with or without modification,
12 # are permitted in any medium without royalty provided the copyright
13 # notice and this notice are preserved. This file is offered as-is,
14 # without any warranty.
15
16 my $abs_top_srcdir = abs_path("$ENV{srcdir}/..");
17
18 my @paths = (
19 "$abs_top_srcdir/tables",
20 "$abs_top_srcdir/tests/tables",
21 );
22
23 $ENV{"LOUIS_TABLEPATH"} = join(",", @paths);
24
25 my $table="loop.ctb";
26
27 $SIG{ALRM} = sub { die "lou_checktable on $table stuck in endless loop\n" };
28
29 alarm 5;
30 system("../tools/lou_checktable $table --quiet") == 0
31 or die "lou_checktable on $table failed\n";
32 alarm 0;