This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Writing tests using Python
- From: Florian Weimer <fweimer at redhat dot com>
- To: Joseph Myers <joseph at codesourcery dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Mon, 26 Jun 2017 15:13:09 +0200
- Subject: Re: Writing tests using Python
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=fweimer at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 483116533
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 483116533
- References: <alpine.DEB.2.20.1706261125590.21187@digraph.polyomino.org.uk>
On 06/26/2017 01:38 PM, Joseph Myers wrote:
> We currently have pretty-printers tests and benchmarks using Python.
> Would people consider it reasonable to have other tests using Python
> (appropriately conditioned in the Makefiles, of course)? (Specifically,
> I'm thinking of writing more thorough tgmath.h tests using a Python script
> to generate the C tests, with the output not being checked in, with a view
> to then adding _Float128 support to the generator when adding it to
> tgmath.h. Let's assume version requirements are no stricter than those
> documented for the pretty-printers tests, so the code works with both
> Python 2 and 3.)
Using Python for generating tests seems fine to me.
I would be wary of using Python extension modules to write tests
directly in Python, though, mainly because of the overhead of porting to
other Python versions, and the knowledge for writing C extension modules
is a bit off the beaten path for us at least.
Thanks,
Florian