Re: Checks for testcase was: (Re: DO NOT REPLY [Bug 36025] - [PATCH] font-size testcases)

2005-08-04 Thread Chris Bowditch

Manuel Mall wrote:


Chris,


Hi Manuel,



On Thu, 4 Aug 2005 09:31 pm, [EMAIL PROTECTED] wrote:
...

--- Additional Comments From [EMAIL PROTECTED] 


...


I have added some checks to make the tests a little more effective at
detecting regressions. I would be grateful if you could have a go at
this yourself next time. If you're not sure how to do this, just ask
on fop-dev.


I was thinking myself that I needed to do something about adding stuff 
to the checks section but have no real idea where to start. I assume 
these checks are against the internal area tree? Any way, in the moment 
this is still a big black hole for me and I would very much appreciate 
any helpful suggestions how I could go best about to achieve some 
enlightenment in that area.


The checks are actually against the Area Tree Output. You can generate 
it and see what it looks like for any fo by running the following 
command line:


fop foo.fo -at foo.xml

There are 2 basic checks you can do (I could be wrong; I'm not the 
expect here):


1) true check, useful for checking the presence/absence of an element 
or attribute in this XML output. It has a single attribute xpath= 
which is just an xpath expression which can select a node in the XML 
output.


2) eval check, which grabs the value of a attribute specified by the 
xpath attribute and checks it matches the expected value specified in 
the expected attribute.


As an example I added some checks to your font-size tests to see that a 
medium font was in fact 12pt. Internally all FOP's measurements are in 
milli-pt, so the check actually looks for the value 12000


I hope this gives you the basic idea,

Chris




Re: Checks for testcase was: (Re: DO NOT REPLY [Bug 36025] - [PATCH] font-size testcases)

2005-08-04 Thread Jeremias Maerki
I've documented some of the stuff concerning layoutengine tests on the
Wiki: http://wiki.apache.org/xmlgraphics-fop/HowToCreateLayoutEngineTests

I see that it was not enough, so I'll add some more info later today.
Gotta run now. Sorry.

On 04.08.2005 17:14:02 Manuel Mall wrote:
 Chris,
 
 On Thu, 4 Aug 2005 10:59 pm, Chris Bowditch wrote:
  Manuel Mall wrote:
   Chris,
 
  Hi Manuel,
 
 ...
 
  The checks are actually against the Area Tree Output. You can
  generate it and see what it looks like for any fo by running the
  following command line:
 
  fop foo.fo -at foo.xml
 
 OK, got that.
 
  There are 2 basic checks you can do (I could be wrong; I'm not the
  expect here):
 
  1) true check, useful for checking the presence/absence of an
  element or attribute in this XML output. It has a single attribute
  xpath= which is just an xpath expression which can select a node in
  the XML output.
 
  2) eval check, which grabs the value of a attribute specified by
  the xpath attribute and checks it matches the expected value
  specified in the expected attribute.
 
  As an example I added some checks to your font-size tests to see that
  a medium font was in fact 12pt. Internally all FOP's measurements are
  in milli-pt, so the check actually looks for the value 12000
 
  I hope this gives you the basic idea,
 
 Thanks that's great I think I understand. 
 
 Last (is there ever?) question: How can I run a testcase and test my 
 checks.../checks section? Do I have to somehow invoke Jeremias 
 LayoutEngineTestSuite? And if so what's the best way to do that?
 
 Thanks for your help
 
 Manuel
 
  Chris



Jeremias Maerki



Re: Checks for testcase was: (Re: DO NOT REPLY [Bug 36025] - [PATCH] font-size testcases)

2005-08-04 Thread Chris Bowditch

Manuel Mall wrote:


Chris,

Thanks that's great I think I understand. 


Cool. Thanks for all your help.



Last (is there ever?) question: How can I run a testcase and test my 
checks.../checks section? Do I have to somehow invoke Jeremias 
LayoutEngineTestSuite? And if so what's the best way to do that?


Well it's always a good idea to check the tests before submitting them. 
The layout engine tests are run as part of the build. You can tell Ant 
just to run a particular target in the Ant script. For example, to just 
run the tests and not the full build type;


ant junit

If a test is meant to fail, then it's a good idea to disable it by 
default otherwise it will cause the build to fail. You do that by adding 
the filename of the test to the file disabled-testcases.txt in the 
test/layoutengine directory.


Chris




Re: Checks for testcase was: (Re: DO NOT REPLY [Bug 36025] - [PATCH] font-size testcases)

2005-08-04 Thread Manuel Mall
On Thu, 4 Aug 2005 11:17 pm, Jeremias Maerki wrote:
 I've documented some of the stuff concerning layoutengine tests on
 the Wiki:
 http://wiki.apache.org/xmlgraphics-fop/HowToCreateLayoutEngineTests

 I see that it was not enough, so I'll add some more info later today.
 Gotta run now. Sorry.

Jeremias,

Ahhh, that is enough for me to get going. I just didn't find the WIKI 
page when looking for it. The page does not seem to be linked from 
either the DeveloperPages or the FOPProjectPages. Not to worry, all 
sorted now. Gotta run as well - need to get some sleep.

Manuel