Re: [pypy-svn] r8324 - pypy/trunk/src/pypy/translator/test

Hi Holger, On Mon, Jan 17, 2005 at 12:08:01AM +0100, hpk@codespeak.net wrote:
Log: skip tests if underlying system features (c-compiler mostly) are not present.
- return t.ccompile() + return py.test.skip_on_error(t.ccompile)
Ahem! This looks like it is saying "run the difficult part that we are testing, but if anything goes wrong, just skip the test". The test *is* that t.ccompile() works correctly, and only additionally that calling the compiled function works. In practice it's more common that there is an exception-raising bug in genc.py, which is called by t.ccompile(). Armin

Hi Armin, On Mon, Jan 17, 2005 at 16:00 +0000, Armin Rigo wrote:
On Mon, Jan 17, 2005 at 12:08:01AM +0100, hpk@codespeak.net wrote:
Log: skip tests if underlying system features (c-compiler mostly) are not present.
- return t.ccompile() + return py.test.skip_on_error(t.ccompile)
Ahem! This looks like it is saying "run the difficult part that we are testing, but if anything goes wrong, just skip the test".
:-) Well, i tested on platforms where these invocations miserably fail because there was no matching C-compiler available and then they give long obnoxious tracebacks from within distutils somewhere.
The test *is* that t.ccompile() works correctly, and only additionally that calling the compiled function works. In practice it's more common that there is an exception-raising bug in genc.py, which is called by t.ccompile().
OK, from the containing "build_cfunc" function i didn't guess that the call to t.ccompile() was supposed to be a test by itself. I guess that either the Genc() part should be called separatedly or we should have our distutils invocations fail more cleanly and extend "skip_on_error" to require specifying an explicit Exception class. then the above could turn into py.test.skip_on_error(SystemExit, t.ccompile) which - hopefully - GenC() does not raise :-) cheers, holger
participants (2)
-
Armin Rigo
-
hpk@trillke.net