[liblouis-liblouisxml] Re: proposal for a test harness

  • From: Mesar Hameed <mesar.hameed@xxxxxxxxx>
  • To: Christian Egli <christian.egli@xxxxxx>
  • Date: Mon, 27 Feb 2012 10:23:57 +0000

Hi Christian,
On Mon 27/02/12,10:32, Christian Egli wrote:
> Hi Mesar
> 
> Mesar Hameed <mesar.hameed@xxxxxxxxx> writes:
> 
> > Yes, attached, not sure if it is as flexible as we want it to be, but it 
> > did the job for me.
> 
> I looked at your test harness and it looks very interesting. It is very
> similar in spirit to what I tried to do with corpus based tests[1]. The
> corpus based tests let you specify a file where each line is a test
> case. The first column is the expected input and the second column is
> the expected output. There is a test in svn and it is run when you type
> make check. However the test is very basic and nobody seems to have
> picked up on it or ever used it. Have a look at the README in
> tests/table_test_corpuses.

Aah, I did not spot this, and I dont think it was documented in the user facing 
liblouis.texi.
Yes I agree that the original version is similar to what you have.
Please look at the updated version, which is the more interesting and more 
useful with regard to debugging cursor problems.
Change one of the tests and look at the error report.

> Two points about your test harness:
> 
> 1. Implemented in Python: Don't get me wrong, I like Python. But
>    implementing the test harness in Python means that a user needs to
>    have it installed and also needs to have the Python bindings
>    installed before she can run the tests.

True regarding requiring python, but i think most recent posix systems come 
with it these days.
regarding installing the python bindings, I think there should be a way of 
relative import rather than requiring them to be installed.

> We can decide that these are no big problems and a user can be expected
> to install Python and the Python bindings before running the test
> harness.

I don't think the harness forces any table developer to install python, they 
can continue creating/debugging tables as before 
if they so wish.

> On the other hand the corpus based tests are implemented in
> Perl and use the standard lou_translate, i.e. no need to install Python
> and they can be run from within the liblouis src directory without any
> installation. I think I could easily extend the Perl script to cover
> your use case (just split the line on tabs instead on any white space).

I am not sure if lou_translate give us the cursor position, which is what the 
updated harness uses.

> Let me translate your example into a (what I called) corpus based test
> and we could then possibly merge the two efforts.

Yes if we can then this would be great.
I dont mind perl or python, whatever works and gives us the required 
flexibility. :)

Thanks.
Mesar
For a description of the software, to download it and links to
project pages go to http://www.abilitiessoft.com

Other related posts: