<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.slicer.org/w/index.php?action=history&amp;feed=atom&amp;title=Documentation%2F4.10%2FDevelopers%2FTutorials%2FCxxTests</id>
	<title>Documentation/4.10/Developers/Tutorials/CxxTests - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.slicer.org/w/index.php?action=history&amp;feed=atom&amp;title=Documentation%2F4.10%2FDevelopers%2FTutorials%2FCxxTests"/>
	<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/4.10/Developers/Tutorials/CxxTests&amp;action=history"/>
	<updated>2026-04-11T09:45:16Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.33.0</generator>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/4.10/Developers/Tutorials/CxxTests&amp;diff=59792&amp;oldid=prev</id>
		<title>UpdateBot: Nightly -&gt; 4.10</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/4.10/Developers/Tutorials/CxxTests&amp;diff=59792&amp;oldid=prev"/>
		<updated>2018-10-19T00:43:47Z</updated>

		<summary type="html">&lt;p&gt;Nightly -&amp;gt; 4.10&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;noinclude&amp;gt;{{documentation/versioncheck}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
== Goal ==&lt;br /&gt;
&lt;br /&gt;
Goal of Cxx tests is to test C++ classes as comprehensively as possible in the simplest possible environment (with minimum usage of other classes).&lt;br /&gt;
&lt;br /&gt;
The tests are run as part of the nightly test process and submitted to [http://slicer.cdash.org/index.php?project=Slicer4 the slicer dashboard].&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
* Test execution is managed by [http://www.cmake.org/Wiki/CMake/Testing_With_CTest CMake/CTest]&lt;br /&gt;
* To reduce the number of individual executable files, typically many test cases are packaged into a single executable using  and CTK's [http://www.commontk.org/docs/html/group__CMakeUtilities.html SIMPLE_TEST utilities]&lt;br /&gt;
* The test process must exit with zero (EXIT_SUCCESS) error code in case of success and non-zero (EXIT_FAILURE) in case of failure&lt;br /&gt;
* It is strongly recommended to exit with failure if any unexpected VTK error or warning messages are logged. To achieve this, use the [https://github.com/Slicer/Slicer/blob/master/Libs/vtkAddon/vtkTestingOutputWindow.h vtkTestingOutputWindow] class (and its convenience macros) defined in the vtkAddon library&lt;br /&gt;
** In the CMakeLists.txt of your Cxx tests (see [https://github.com/Slicer/Slicer/blob/master/Libs/MRML/Widgets/Testing/CMakeLists.txt Libs\MRML\Widgets\Testing\CMakeLists.txt] as an example):&lt;br /&gt;
*** Add ''TESTING_OUTPUT_INIT()'' to ''CMAKE_TESTDRIVER_BEFORE_TESTMAIN''&lt;br /&gt;
*** Add ''TESTING_OUTPUT_ASSERT_WARNINGS_ERRORS(0)'' to ''CMAKE_TESTDRIVER_AFTER_TESTMAIN''&lt;br /&gt;
*** Add ''#include &amp;lt;vtkTestingOutputWindow.h&amp;gt;'' to the included ''EXTRA_INCLUDE'' header file.&lt;br /&gt;
** In your testing code, if you expect errors or warnings: include ''vtkTestingOutputWindow.h'' and put code that logs errors or warnings between these macros (see examples in [https://github.com/Slicer/Slicer/blob/master/Libs/MRML/Widgets/Testing/ Libs\MRML\Widgets\Testing]):&lt;br /&gt;
*** ''TESTING_OUTPUT_IGNORE_WARNINGS_ERRORS_BEGIN()'' / ''TESTING_OUTPUT_IGNORE_WARNINGS_ERRORS_END()'' – if errors or warnings may be logged&lt;br /&gt;
*** ''TESTING_OUTPUT_ASSERT_WARNINGS_BEGIN()'' / ''TESTING_OUTPUT_ASSERT_WARNINGS_END()'' – if errors or warnings must be logged&lt;/div&gt;</summary>
		<author><name>UpdateBot</name></author>
		
	</entry>
</feed>