|
@@ -0,0 +1,73 @@
|
|
1
|
+
|
|
2
|
+#######
|
|
3
|
+# JINJA MACROS (ie. empty in resulting file)
|
|
4
|
+#######
|
|
5
|
+
|
|
6
|
+{% macro assert(A) -%}
|
|
7
|
+_distribution_jats__j2b_assert "{{A.verdict}}" "{{A.hint}}"
|
|
8
|
+{% if A.data %}
|
|
9
|
+_distribution_jats__j2b_assert_data "{{A.verdict}}" <<'EOD'
|
|
10
|
+{{A.data}}
|
|
11
|
+EOD
|
|
12
|
+{% endif %}
|
|
13
|
+{%- endmacro %}
|
|
14
|
+
|
|
15
|
+{% macro message(M) -%}
|
|
16
|
+_distribution_jats__j2b_message "{{M.severity}}" "{{M.message}}"
|
|
17
|
+{% if M.data %}
|
|
18
|
+_distribution_jats__j2b_message_data "{{M.severity}}" <<'EOD'
|
|
19
|
+{{M.data}}
|
|
20
|
+EOD
|
|
21
|
+{% endif %}
|
|
22
|
+{%- endmacro %}
|
|
23
|
+
|
|
24
|
+{% macro lint(L) -%}
|
|
25
|
+rlFail "{{ L.msg }}"
|
|
26
|
+_distribution_jats__j2b_lint_data <<'EOD'
|
|
27
|
+{{L._data}}
|
|
28
|
+EOD
|
|
29
|
+{%- endmacro %}
|
|
30
|
+
|
|
31
|
+{% macro phase(P) -%}
|
|
32
|
+_distribution_jats__j2b_pstart "{{P.verdict}}" "{{P.name}}" "{{P.type}}"
|
|
33
|
+ {% for e in P.children %}
|
|
34
|
+ {% if e.is_assert %}
|
|
35
|
+ {{ assert(e) }}
|
|
36
|
+ {% elif e.is_message %}
|
|
37
|
+ {{ message(e) }}
|
|
38
|
+ {% endif %}
|
|
39
|
+ {% endfor %}
|
|
40
|
+ rlLogInfo "phase verdict: {{P.verdict}}"
|
|
41
|
+rlPhaseEnd
|
|
42
|
+{%- endmacro %}
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+##########
|
|
46
|
+# CODE
|
|
47
|
+##########
|
|
48
|
+
|
|
49
|
+SESS_ID="{{session.id}} {{session.test.id}} {{session.test.version}}"
|
|
50
|
+
|
|
51
|
+rlLogInfo "ACTING OUT JAT SESSION: $SESS_ID"
|
|
52
|
+
|
|
53
|
+{% if session.lints %}
|
|
54
|
+rlPhaseStartCleanup "$SESS_ID lints"
|
|
55
|
+{% for l in session.lints %}
|
|
56
|
+{{ lint(l) }}
|
|
57
|
+{% endfor %}
|
|
58
|
+rlPhaseEnd
|
|
59
|
+{% endif %}
|
|
60
|
+
|
|
61
|
+{% if session.eventtree.children %}
|
|
62
|
+{% for e in session.eventtree.children %}
|
|
63
|
+ {% if e.is_phase %}
|
|
64
|
+ {{ phase(e) }}
|
|
65
|
+ {% elif e.is_message %}
|
|
66
|
+ {{ message(e) }}
|
|
67
|
+ {% elif e.is_assert %}
|
|
68
|
+ {{ assert(e) }}
|
|
69
|
+ {% endif %}
|
|
70
|
+{% endfor %}
|
|
71
|
+{% endif %}
|
|
72
|
+
|
|
73
|
+# vim: set filetype=txt:
|