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

Tests fail when built with -DNDEBUG #4

Closed
r-burns opened this issue Sep 3, 2021 · 1 comment
Closed

Tests fail when built with -DNDEBUG #4

r-burns opened this issue Sep 3, 2021 · 1 comment

Comments

@r-burns
Copy link

r-burns commented Sep 3, 2021

Since assert is a necessary part of the tests' control flow, compiling with NDEBUG defined globally (e.g. via config.cc.poptions+=-DNDEBUG) causes the tests to fail.

Forcibly undefining NDEBUG in each test driver before including <cassert> looks like one way to fix this:

--- a/tests/command/driver.cxx
+++ b/tests/command/driver.cxx
@@ -3,2 +3,5 @@
 
+#ifdef NDEBUG
+#undef NDEBUG
+#endif
 #include <cassert>

If this looks like an appropriate solution, I'm happy to open a PR.

@r-burns
Copy link
Author

r-burns commented Sep 29, 2021

Cool, it looks like this was addressed in 7a4fc37. I was even able to cherry-pick it back to 0.13 (excluding any newly-added tests) and all tests are passing with global -DNDEBUG now. Thanks @karen-arutyunov!

@r-burns r-burns closed this as completed Sep 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant