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

Dummy callbacks for tests #971

Closed

Conversation

aahadley-anchorage
Copy link

If external callbacks are specified, the build can fail at link time since these functions aren't defined yet. Give the linker some definitions to make it happy.

@aahadley-anchorage aahadley-anchorage marked this pull request as ready for review September 1, 2021 20:53
@real-or-random
Copy link
Contributor

Hm, that's an issue indeed.

If you use the external callbacks, then you probably do because you don't have printf or abort on your platform. In tests, we use these function anyway, so I think this change is fine. But wouldn't it be simpler to #undef USE_EXTERNAL_CALLBACKS?

Ideally, we'd move into the other direction and make it possible to run the tests without printf. But that's more complicated.

I wonder if could we just abuse the external callbacks for exactly that purpose? Instead of making CHECK call abort, we could make this macro reset the default callback and then invoke it. If you don't have printf or abort, you'd be able provide a different external callback... Except I don't know how to print the seed then or the final success message. Maybe it's just cleaner to let the user provide some print function...

@real-or-random
Copy link
Contributor

Closing in favor of #1306

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

Successfully merging this pull request may close these issues.

2 participants