[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cmake
Subject:    Re: [CMake] How to ignore configure warnings in a ctest run?
From:       David Cole <david.cole () kitware ! com>
Date:       2012-05-29 18:39:54
Message-ID: CAAdwe9UwxAj9ApSvd=kC_fJNvxfA63i7PhQSCisSZTn17WQSxg () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


CDash "configure" warnings are computed dynamically by CDash based only on
the configure output itself with php code like this:

    $pos1 = strpos($log, 'CMake Warning', $position);
    $pos2 = strpos($log, 'Warning:', $position);

(see CDash/models/buildconfigure.php for more details)

So the only way to avoid them showing up on CDash is to avoid emitting the
warnings in the first place.


You can use code like this in your CMakeLists file if you wish to show the
warning only for non-dashboard builds:

  if("$ENV{DASHBOARD_TEST_FROM_CTEST}" STREQUAL "")
    # developer (non-dashboard) build
    message(WARNING "show warning to real user")
  else()
    # dashboard build
    message(STATUS "avoiding warning on dashboard")
  endif()

That environment variable is set by ctest only when it is running a
dashboard via the -D command line options, or via a -S script.


HTH,
David


On Fri, May 25, 2012 at 5:38 AM, Matthias Kretz <kretz@kde.org> wrote:

> Hi,
>
> in my project I added a few warnings to tell users of the library about
> compiler issues or such. But when I run a nightly build with such a
> compiler I
> really don't care to see that warning (well, rather I'd like to see a
> warning
> if the warning is missing) on the dashboard. But I didn't succeed in
> ignoring
> the warning yet. It appears that CTEST_CUSTOM_WARNING_EXCEPTION is not used
> for configure output, is it?
> Do you know of any way to do it, or would it be possible to have some way
> to
> do it in a future version?
>
> Regards,
>        Matthias
> --
> ________________________________________________________
> Matthias Kretz (Germany)                            <><
> http://kretzfamily.de/
>
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>

[Attachment #5 (text/html)]

CDash &quot;configure&quot; warnings are computed dynamically by CDash based only on \
the configure output itself with php code like this:<div><div><br></div><div>    \
$pos1 = strpos($log, &#39;CMake Warning&#39;, $position);</div> <div>    $pos2 = \
strpos($log, &#39;Warning:&#39;, $position);</div><div><br></div><div>(see \
CDash/models/buildconfigure.php for more details)</div><div><br></div><div>So the \
only way to avoid them showing up on CDash is to avoid emitting the warnings in the \
first place.</div> <div><br></div><div><br></div><div>You can use code like this in \
your CMakeLists file if you wish to show the warning only for non-dashboard \
builds:</div><div><div><br></div><div>  \
if(&quot;$ENV{DASHBOARD_TEST_FROM_CTEST}&quot; STREQUAL &quot;&quot;)</div> <div>    \
# developer (non-dashboard) build</div><div>    message(WARNING &quot;show warning to \
real user&quot;)</div><div>  else()</div><div>    # dashboard build</div><div>    \
message(STATUS &quot;avoiding warning on dashboard&quot;)</div> <div>  \
endif()</div></div><div><br></div><div>That environment variable is set by ctest only \
when it is running a dashboard via the -D command line options, or via a -S \
script.</div><div><br></div><div><br></div>HTH,</div> \
<div>David</div><div><br></div><div><br><div class="gmail_quote">On Fri, May 25, 2012 \
at 5:38 AM, Matthias Kretz <span dir="ltr">&lt;<a href="mailto:kretz@kde.org" \
target="_blank">kretz@kde.org</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"> Hi,<br>
<br>
in my project I added a few warnings to tell users of the library about<br>
compiler issues or such. But when I run a nightly build with such a compiler I<br>
really don&#39;t care to see that warning (well, rather I&#39;d like to see a \
warning<br> if the warning is missing) on the dashboard. But I didn&#39;t succeed in \
ignoring<br> the warning yet. It appears that CTEST_CUSTOM_WARNING_EXCEPTION is not \
used<br> for configure output, is it?<br>
Do you know of any way to do it, or would it be possible to have some way to<br>
do it in a future version?<br>
<br>
Regards,<br>
        Matthias<br>
--<br>
________________________________________________________<br>
Matthias Kretz (Germany)                            &lt;&gt;&lt;<br>
<a href="http://kretzfamily.de/" target="_blank">http://kretzfamily.de/</a><br>
<br>
--<br>
<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a \
href="http://www.kitware.com/opensource/opensource.html" \
target="_blank">http://www.kitware.com/opensource/opensource.html</a><br> <br>
Please keep messages on-topic and check the CMake FAQ at: <a \
href="http://www.cmake.org/Wiki/CMake_FAQ" \
target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br> <br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" \
target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br> \
</blockquote></div><br></div>



--

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic