[prev in list] [next in list] [prev in thread] [next in thread]
List: cmake
Subject: [CMake] add_test CONFIGURATIONS and linux
From: "Steve M. Robbins" <steve () sumost ! ca>
Date: 2016-09-14 4:52:30
Message-ID: 6496491.rxXn0R7mz2 () riemann
[Download RAW message or body]
[Attachment #2 (multipart/signed)]
[Attachment #4 (multipart/alternative)]
Hi,
I'm failing to be able to use "run-only-in-release" tests when running under linux (Debian).
Below is a short reproduction.
CmakeLists.txt
=============
cmake_minimum_required(VERSION 3.0)
=============
CMAKE_BUILD_TYPE=Release. Correct? Doesn't work for me:
Run Script
==========
steve@riemann{build}rm -rf *
Running tests...
Where am I going wrong?
Thanks!
-Steve
P.S. After writing this, I discovered that "ctest -C Release" will run the tests as desired. Why
doesn't simple "make test" work?
[Attachment #7 (text/html)]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" \
"http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" \
content="1" /><style type="text/css"> p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'Noto Sans'; font-size:10pt; \
font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Hi,</p> <p \
style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p> <p style=" \
margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px;">I'm failing to be able to use \
"run-only-in-release" tests when running under linux (Debian). Below is a \
short reproduction.</p> <p style="-qt-paragraph-type:empty; margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; "> </p> <p style=" margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px;">CmakeLists.txt</p> <p style=" margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px;">=============</p> <p style=" margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span \
style=" font-family:'monospace'; color:#000000; \
background-color:#ffffff;">cmake_minimum_required(VERSION 3.0) </span><span style=" \
font-family:'monospace';"><br /><br />enable_testing() <br />add_test(NAME list-stuff \
<br /> CONFIGURATIONS Release <br /> COMMAND ls)<br /></span>=============</p> <p \
style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px;"><span style=" font-family:'monospace';"><br \
/>My understanding is that test will run only when the "configuration" is \
release. I am guessing that for the single-configuration Makefile generator, this is \
true when </span><span style=" font-family:'monospace'; color:#000000; \
background-color:#ffffff;">CMAKE_BUILD_TYPE=Release. Correct? Doesn't work for \
me:</span></p> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p> \
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px;"><span style=" font-family:'monospace';">Run \
Script</span></p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" \
font-family:'monospace';">==========</span></p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px;"><span style=" font-family:'monospace';"><br /></span><span style=" \
font-family:'monospace'; color:#000000; \
background-color:#ffffff;">steve@riemann{build}rm -rf * </span><span style=" \
font-family:'monospace';"><br />steve@riemann{build}cmake --version <br />cmake \
version 3.6.2 <br /><br />CMake suite maintained and supported by Kitware \
(kitware.com/cmake). <br />steve@riemann{build}cmake -D CMAKE_BUILD_TYPE=Release .. \
<br />-- The C compiler identification is GNU 6.2.0 <br />-- The CXX compiler \
identification is GNU 6.2.0 <br />-- Check for working C compiler: /usr/bin/cc <br \
/>-- Check for working C compiler: /usr/bin/cc -- works <br />-- Detecting C compiler \
ABI info <br />-- Detecting C compiler ABI info - done <br />-- Detecting C compile \
features <br />-- Detecting C compile features - done <br />-- Check for working CXX \
compiler: /usr/bin/c++ <br />-- Check for working CXX compiler: /usr/bin/c++ -- works \
<br />-- Detecting CXX compiler ABI info <br />-- Detecting CXX compiler ABI info - \
done <br />-- Detecting CXX compile features <br />-- Detecting CXX compile features \
- done <br />-- Configuring done <br />-- Generating done <br />-- Build files have \
been written to: /home/steve/src/test/cmake/build <br />steve@riemann{build}make <br \
/>steve@riemann{build}make test <br /></span><span style=" font-family:'monospace'; \
color:#18b2b2; background-color:#ffffff;">Running tests...</span><span style=" \
font-family:'monospace'; color:#000000; background-color:#ffffff;"> </span><span \
style=" font-family:'monospace';"><br />Test project /home/steve/src/test/cmake/build \
<br />No tests were found!!! <br />steve@riemann{build}<br />==========</span></p> <p \
style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p> <p style=" \
margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px;"><span style=" font-family:'monospace';">Where \
am I going wrong?</span></p> <p style="-qt-paragraph-type:empty; margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; "> </p> <p style="-qt-paragraph-type:empty; margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; "> </p> <p style=" margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span \
style=" font-family:'monospace';">Thanks!</span></p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px;"><span style=" font-family:'monospace';">-Steve</span></p> <p \
style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p> <p style=" \
margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px;"><span style=" font-family:'monospace';">P.S. \
After writing this, I discovered that "ctest -C Release" will run the tests \
as desired. Why doesn't simple "make test" work?</span></p> <p \
style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p></body></html>
["signature.asc" (application/pgp-signature)]
--
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