<?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%2FFAQ%2FTesting</id>
	<title>Documentation/4.10/Developers/FAQ/Testing - 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%2FFAQ%2FTesting"/>
	<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/4.10/Developers/FAQ/Testing&amp;action=history"/>
	<updated>2026-05-06T21:04:34Z</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/FAQ/Testing&amp;diff=59735&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/FAQ/Testing&amp;diff=59735&amp;oldid=prev"/>
		<updated>2018-10-19T00:41:37Z</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;
&amp;lt;noinclude&amp;gt;__TOC__&lt;br /&gt;
={{#titleparts: {{PAGENAME}} | | -1 }}=&amp;lt;/noinclude&amp;gt;&amp;lt;includeonly&amp;gt;&lt;br /&gt;
='''Developer FAQ: {{{1}}}'''=&lt;br /&gt;
&amp;lt;/includeonly&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What is the difference between add_test, simple_test, slicer_add_python_test, and slicer_add_python_unittest CMake macros/functions  ? ==&lt;br /&gt;
&lt;br /&gt;
* [https://cmake.org/cmake/help/latest/command/add_test.html add_test]: provided by CMake and allows to add a test that can be executed using [https://cmake.org/cmake/help/latest/manual/ctest.1.html ctest].&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;simple_test(testname)&amp;lt;/code&amp;gt;:&lt;br /&gt;
** Usually called after configuring a test driver using &amp;lt;code&amp;gt;SlicerMacroConfigureModuleCxxTestDriver&amp;lt;/code&amp;gt;. &lt;br /&gt;
** Accept the same arguments as &amp;lt;code&amp;gt;add_test&amp;lt;/code&amp;gt;.&lt;br /&gt;
** Conveniently call [https://cmake.org/cmake/help/latest/module/ExternalData.html#command:externaldata_add_test ExternalData_add_test] with the appropriate parameters.&lt;br /&gt;
** Set the &amp;lt;code&amp;gt;LABELS&amp;lt;/code&amp;gt; test property.&lt;br /&gt;
** Invoke test driver using &amp;lt;code&amp;gt;${Slicer_LAUNCH_COMMAND}&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
** It internally check if a variable &amp;lt;code&amp;gt;KIT&amp;lt;/code&amp;gt; is set in the current scope, if not set it first defaults to the value of value of &amp;lt;code&amp;gt;CLP&amp;lt;/code&amp;gt; variable automatically set after building a CLI using &amp;lt;code&amp;gt;SEMMacroBuildCLI&amp;lt;/code&amp;gt;. If not building a CLI, it then defaults to the value of &amp;lt;code&amp;gt;EXTENSION_NAME&amp;lt;/code&amp;gt; variable.&lt;br /&gt;
** Ideally, this macro should be renamed to &amp;lt;code&amp;gt;slicer_add_test&amp;lt;/code&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;slicer_add_python_unittest(SCRIPT script [TESTNAME_PREFIX prefix] [SLICER_ARGS slicer_arg1 [slicer_arg2 [...]]])&amp;lt;/code&amp;gt;:&lt;br /&gt;
** Run unittests with Slicer using &amp;lt;code&amp;gt;--python-code &amp;quot;import slicer.testing\\; slicer.testing.runUnitTest(['${CMAKE_CURRENT_BINARY_DIR}', '${_script_source_dir}'], '${test_name}')&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
** Slicer arguments systematically passed are &amp;lt;code&amp;gt;--testing&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;--no-splash&amp;lt;/code&amp;gt;.&lt;br /&gt;
** Conveniently call [https://cmake.org/cmake/help/latest/module/ExternalData.html#command:externaldata_add_test ExternalData_add_test] with the appropriate parameters.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;slicer_add_python_test(SCRIPT script [TESTNAME_PREFIX prefix] [SLICER_ARGS slicer_arg1 [slicer_arg2 [...]]] [SCRIPT_ARGS script_arg1 [script_arg2 [..]]])&amp;lt;/code&amp;gt;:&lt;br /&gt;
** Useful to run a python test that can not be added as a unittest.&lt;br /&gt;
** Run Slicer with the given &amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt;.&lt;br /&gt;
** Slicer arguments systematically passed are &amp;lt;code&amp;gt;--testing&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;--no-splash&amp;lt;/code&amp;gt;.&lt;br /&gt;
** Conveniently call [https://cmake.org/cmake/help/latest/module/ExternalData.html#command:externaldata_add_test ExternalData_add_test] with the appropriate parameters.&lt;br /&gt;
&lt;br /&gt;
== What is the meaning of prefix py_ in test name ? ==&lt;br /&gt;
&lt;br /&gt;
It means that the test is implemented in python.&lt;/div&gt;</summary>
		<author><name>UpdateBot</name></author>
		
	</entry>
</feed>