[CMake] Testing exceptions through CTest

Kedzierski, Artur CIV NSWC Corona, PA53 artur.kedzierski at navy.mil
Wed Nov 7 21:29:17 EST 2007


	Hi,

	I am writing CTest unit tests for a library I've created.
I've utilized CREATE_TEST_SOURCELIST as described in Mastering CMake
book.
In one of the test, I pass an invalid value to make sure that an
exception is thrown.
In my test program I have a try-catch around the function call that
passes that invalid
value and inside of the 'catch' I simple return EXIT_FAILURE. For that
test, I've
used SET_TESTS_PROPERTIES(... PROPERTIES WILL_FAIL  TRUE). Now,
when I run 'make test', the test doesn't pass with a message
'***Exception: Other'.
	How can I tell ctest that the exception is expected? I.e. I need
something like 
'WILL_EXCEPT' property that I could pass to set_tests_properties.

--
Artur Kedzierski
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20071107/4ad6e87c/attachment-0001.htm


More information about the CMake mailing list