Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a unit test framework for C code, to test e.g. ObjInt_UInt, ObjInt_Int8, ObjInt_Int #1917

Closed
fingolfin opened this issue Nov 16, 2017 · 2 comments
Labels
kind: enhancement Label for issues suggesting enhancements; and for pull requests implementing enhancements topic: kernel topic: tests issues or PRs related to tests

Comments

@fingolfin
Copy link
Member

It would be good to have a C unit test framework where we can test dedicated kernel functions without having to come up in a "natural" way. Right now, the best one can seems to be to write C functions FuncTEST_SOME_CODE, export them to GAP, and then call them from there.

A general framework could also do that, but with a single function, which then is responsible for executing the whole test suite(s).
Or perhaps some other way would do -- whatever, in the end, it just would be nice to have tests for things like ObjInt_Int8, which used to have bugs for edge cases in the past; so it would be really good to be able to add systematic tests for such relatively self-contained functions.

See also PR #1909 for some more relevant C functions.

@fingolfin fingolfin added kind: enhancement Label for issues suggesting enhancements; and for pull requests implementing enhancements topic: kernel topic: tests issues or PRs related to tests labels Nov 16, 2017
@ChrisJefferson
Copy link
Contributor

I previously thought about doing this with a special package, although that would still require exporting the functions to the GAP level.

I started with a simple package: https://github.com/gap-packages/kerneltest . We could extend and improve this.

@fingolfin
Copy link
Member Author

ObjInt_UInt are now tested via regular .tst files, with the help of some helper kernel functions.

For libgap, we now have started to create C based tests; this essentially allows doing what this issue describes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: enhancement Label for issues suggesting enhancements; and for pull requests implementing enhancements topic: kernel topic: tests issues or PRs related to tests
Projects
None yet
Development

No branches or pull requests

2 participants