Skip to content

Commit fbb8615

Browse files
jhlegarretathewtex
authored andcommitted
ENH: Add section about tests for Wrapping files
Add section about tests for Wrapping files.
1 parent 38b876b commit fbb8615

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

SoftwareGuide/Latex/DevelopmentGuidelines/CreateAModule.tex

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -885,6 +885,24 @@ \subsubsection{Wrapping Macros}
885885
Finally, the \textbf{UNIQUE} macro removes duplicates from the given list.
886886
887887
888+
\subsubsection{Wrapping Tests}
889+
890+
Wrapped classes need to be accompanied with their own test files to ensure that
891+
the classes can be instantiated correctly. Similar to regular C++ tests, the
892+
tests for wrapped classes dwell in a \code{CMakeLists.txt} file inside the
893+
\code{wrapping/test} directory of the module of interest, e.g.
894+
\code{Modules/<ModuleName>/<SubModuleName>/wrapping/test/CMakeLists.txt}. The
895+
following is an example of how such file would look like for the wrapping
896+
corresponding to the \doxygen{ExtrapolateImageFunction} and
897+
\doxygen{WindowedSincInterpolateImageFunction} classes:
898+
899+
\begin{minted}[baselinestretch=1,fontsize=\footnotesize,linenos=false,bgcolor=ltgray]{cmake}
900+
itk_python_expression_add_test(NAME itkExtrapolateImageFunctionPythonTest
901+
EXPRESSION "instance = itk.ExtrapolateImageFunction.New()")
902+
itk_python_expression_add_test(NAME itkWindowedSincInterpolateImageFunctionPythonTest
903+
EXPRESSION "instance = itk.WindowedSincInterpolateImageFunction.New()")
904+
\end{minted}
905+
888906
889907
\section{Third-Party Dependencies}
890908
\label{sec:ThirdParty}

0 commit comments

Comments
 (0)