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

Print back trace upon failure #66

Closed
martijnthe opened this issue Feb 12, 2015 · 2 comments
Closed

Print back trace upon failure #66

martijnthe opened this issue Feb 12, 2015 · 2 comments

Comments

@martijnthe
Copy link

It'd be useful when clar would print out a stack trace that lead up to the failed test.

@vmg
Copy link
Collaborator

vmg commented Feb 12, 2015

Indeed it would, but Clar is meant to run in both Linux (GCC, Clang) and Windows (MSVC), and as far as I know there's no straightforward or crossplatform way to print this kind of traces in both platforms. :(

I'm of course up for suggestions!

@ethomson
Copy link
Member

ethomson commented Jun 2, 2020

Indeed, this would be useful, but it's really the thing that you're testing that needs to produce the stack trace. I'd be happy to support simplifying this as much as possible, but fundamentally cl_assert(...) just calls a function. If that function fails 15 calls deep, you need a way to report that up. This means either your app knowing how to report it to clar, or clar knowing how to get that information from your app. Simply calling backtrace() won't help once the call has exited and we know that we've failed.

I'm closing this but if you have a concrete plan for more general support that would be 👍

@ethomson ethomson closed this as completed Jun 2, 2020
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

3 participants