5
my $TEST_CORPUS_PREFIX = "$ENV{srcdir}/table_test_corpuses/test_";
13
for my $test_corpus (glob "$TEST_CORPUS_PREFIX*") {
14
my ($table) = ($test_corpus =~ /^$TEST_CORPUS_PREFIX(.*)$/);
16
# ignore tables which are not vaild
17
unless (system("lou_checktable $table > /dev/null 2>&1") == 0) {
18
print "Table $table doesn't seem to be valid. Skipping it.\n";
22
open(CORPUS, "<", $test_corpus) or die "cannot open test corpus: $test_corpus\n";
24
print "Testing $table...\n";
31
# ignore comment and empty lines
34
my ($untranslated, $expected_translation) = split;
36
my $translation = `echo $untranslated | lou_translate -f $table`;
38
unless ($expected_translation eq $translation) {
39
print "Translation error: '$translation' expected '$expected_translation'\n";
44
print "Tested $word_counter words. ";
45
if ($failed_counter == 0) {
46
print "All translations are correct.\n";
48
print "$failed_counter words failed with a wrong translation.\n";
52
print "Tested $table_counter tables.\n";