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

holger krekel hpk at trillke.net
Mon Jan 17 17:26:41 CET 2005

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 at 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 :-) 



More information about the Pypy-dev mailing list