[liblouis-liblouisxml] Re: New test framework for liblouisutdml Java bindings

  • From: "Michael Whapples" <dmarc-noreply@xxxxxxxxxxxxx> (Redacted sender "mwhapples@xxxxxxx" for DMARC)
  • To: liblouis-liblouisxml@xxxxxxxxxxxxx
  • Date: Tue, 15 Jul 2014 11:46:57 +0100

Hello,
One specific thing I am thinking about is whether we want separate definition files for the various function tests (eg. translateFileTests.xml, backTranslateFileTests.xml, etc) or whether we want all test definitions in one large file.

Its really no difference in effort to implement in code, so its what people feel is best for using.

Michael Whapples
On 15/07/2014 11:09, Michael Whapples (Redacted sender mwhapples@xxxxxxx for DMARC) wrote:
Hello,
At APH we are looking at creating a test framework for LibLouisUTDML using the Java bindings.

There are two main uses for this:
1. To test the Java bindings API.
2. To provide a test framework/harness which can be used to verify LibLouisUTDML is performing translation correctly.

We were aware of the existing test system in LibLouisUTDML which is a combination of shell scripting and file2brl. We felt that system was unsuitable as it would not be testing the Java bindings (at APH our concern is in developing BrailleBlaster, thus relying on Java bindings) and also that file2brl is essentially a unix only tool (it cannot be built with defacto compilers on Windows, IE. MSVC), thus the old test framework does not meet with the goal of LibLouisUTDML being cross-platform.

We feel it would be good to get community comments on the test framework before fully implementing it, however, we also felt it would be good to have something which could be used as a starting point for discussion. I have just committed what I would like us to use as the starting point for discussion.

To explain the new test framework:
* To run the tests (currently only one test) change to the java subdirectory of the liblouisutdml source and execute a command like:
ant test -Dliblouis.dir="<path to liblouis and liblouisutdml libraries>"
Where <path to liblouis and liblouisutdml libraries> is where your liblouis and liblouisutdml shared libraries/.dlls are located. Unfortunately it is a limitation of the Java bindings that they cannot use the standard library search path. May be in time we can sort this out and then only need the -Dliblouis.dir option if you need specify a specific location instead of the search path. * At the moment the test framework only tests translateFile method of the Java bindings, in time this will be extended to other translation functions in a similar way to how the translateFile tests are done. * The translateFile tests are defined in the file testdata/translateFileTests.xml. The root element of this file is tests and it can contain translateFileTest elements. Each translateFileTest element requires a configList, inFile and expectedOutFile elements, it optionally can take logFile, settings and mode elements. Any files given are relative to the build.xml file in the java subdirectory (eg. the existing test has the inFile given as testdata/list-test.xml). The settings element is the settings string parameter to translateFile and mode should be an integer (it cannot take the enum names for mode values, that may be a later improvement). The liblouis and liblouisutdml data files are located in liblouis/tables and liblouisutdml/lbu_files subdirectories of the testdata directory and the liblouis data path is set automatically accordingly to this location.

We feel it is quite urgent for this test framework to be completed, so we are looking for feedback by the end of Wednesday 23 July, so that feedback and completion of the test framework implementation can be performed after immediately after that.

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

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

Other related posts: