-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathjunit-base.j2.xml
99 lines (94 loc) · 2.92 KB
/
junit-base.j2.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
{#- Macro for formatting a testcase output in different sections
Note we escape (|e) for safe XML
-#}
{%- macro format_log() -%}
{% for ident, tgname, message in log -%}
{{ "%-10s %-25s %s" | format(ident, tgname, message) | xml_escape }}
{% endfor %}
{%- endmacro -%}
<testsuites tests = "1"
errors = "{{ count_errored + count_blocked }}"
failures = "{{ count_failed }}"
time = "{{ ts_end_h }}">
<testsuite name = "{{ junit_testsuite_name | default('n/a') }}"
package = "{{ junit_testsuite_package | default('n/a') }}"
tests = "1"
errors = "{{ count_errored + count_blocked }}"
failures = "{{ count_failed }}"
skipped = "{{ count_skipped }}"
time = "{{ duration_s }}"
timestamp = "{{ ts_end_h }}">
<testcase classname = "{{ target_group_types }}:{{ tc_name_short }}"
name = "{{ tc_name}}"
time = "{{ duration_s }}">
{# figure out which junit tag we need to use #}
{%- if result == 'pass' %}
{%- block LOG_PASS %}
{{ format_log() }}
{% endblock -%}
{%- elif result == "fail" -%}
<error message = "Failed" type = "failure">
{%- block LOG_FAIL -%}
{{ format_log() }}
{%- endblock -%}
</error>
{%- elif result == 'error' -%}
<error message = "Error" type = "error">
{%- block LOG_ERRR -%}
{{ format_log() }}
{%- endblock -%}
</error>
{%- elif result == 'block' -%}
<error message = "Infrastructure" type = "error">
{%- block LOG_BLCK -%}
{{ format_log() }}
{%- endblock -%}
</error>
{%- elif result == 'skip' -%}
<skipped message = "Skipped" type = "skipped">
{%- block LOG_SKIP -%}
{{ format_log() }}
{%- endblock -%}
</skipped>
{%- else -%}
<error message = "BUG: unknown" type = "error">
{{ format_log() }}
</error>
{%- endif %}
{%- block SYSTEM_OUT %}
<system-out>
{%- block TARGET_INFORMATION %}
{%- if targets %}
Target Name Remote ID Type
------------------- ----------------------------- -------------------------
{% for target_info in targets -%}
{{ "%-19s %-29s %-25s"
| format(target_info.want_name, target_info.fullid,
target_info.type) }}
{% endfor -%}
{% else %}
(this testcase used no remote targets and ran locally)
{% endif %}
{% endblock -%}
{# This is left empty to other templates to expand as needed #}
{%- block HEADER_PREFIX -%}
{%- endblock -%}
{% block TAG_INFO -%}
Testcase Tag Value + Origin
------------------- -------------------------------------------------------
{% for tag in tags -%}
{{ "%-19s %s" | format(tag, tags[tag]['value']) }}
{{ " @" + tags[tag]['origin'] }}
{% endfor %}
{%- endblock %}
This report was generated by TCF
(http://intel.github.com/tcf/02-QUICKSTART.html) while executing the
testcase '{{thisfile}}'.
(You can configure this text by modifying the Jinja2 template
tcfl.report_jinja2.templates['junit'] in any of TCF's conf_*.py
configuration files).
</system-out>
{% endblock -%}
</testcase>
</testsuite>
</testsuites>