-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Convert RUN_TEST() to a function #454
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
Convert RUN_TEST() to a function #454
Conversation
…tc in script generators
Converting RUN_TEST() from a macro to a function significantly reduces the size of the compiled binary. On amd64, the largest test runner in the test suite (testsample_DefaultsThroughCommandLine_runner.o) was reduced from 3.4 kB to 2.4 kB (stripped).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this is looking really good. It appears you're dropping parameterized support, though? Why wouldn't we just replace create_runtest's output with a function instead of a macro, but otherwise keep it functionally the same?
Parameterized tests are still alive and well, I'm just handling it a little different. Each parameter set gets wrapped in a tiny void(void) function that then gets handled the same as any other test. The end result is the same functionality but in a smaller binary. |
e.g. testparameterized_Runner.c contains:
And then:
|
I'm understanding now. I just hadn't dug far enough. Awesome. I'm definitely all for space savings! |
Cool. I'm feeling good about these changes. Thanks for all the work @jlindgren90 @Letme -- I'm pausing here to give you a chance to comment before I merge. I know you're another person who has a lot of valuable thoughts in this area. |
Converting RUN_TEST() from a macro to a function significantly reduces the size of the compiled binary. On amd64, the largest test runner in the test suite (testsample_DefaultsThroughCommandLine_runner.o) was reduced from 3.4 kB to 2.4 kB (stripped).
Depends on #453.