%\documentclass[a4paper,10pt]{article}
%\usepackage[utf8]{inputenc}
%\usepackage{graphicx}

%opening
%\title{}
%\author{}

%\begin{document}

% \maketitle

%\section{Code coverage reports}

We now have the ability to generate code coverage reports for both the Fortran and Python parts of the code. This allows one to view which functions/lines in a particular source code file are covered by the current set of tests.

\subsection{Fortran}

Make sure that \texttt{lcov} is installed,\footnote{
  use \texttt{sudo apt install lcov} for ubuntu
} and run
\begin{verbatim}
pc_auto-test -C --max-level=3 --coverage
pc_codecov --output-dir lcov_html
\end{verbatim}
To view the code coverage report, open \texttt{lcov\_html/index.html} in your web browser.

%\begin{figure}
%	\centering
%	\includegraphics[width=\columnwidth,keepaspectratio]{1_fortran_file_list.png}
% \caption{Code coverage report for the Fortran source files.}
%\end{figure}
\begin{figure}[t]
	\centering
	\includegraphics[width=\columnwidth,keepaspectratio]{2_fortran_single_file.png}
	\caption{Code coverage report for a single Fortran source file.}
\end{figure}

\begin{figure}[t]
	\centering
	\includegraphics[width=.5\columnwidth,keepaspectratio]{3_python_test_report.png}
	\caption{HTML report for the Python tests}
\end{figure}
\begin{figure}[t]
	\centering
	\includegraphics[width=\columnwidth,keepaspectratio]{4_python_single_file.png}
	\caption{Code coverage report for a single Python source file.}
\end{figure}

\subsection{Python}
Make sure you have a Python interpreter in your PATH and that the \texttt{tox} Python package (version $>=4$) is installed.
\begin{verbatim}
python/tests/test-python-modules.py --full
\end{verbatim}
will then run the Python tests and generate a HTML report, \texttt{report.html}. This report will contain a link to a code coverage report for Pencil's Python module.

%\end{document}
