The return value of ctest after it runs a -S script indicates whether the script as a whole succeeded or not. The only way it succeeds all the way and returns 0 is if *all* of the steps invoked are error free.<div><br></div>
<div>The build errors mean that ctest&#39;s return value will be non-zero. (Same for update, configure or test errors as well...)</div><div><br></div><div><br></div><div>HTH,</div><div>David</div><div><br></div><div><br><br>
<div class="gmail_quote">On Mon, Oct 19, 2009 at 1:22 PM,  <span dir="ltr">&lt;<a href="mailto:winfried_mb2@xmsnet.nl">winfried_mb2@xmsnet.nl</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
The ctest script below runs fine when the build succeeds. However if the CTEST_BUILD(...) step fails, I don&#39;t call the CTEST_TEST(...) step since that is useless.<br>
<br>
In this case the ctest output ends with:<br>
Error in read script: &lt;ctest_scriptname here&gt;<br>
<br>
and the exit code of ctest is 255 in this case.<br>
The configure and build results are correctly uploaded to the CDash server, so basically the script works o.k. Then why does it give this error?<br>
<br>
I&#39;m using cmake 2.8.0-rc3<br>
<br>
Thanks in advance for any clues!<br>
Arthur Dobbe<br>
<br>
<br>
set (CTEST_SOURCE_DIRECTORY &quot;/var/opt/buildtools/release/VEHICLES_2_1_0/CAR_2_1/export&quot;)<br>
set (CTEST_BINARY_DIRECTORY &quot;/var/opt/buildtools/release/VEHICLES_2_1_0/CAR_2_1/build.Release&quot; )<br>
set(CTEST_PROJECT_NAME &quot;VEHICLES_2_1_0&quot;)<br>
set(CTEST_NIGHTLY_START_TIME &quot;00:00:00 UTC&quot;)<br>
set(CTEST_DROP_METHOD &quot;http&quot;)<br>
set(CTEST_DROP_SITE &quot;localhost&quot;)<br>
set(CTEST_DROP_LOCATION &quot;/CDash/submit.php?project=VEHICLES_2_1_0&quot;)<br>
set(CTEST_DROP_SITE_CDASH TRUE)<br>
SET(CTEST_CMAKE_GENERATOR &quot;Unix Makefiles&quot;)<br>
SET(CTEST_BUILD_COMMAND make)<br>
file(WRITE &quot;${CTEST_BINARY_DIRECTORY}/CMakeCache.txt&quot; &quot;<br>
SITE:STRING=${hostname}<br>
CMAKE_BUILD_TYPE:STRING=Release<br>
PRODUCT_DIR:STRING=/var/opt/buildtools/release/VEHICLES_2_1_0<br>
&quot;)<br>
set(CTEST_SITE &quot;localhost&quot;)<br>
set_property(GLOBAL PROPERTY SubProject &quot;CAR_2_1&quot;)<br>
set_property(GLOBAL PROPERTY Label &quot;CAR_2_1&quot;)<br>
set (CTEST_BUILD_TARGET &quot;CAR_2_1&quot;)<br>
CTEST_START(&quot;Experimental&quot;)<br>
CTEST_CONFIGURE(BUILD &quot;${CTEST_BINARY_DIRECTORY}&quot; RETURN_VALUE configRes)<br>
if (${configRes} EQUAL 0)<br>
    CTEST_BUILD(BUILD &quot;${CTEST_BINARY_DIRECTORY}&quot; RETURN_VALUE buildRes)<br>
endif (${configRes} EQUAL 0)<br>
if (${buildRes} EQUAL 0)<br>
    execute_process(COMMAND &quot;/usr/bin/make&quot; &quot;install&quot; WORKING_DIRECTORY ${CTEST_BINARY_DIRECTORY} RESULT_VARIABLE makeInstallResult OUTPUT_VARIABLE makeInstallLog ERROR_VARIABLE makeInstallLog)<br>
    file(WRITE ${CTEST_BINARY_DIRECTORY}/makeinstall.log &quot;${makeInstallLog}&quot;)<br>
    CTEST_TEST(BUILD &quot;${CTEST_BINARY_DIRECTORY}&quot;)<br>
endif (${buildRes} EQUAL 0)<br>
CTEST_SUBMIT(FILES &quot;/var/opt/buildtools/release/VEHICLES_2_1_0/Project.xml&quot;)<br>
CTEST_SUBMIT()<br>
<br>
<br>
Output of ctest when build fails:<br>
 # ctest -S bt_ctest.cmake<br>
Error(s) when building project<br>
Error in read script: /var/opt/buildtools/release/VEHICLES_2_1_0/CAR/build.Release/bt_ctest.cmake<br>
<br>
<br>
Verbose output of ctest when build fails:<br>
# ctest -S bt_ctest.cmake -V<br>
Run dashboard with model Experimental<br>
   Source directory: /var/opt/buildtools/release/VEHICLES_2_1_0/CAR_2_1/export<br>
   Build directory: /var/opt/buildtools/release/VEHICLES_2_1_0/CAR_2_1/build.Release<br>
   Cannot locate CTest configuration: /var/opt/buildtools/release/VEHICLES_2_1_0/CAR/export/CTestConfig.cmake<br>
   Delay the initialization of CTest<br>
   Site: localhost<br>
   Build name:<br>
   Use Experimental tag: 20091019-1717<br>
Configure project<br>
   Each . represents 1024 bytes of output<br>
    . Size of output: 0K<br>
Build project<br>
   Each symbol represents 1024 bytes of output.<br>
   &#39;!&#39; represents an error and &#39;*&#39; a warning.<br>
    . Size of output: 0K<br>
Error(s) when building project<br>
   8 Compiler errors<br>
   1 Compiler warnings<br>
Submit files (using http)<br>
   Using HTTP submit method<br>
   Drop site:<a href="http://localhost/CDash/submit.php?project=VEHICLES_2_1_0" target="_blank">http://localhost/CDash/submit.php?project=VEHICLES_2_1_0</a><br>
   Uploaded: /var/opt/buildtools/release/VEHICLES_2_1_0/Project.xml<br>
   Submission successful<br>
Submit files (using http)<br>
   Using HTTP submit method<br>
   Drop site:<a href="http://localhost/CDash/submit.php?project=VEHICLES_2_1_0" target="_blank">http://localhost/CDash/submit.php?project=VEHICLES_2_1_0</a><br>
   Uploaded: /var/opt/buildtools/release/VEHICLES_2_1_0/CAR/build.Release/Testing/20091019-1717/Build.xml<br>
   Uploaded: /var/opt/buildtools/release/VEHICLES_2_1_0/CAR/build.Release/Testing/20091019-1717/Configure.xml<br>
   Submission successful<br>
Error in read script: /var/opt/buildtools/release/VEHICLES_2_1_0/CAR/build.Release/bt_ctest.cmake<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>