-
-
Notifications
You must be signed in to change notification settings - Fork 12.1k
Open
Labels
05 - Testingcomponent: numpy.f2pytriagedIssue/PR that was discussed in a triage meetingIssue/PR that was discussed in a triage meeting
Description
Proposed new feature or change: Unit testing C code
One of the primary motivations behind this change is to support F2PY generated codes better. Working with fortranobject.{c,h} while trying to have test coverage is effectively impossible right now. Currently we only have integration tests (at the Python level) and this makes it hard to track problems sometimes.
However, beyond F2PY as well, unit testing the NumPy-C API can be done in low-boilerplate way with cmocka.
Some nice features of cmocka:
- C only
- Surprisingly low boilerplate
- Is easily available on
conda - Used by a bunch of other projects (e.g.
libssh)
Existing C-testing:
- Integration (
pytest) - Making small extension modules to test parts of the public API (test_mem_policy.py)
Some questions which have come up in discussions are:
- Compiling on Windows is slow --> we can concatenate these on the CI
- Compiling them in monolithic files might be hard to debug (e.g. F2PY generates wrong C code)
- This should not be an issue for the most part, compiler errors are caught by our test suite now as well, which should not change.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
05 - Testingcomponent: numpy.f2pytriagedIssue/PR that was discussed in a triage meetingIssue/PR that was discussed in a triage meeting