[Pyrex] Testing on Linux
Greg Ewing
greg.ewing at canterbury.ac.nz
Wed Apr 19 13:56:24 CEST 2006
Stefan Behnel wrote:
> BTW, is there a way to regenerate the C files that are used for comparison? I
> tried running the test suite on my modified Pyrex version and it goes off
> complaining at almost any test that it found differences from the expected C
> output.
Erm, yes, that is a problem. I have a system for dealing with
it on a case-by-case basis, but it's not pretty.
If you look in Pyrex/Testing.py, in munge_c_line(), you'll
find the place where I insert ad-hoc hacks to modify the
lines being compared so as to cover up certain kinds of
differences.
Whenever I make a change that results in widespread systematic
changes to the code generation, the procedure I use is:
(1) Add a hack to munge_c_line() which stops the tester from
complaining about the difference.
(2) Run the tests.
(3) When all the tests pass (and only then!), run
update_references
to copy the last-generated versions of the output files
into the References directories.
(4) Remove the hacks added in step (1).
The other technique that I use, for when only a few tests are
affected, is just to visually examine the output, make sure
the difference isn't due to a bug, and then hand-edit the
reference file to match it.
The important thing is to be careful with the reference files
at all times, and never run update_references until you're
as certain as you can be that everything is correct.
--
Greg
More information about the Pyrex
mailing list