<div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The documentation for ctest_configure(), ctest_build(), and ctest_submit() isn't completely clear on what happens if one of these steps fails. Let's say I have the following dashboard script (this is pseudocode, arguments have been deliberately omitted for brevity, this example won't work):<br>
<br>
ctest_start()<br>
ctest_configure()<br>
ctest_build()<br>
ctest_test()<br>
ctest_submit()<br>
<br>
What happens if ctest_configure() fails (for example, because CMake failed to find a needed library)? Does the entire script stop right there? Or does it continue and try to execute ctest_build() anyway? Does ctest_build() silently do nothing because the configure step failed? Looking through the documentation for ctest_configure() and ctest_build(), I see some information on the RETURN_VALUE and CAPTURE_CMAKE_ERROR arguments, but it's not clear what happens if these aren't used.<br>
<br>
If someone could clarify for me what's supposed to happen here, and what the recommended best practices are for making sure that ctest_submit() still gets called in the event of a failure, I will gladly submit a documentation patch with this information. I'm guessing it involves using the RETURN_VALUE and CAPTURE_CMAKE_ERROR arguments, but the documentation doesn't state this.<br></blockquote><div><br></div><div>In our VTK/ParaView dashboards we ensure the submit happens by doing partial submissions after each stage (this also gives incremental results on CDash):</div><div><br></div><div> set(success TRUE)</div><div><br></div><div>ctest_configure(RETURN_VALUE configure_result)</div><div>ctest_submit(PARTS Configure) # Tell submit to submit a partial result with only the configure step<br></div><div>if (configure_result)</div><div> message("Configure failed")</div><div> set(success FALSE)</div><div> # you could exit here<br></div><div>endif()</div><div><br></div><div>if (success)</div><div>... # run next stage here</div><div><br></div><div>HTH,</div><div>Shawn<br></div></div></div></div>