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

Generate tests that use all definitions provided by the headers #188

Open
kpet opened this issue Nov 30, 2021 · 1 comment
Open

Generate tests that use all definitions provided by the headers #188

kpet opened this issue Nov 30, 2021 · 1 comment

Comments

@kpet
Copy link
Contributor

kpet commented Nov 30, 2021

We currently have automated testing in place for a good numbers of compilers, C versions, etc but the test code we're compiling uses almost none of the definitions provided by the headers which means there are a lot of warnings/errors we're not currently seeing in automated testing (see #187 for an example). We should generate tests from the spec XML that use all the definitions provided by the headers.

@bashbaug
Copy link
Contributor

Do you have a feel for what this would look like?

I think we could use each of the enums fairly easily:

void use_all_enums() {
    (void)CL_ENUM_XXX;
    (void)CL_ENUM_YYY;
}

Would we want to declare variables of each of the types?

void use_all_types() {
    cl_type_xxx v0;
    cl_type_yyy v1;
}

Would we want to call of of the APIs?

Gut feeling is that this shouldn't be too bad. I'm already generating tests that call all of the extension APIs for the extension loader I've been working on.

This:
https://github.com/bashbaug/opencl-extension-loader/blob/main/scripts/call_all.c.mako

generates:
https://github.com/bashbaug/opencl-extension-loader/blob/main/tests/call_all.c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants