[liblouis-liblouisxml] Corpus based table tests

  • From: Christian Egli <christian.egli@xxxxxxxx>
  • To: liblouis-liblouisxml@xxxxxxxxxxxxx
  • Date: Fri, 16 Oct 2009 16:24:46 +0200

Hi all

I've long thought it might be useful to have test cases where you
specify an input and the corresponding expected output to test the
tables. What I've implemented now is a perl script which expects any
number of test files (one for each table). These files define on each
line a pair of words (input and expected Braille translation). The perl
script is integrated with the `make check` target. This should allow
authors of translation tables to easily add tests for their table by
simply defining a corpus of test words and their corresponding known
good translation.

The implementation is in the automated-table-tests branch, so again if
you'd like to check it out, proceed as follows:
$ svn checkout 
http://liblouis.googlecode.com/svn/branches/automated-table-tests 
liblouis-automated-table-tests
$ cd liblouis-automated-table-tests
$ ./autogen.sh
$ ./configure
$ make check # optionally also make distcheck

There is a couple of questions before I merge this to trunk:

     1. Is this a generally desired feature?
     2. The test is implemented in Perl. This means that every user of
        liblouis needs to install Perl if they want to run the tests. So
        far we have only required that developers have Perl (as
        autoreconf is in Perl). Can we safely assume that every user who
        manually compiles liblouis (and wants to run the tests) has
        Perl?
     3. The test uses lou_translate (not xml2brl). This has to do with
        the fact that the test has to be self-contained within the
        package liblouis, so I cannot use xml2brl. The test can be run
        before installing anything. However the problem with
        lou_translate is that it doesn't seem to handle my UTF-8
        characters that I have in my tests for the German tables. As a
        result the test fails. How could I solve this problem?

Thanks
Christian
-- 
Christian Egli
Swiss Library for the Blind and Visually Impaired
Grubenstrasse 12, CH-8045 Zürich, Switzerland

For a description of the software and to download it go to
http://www.jjb-software.com

Other related posts:

  • » [liblouis-liblouisxml] Corpus based table tests - Christian Egli