Christian Egli | fcffc98 | 2011-03-14 09:44:55 +0000 | [diff] [blame] | 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) 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 | |
| 15 | my @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 Egli | 4fc1ad6 | 2011-03-30 09:37:02 +0000 | [diff] [blame] | 21 | "$ENV{srcdir}/tables/loop.ctb", |
Christian Egli | fcffc98 | 2011-03-14 09:44:55 +0000 | [diff] [blame] | 22 | # a list of tables with a relative path |
Christian Egli | 4fc1ad6 | 2011-03-30 09:37:02 +0000 | [diff] [blame] | 23 | "$ENV{srcdir}/../tables/en-us-g2.ctb,en-us-g1.ctb", |
Christian Egli | fcffc98 | 2011-03-14 09:44:55 +0000 | [diff] [blame] | 24 | # a table with an absolute path |
Christian Egli | 4fc1ad6 | 2011-03-30 09:37:02 +0000 | [diff] [blame] | 25 | abs_path("$ENV{srcdir}/tables/loop.ctb"), |
Christian Egli | fcffc98 | 2011-03-14 09:44:55 +0000 | [diff] [blame] | 26 | # a list of tables with an absolute path |
Christian Egli | 1dd80c3 | 2012-04-17 08:13:59 +0000 | [diff] [blame^] | 27 | abs_path("$ENV{srcdir}/../tables/en-us-g2.ctb") . ",en-us-g1.ctb", |
| 28 | # table combinations |
| 29 | # all global tables |
| 30 | "en-us-g2.ctb,braille-patterns.cti", |
| 31 | # a global and a local table |
| 32 | "braille-patterns.cti,pass2.ctb", |
| 33 | # a local and a global table |
| 34 | "pass2.ctb,braille-patterns.cti", |
| 35 | # a relative, a local and a global table |
| 36 | "$ENV{srcdir}/tables/loop.ctb,pass2.ctb,braille-patterns.cti", |
| 37 | # a table which includes local and global tables |
| 38 | "include.utb", |
| 39 | # a relative table and a table which includes local and global tables |
| 40 | # currently fails |
| 41 | # "$ENV{srcdir}/tables/loop.ctb,include.utb", |
Christian Egli | fcffc98 | 2011-03-14 09:44:55 +0000 | [diff] [blame] | 42 | ); |
| 43 | |
| 44 | # ensure existing tables are found |
| 45 | foreach my $table (@tables) { |
Christian Egli | 2ac36f7 | 2011-03-14 13:10:39 +0000 | [diff] [blame] | 46 | system("lou_checktable $table --quiet") == 0 or die; |
Christian Egli | fcffc98 | 2011-03-14 09:44:55 +0000 | [diff] [blame] | 47 | } |
| 48 | |
| 49 | # ensure a non-existing table is not found |
| 50 | system("lou_checktable nonexistent.ctb 2> /dev/null") != 0 or die; |