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

  • From: Christian Egli <christian.egli@xxxxxx>
  • To: James Teh <jamie@xxxxxxxxxxxx>
  • Date: Fri, 02 Mar 2012 14:43:10 +0100

Hi all

James Teh <jamie@xxxxxxxxxxxx> writes:

> On 1/03/2012 11:58 PM, Christian Egli wrote:
>> What I'm going to do now is to integrate both your stuff and the
>> doctests into the build system so they are both invoked when doing a
>> `make check`. That way a writer of tests can decide which way she likes
>> better and use that.
> Multiple solutions makes for confusion and a steeper learning curve.
> Some may feel they need to learn both solutions before they know which
> they should use.

I know, I usually don't like duplication. In this case it was just that
I liked the doctest solution so much that I just implemented it. I guess
Mesar just gave me the impetus to do it. However Mesar has a good
solution and he is pushing it, so I think we should include it. On top
of that he even documented his stuff in the manual.

Both solutions are now in svn.

> The ugliest part about the doctest solution for me is the fact that
> the test writer has to mess around importing the louis module
> themselves; i.e. the sys.path hacking, etc. 

This has been alleviated somewhat by the fact that the PYTHONPATH is set
in the Makefile.am which invokes the tests, so no need to muck with the
sys.path.

> Aside from being ugly, it's a lot of duplicated boilerplate. I think
> there should at least be a harness which does the hackery so that the
> only thing needed is "import louis".

You only need to do "import louis" now. This should import the Python
module from the source directory. Haven't solved the problem with the
library path, i.e. where the louis module picks up the liblouis library
though.

Thanks
Christian

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

-----
Jetzt kostenlos eidgenoessische und kantonale Abstimmungsunterlagen aus 17 
Kantonen
zum Hoeren auf CD abonnieren: medienverlag@xxxxxx
For a description of the software, to download it and links to
project pages go to http://www.abilitiessoft.com

Other related posts: