Skip to content

Commit

Permalink
improve template to output TestResultDrop.Messages
Browse files Browse the repository at this point in the history
  • Loading branch information
smdn committed Jun 12, 2023
1 parent fa3948d commit f058872
Showing 1 changed file with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -239,16 +239,34 @@ SPDX-License-Identifier: MIT
{%- else -%}
{%- assign result_has_error_stack_trace = false -%}
{%- endif -%}
{%- if result_has_error_message or result_has_error_stack_trace -%}
{%- if result.messages.size == 0 -%}
{%- assign result_has_messages = false -%}
{%- else -%}
{%- assign result_has_messages = true -%}
{%- endif -%}
{%- if result_has_error_message or result_has_error_stack_trace or result_has_messages -%}
<dl>
{%- if result_has_error_message -%}
<dt>Message:</dt>
<dt>Error message:</dt>
<dd><pre><code>{{ result.error_message | escape }}</code></pre></dd>
{%- endif -%}
{%- if result_has_error_stack_trace -%}
<dt>Stack trace:</dt>
<dd><pre><code>{{ result.error_stack_trace | escape }}</code></pre></dd>
{%- endif -%}
{%- if result_has_messages -%}
{%- for message in result.messages -%}
{%- if message.text != result.error_message -%}
<dt>Message <code>{{ message.category | escape }}</code>:</dt>
<dd>
<details{{ result_details_open_attr }}>
<summary>{{ message.category | escape }}</summary>
<pre><code>{{ message.text | escape }}</code></pre>
</details>
</dd>
{%- endif -%}
{%- endfor -%}
{%- endif -%}
{%- endif -%}
</dl>
{%- endif -%}
Expand Down

0 comments on commit f058872

Please sign in to comment.