{%- import 'macros.tex' as macros %}
{%- include 'unittest_head.tex' %}
{%- include 'unittest_titlepage.tex' %}

\tableofcontents
\newpage

\section{Test System Information}
{%- with system_information = data.system_information %}
  {%- include 'system.tex' %}
{%- endwith %}

\section{Test Object Information}
{%- with object_information = data.testobject_information %}
  {%- include 'object.tex' %}
{%- endwith %}


\section{Summary}
{%- with testrun = data %}
  {%- include 'run_statistic.tex' %}
{%- endwith %}

{% if data.number_of_failed_tests > 0 or data.number_of_possibly_failed_tests > 0%}
  \section{\textcolor{red}{Testcases (Failed)}}
  {%- for test_name in data.uid_list_sorted %}
    {% with testcase = data.testcases[test_name] %}
      {% if testcase.levelno > 20 %}
        \subsection{ {{macros.latex_filter(testcase.message)}} }
        {% with details = true %}
          {% include 'report_testcase.tex' %}
        {% endwith %}
      {% endif %}
    {% endwith %}
  {% endfor %}
{% endif %}


{% if data.number_of_successfull_tests > 0 %}
  \section{\textcolor{green}{Testcases (Success)}}
  {%- for test_name in data.uid_list_sorted %}
    {% with testcase = data.testcases[test_name] %}
      {% if testcase.levelno <= 20 %}
        \subsection{ {{macros.latex_filter(testcase.message)}} }
        {% with details = details %}
          {% include 'report_testcase.tex' %}
        {% endwith %}
      {% endif %}
    {% endwith %}
  {% endfor %}
{% endif %}


{% include 'unittest_foot.tex' %}
