html.j2 2.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. {% macro assert(A) -%}
  2. <div class="event assert v_{{A.verdict}}">
  3. &nbsp;
  4. <div class="hint">
  5. <span class="verdict">{{A.verdict}}</span>{{A.hint|e}}
  6. </div>
  7. {% if A.data %}<pre class="data">{{A.data|e}}</pre>{% endif %}
  8. </div>
  9. {%- endmacro %}
  10. {% macro message(M) -%}
  11. <div class="event message s_{{M.severity}}">
  12. <div class="severity">{{M.severity}}</div>
  13. <pre class="message">{{M.message|e}}</pre>
  14. {% if M.data %}<pre class="data">{{M.data|e}}</pre>{% endif %}
  15. </div>
  16. {%- endmacro %}
  17. {% macro phase(P) -%}
  18. <div class="phase v_{{P.verdict}}">
  19. <div class="name p_{{P.type}}">
  20. <span class="verdict">{{P.verdict}}</span>{{P.name|e}}
  21. </div>
  22. {% for e in P.children %}
  23. {% if e.is_assert %}
  24. {{ assert(e) }}
  25. {% elif e.is_message %}
  26. {{ message(e) }}
  27. {% endif %}
  28. {% endfor %}
  29. </div>
  30. {%- endmacro %}
  31. <!doctype html>
  32. <html>
  33. <head>
  34. <title>JAT report {{ session.id }} {{session.test.id}} {{ session.test.version }}</title>
  35. <style type="text/css">
  36. body {
  37. color: gray;
  38. background-color: black;
  39. margin: 2em;
  40. }
  41. .lint { background-color: orange; padding: 1em }
  42. .phase {
  43. padding-left: 1em;
  44. margin-top: 2em;
  45. margin-bottom: 2em;
  46. }
  47. .phase .name { font-weight: bold }
  48. .phase .verdict { float: right }
  49. .p_setup { color: orange }
  50. .p_test { color: yellow }
  51. .p_diag { color: lightblue }
  52. .p_cleanup { color: blue }
  53. .event { border: 1px solid #333 }
  54. .v_PASS { color: green }
  55. .v_FAIL { color: red }
  56. .v_UNKNOWN { color: orange }
  57. .severity { float: right }
  58. .s_INFO { color: silver }
  59. .s_WARNING { color: orange }
  60. .s_ERROR { color: red }
  61. </style>
  62. </head>
  63. <body>
  64. <div class="lints">
  65. {% for lint in session.lints %}
  66. <div class="lint">{{ lint.msg|e }} <code>{{ lint._data|e }}</code></div>
  67. {% endfor %}
  68. </div>
  69. <div class="events">
  70. {% for e in session.eventtree.children %}
  71. {% if e.is_phase %}
  72. {{ phase(e) }}
  73. {% elif e.is_message %}
  74. {{ message(e) }}
  75. {% elif e.is_assert %}
  76. {{ assert(e) }}
  77. {% endif %}
  78. {% endfor %}
  79. </div>
  80. </body>
  81. </html>