\label{doc_decisions_6_implemented_unit_testing_md_md_doc_decisions_6_implemented_unit_testing}%
\Hypertarget{doc_decisions_6_implemented_unit_testing_md_md_doc_decisions_6_implemented_unit_testing}%
 \hypertarget{doc_decisions_6_implemented_unit_testing_md_autotoc_md2502}{}\doxysection{Problem}\label{doc_decisions_6_implemented_unit_testing_md_autotoc_md2502}
The previous unit testing framework started as hack to have a bit more than simple asserts. It is not easy to use (needs explicit enumeration of all test cases) and lacks really important features (e.\+g. output of the assertion that failed).\hypertarget{doc_decisions_6_implemented_unit_testing_md_autotoc_md2503}{}\doxysection{Constraints}\label{doc_decisions_6_implemented_unit_testing_md_autotoc_md2503}

\begin{DoxyItemize}
\item Must be BSD licenced
\item Must be easy to use
\item should be portable
\item should support mocking
\end{DoxyItemize}\hypertarget{doc_decisions_6_implemented_unit_testing_md_autotoc_md2504}{}\doxysection{Assumptions}\label{doc_decisions_6_implemented_unit_testing_md_autotoc_md2504}
\hypertarget{doc_decisions_6_implemented_unit_testing_md_autotoc_md2505}{}\doxysection{Considered Alternatives}\label{doc_decisions_6_implemented_unit_testing_md_autotoc_md2505}

\begin{DoxyItemize}
\item Continue with current framework
\item Boost Unit Testing framework
\end{DoxyItemize}\hypertarget{doc_decisions_6_implemented_unit_testing_md_autotoc_md2506}{}\doxysection{Decision}\label{doc_decisions_6_implemented_unit_testing_md_autotoc_md2506}

\begin{DoxyItemize}
\item Keep C framework for C tests and ABI tests
\item Google Unit testing framework {\ttfamily gtest} with code downloaded by CMake for systems where no source is packaged (Debian Wheezy, Arch Linux, Fedora,...) for C++ tests
\end{DoxyItemize}\hypertarget{doc_decisions_6_implemented_unit_testing_md_autotoc_md2507}{}\doxysection{Rationale}\label{doc_decisions_6_implemented_unit_testing_md_autotoc_md2507}

\begin{DoxyItemize}
\item Having the output of current values when an assertion fails in any case
\item No listing of all test cases in main (but instead having test discovery)
\item No more commenting out if you only want to run parts of the test-\/suite
\item No more typos in test-\/suite namings
\item x\+Unit output for jenkins
\item value and type-\/parameterized tests
\item Mock-\/\+Support (not available in gtest?)
\item setup/teardown global+per test
\item supports death tests
\item writing many parts of it on our own adds to the total amount of code to write and maintain.
\item integrations into IDEs
\end{DoxyItemize}\hypertarget{doc_decisions_6_implemented_unit_testing_md_autotoc_md2508}{}\doxysection{Implications}\label{doc_decisions_6_implemented_unit_testing_md_autotoc_md2508}

\begin{DoxyItemize}
\item It is not ideal to have different frameworks intermixed (C vs. C++ frameworks, but most code is C).
\item In the end we have to write a lot of functionality ourselves anyway (e.\+g. comparing Keys and Key\+Sets).
\item Testsuite execution are already handled by cmake and kdb run-\/all.
\item The selection of tests within a test suite does not play well with ctest.
\item Rewriting all current tests to have unified behavior is a lot of work.
\item Might not work for ABI compatibility tests.
\item Mock only by extra framework.
\end{DoxyItemize}\hypertarget{doc_decisions_6_implemented_unit_testing_md_autotoc_md2509}{}\doxysection{Related Decisions}\label{doc_decisions_6_implemented_unit_testing_md_autotoc_md2509}

\begin{DoxyItemize}
\item \mbox{\hyperlink{doc_decisions_6_implemented_script_testing_md}{Script Testing}}
\end{DoxyItemize}\hypertarget{doc_decisions_6_implemented_unit_testing_md_autotoc_md2510}{}\doxysection{Notes}\label{doc_decisions_6_implemented_unit_testing_md_autotoc_md2510}

\begin{DoxyItemize}
\item We had discussions on Mailinglists
\item We had discussions in \href{https://pull.libelektra.org/26}{\texttt{ \#26}} 
\end{DoxyItemize}