<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7652.24">
<TITLE>Testing exceptions through CTest</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->

<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="Arial">Hi,</FONT>
</P>

<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="Arial">I am writing CTest unit tests for a library I've created.</FONT>

<BR><FONT SIZE=2 FACE="Arial">I've utilized CREATE_TEST_SOURCELIST as described in Mastering CMake book.</FONT>

<BR><FONT SIZE=2 FACE="Arial">In one of the test, I pass an invalid value to make sure that an exception is thrown.</FONT>

<BR><FONT SIZE=2 FACE="Arial">In my test program I have a try-catch around the function call that passes that invalid</FONT>

<BR><FONT SIZE=2 FACE="Arial">value and inside of the 'catch' I simple return EXIT_FAILURE. For that test, I've</FONT>

<BR><FONT SIZE=2 FACE="Arial">used SET_TESTS_PROPERTIES(&#8230; PROPERTIES WILL_FAIL&nbsp; TRUE). Now,</FONT>

<BR><FONT SIZE=2 FACE="Arial">when I run 'make test', the test doesn't pass with a message '***Exception: Other'.</FONT>

<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="Arial">How can I tell ctest that the exception is expected? I.e. I need something like </FONT>

<BR><FONT SIZE=2 FACE="Arial">'WILL_EXCEPT' property that I could pass to set_tests_properties.</FONT>
</P>

<P><FONT SIZE=2 FACE="Courier New">--</FONT>

<BR><FONT SIZE=2 FACE="Courier New">Artur Kedzierski</FONT>
</P>

</BODY>
</HTML>