blob: 0a4ced3510a2c56094e4db15bccab12d8ae2d01b [file] [log] [blame]
Christian Eglifcffc982011-03-14 09:44:55 +00001#!/usr/bin/perl
2use warnings;
3use strict;
4use Cwd 'abs_path';
5$|++;
6
7# Test a specific table with lou_checktable which causes an endless loop.
8#
9# Copyright (C) 2011 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.
14
15my @tables = (
16 # a global table
17 "en-us-g2.ctb",
18 # a local table
19 "loop.ctb",
20 # a table with a relative path
Christian Egli4fc1ad62011-03-30 09:37:02 +000021 "$ENV{srcdir}/tables/loop.ctb",
Christian Eglifcffc982011-03-14 09:44:55 +000022 # a list of tables with a relative path
Christian Egli4fc1ad62011-03-30 09:37:02 +000023 "$ENV{srcdir}/../tables/en-us-g2.ctb,en-us-g1.ctb",
Christian Eglifcffc982011-03-14 09:44:55 +000024 # a table with an absolute path
Christian Egli4fc1ad62011-03-30 09:37:02 +000025 abs_path("$ENV{srcdir}/tables/loop.ctb"),
Christian Eglifcffc982011-03-14 09:44:55 +000026 # a list of tables with an absolute path
Christian Egli4fc1ad62011-03-30 09:37:02 +000027 abs_path("$ENV{srcdir}/../tables/en-us-g2.ctb") . ",en-us-g1.ctb"
Christian Eglifcffc982011-03-14 09:44:55 +000028 );
29
30# ensure existing tables are found
31foreach my $table (@tables) {
Christian Egli2ac36f72011-03-14 13:10:39 +000032 system("lou_checktable $table --quiet") == 0 or die;
Christian Eglifcffc982011-03-14 09:44:55 +000033}
34
35# ensure a non-existing table is not found
36system("lou_checktable nonexistent.ctb 2> /dev/null") != 0 or die;