[prev in list] [next in list] [prev in thread] [next in thread]
List: cmake
Subject: Re: [CMake] Tests with assert and Release build type
From: Ruslan Baratov via CMake <cmake () cmake ! org>
Date: 2015-12-19 2:06:59
Message-ID: 5674BBC3.7020905 () yahoo ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
How about using RelWithDebInfo? See:
http://stackoverflow.com/a/28124715/2288008
Ruslo
On 18-Dec-15 20:55, Magnus Therning wrote:
> I'm sure I'm not the first one to run into the conflict between a desire
> to test the code shipped to customers and the desire to at the same time
> define NDEBUG to make sure tests don't have their `assert` turned into
> NOOPs.
>
> Is there some nice way of handling this?
>
> I can always remove -DNDEBUG from the CFLAGS for tests (possibly by
> defining a new macro, `ADD_EXECUTABLE_TEST()` or something). Another
> option is to `#undef NDEBUG` in the source of tests.
>
> If there's some more or less standard way to address this I'd like to
> use that.
>
> /M
>
> --
> Magnus Therning OpenPGP: 0x927912051716CE39
> email: magnus@therning.org jabber: magnus@therning.org
> twitter: magthe http://therning.org/magnus
>
> There's a big difference between making something easy to use and
> making it productive.
> -- Adam Bosworth
>
>
[Attachment #5 (text/html)]
<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">How about using RelWithDebInfo? See:
<a class="moz-txt-link-freetext" \
href="http://stackoverflow.com/a/28124715/2288008">http://stackoverflow.com/a/28124715/2288008</a><br>
<br>
Ruslo<br>
<br>
On 18-Dec-15 20:55, Magnus Therning wrote:<br>
</div>
<blockquote cite="mid:87egejhndt.fsf@sobel.cipherstone.com"
type="cite">
<pre wrap="">
I'm sure I'm not the first one to run into the conflict between a desire
to test the code shipped to customers and the desire to at the same time
define NDEBUG to make sure tests don't have their `assert` turned into
NOOPs.
Is there some nice way of handling this?
I can always remove -DNDEBUG from the CFLAGS for tests (possibly by
defining a new macro, `ADD_EXECUTABLE_TEST()` or something). Another
option is to `#undef NDEBUG` in the source of tests.
If there's some more or less standard way to address this I'd like to
use that.
/M
--
Magnus Therning OpenPGP: 0x927912051716CE39
email: <a class="moz-txt-link-abbreviated" \
href="mailto:magnus@therning.org">magnus@therning.org</a> jabber: <a \
class="moz-txt-link-abbreviated" \
href="mailto:magnus@therning.org">magnus@therning.org</a>
twitter: magthe <a class="moz-txt-link-freetext" \
href="http://therning.org/magnus">http://therning.org/magnus</a>
There's a big difference between making something easy to use and
making it productive.
-- Adam Bosworth
</pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
</blockquote>
<br>
</body>
</html>
--
Powered by www.kitware.com
Please keep messages on-topic and check the CMake FAQ at: \
http://www.cmake.org/Wiki/CMake_FAQ
Kitware offers various services to support the CMake community. For more information \
on each offering, please visit:
CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html
Visit other Kitware open-source projects at \
http://www.kitware.com/opensource/opensource.html
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic