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

Reduce time building tests #1287

Closed
albinahlback opened this issue Mar 19, 2023 · 2 comments
Closed

Reduce time building tests #1287

albinahlback opened this issue Mar 19, 2023 · 2 comments

Comments

@albinahlback
Copy link
Collaborator

How about we do something similar to how tests are done in Julia?

So we have our tests, which for the sake of simplicity are said to be mymodule/test/t-fooX.c for X in 1 to 10. We can then have one main function called mymodule/test/main.c, which is written like:

#include <all_headers_go_here.h>
#include "myinclusions.h"

#include "t-foo1.c"
...
#include "t-foo10.c"

#define TEST_NUM 10

int (*test_functions[TEST_NUM])(void) =
{
    test_foo1,
    ...,
    test_foo10
};

int
main(void)
{
    int ix;

    for (ix = 0; ix < TEST_NUM; ix++)
        test_functions[ix]();

    return 0;
}

This would speed up compile time for tests a bit, and would be very easy to fix (I think this is easy to fix via shell script).

@albinahlback
Copy link
Collaborator Author

#1341 will solve this.

@albinahlback
Copy link
Collaborator Author

This is now solved.

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

1 participant