aboutsummaryrefslogtreecommitdiff
path: root/automation/clients/report/dejagnu/report.html
blob: 39b39e0996a26f8d6a4ec722c9ba49c292f7b6e2 (plain)
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
<link type="text/css" rel="Stylesheet"
href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/ui-lightness/jquery-ui.css"/>

<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
  google.load("visualization", "1.1", {packages: ["corechart", "table"]});
  google.load("jquery", "1.6.2");
  google.load("jqueryui", "1.8.16");

  function drawChart(name, label, table) {
    var data = google.visualization.arrayToDataTable(table);
    var chart = new google.visualization.PieChart(
        document.getElementById(name));

    chart.draw(data,
        {title: label, pieSliceText: "value", width: 800, height: 400});
  }

  function drawTable(name, table) {
    var data = google.visualization.arrayToDataTable(table);
    var table = new google.visualization.Table(
        document.getElementById(name));

    table.draw(data, {
        showRowNumber: false, allowHtml: true, sortColumn: 0});
  }

  google.setOnLoadCallback(function () {
    $( "#testruns" ).tabs();

    {% for test_run in test_runs %}
      $( "#testrun{{ test_run.id }}" ).tabs();

      {% for result_type, group in test_run.groups.items %}
      $( "#testrun{{ test_run.id }}-{{ result_type }}-tables" ).accordion({
        autoHeight: false, collapsible: true, active: false });

      drawChart(
        "testrun{{ test_run.id }}-{{ result_type }}-chart",
        "DejaGNU test {{ result_type }} summary for {{ test_run.name }}",
        [
          ["Result", "Count"],
          {% for result, count in group.summary %}
          ["{{ result }}", {{ count }}],{% endfor %}
        ]);

        {% for description, test_list in group.tests %}
        {% if test_list %}
        drawTable(
          "testrun{{ test_run.id }}-{{ result_type }}-table-{{ forloop.counter }}",
          [
            ["Test", "Variant"],
            {% for test, variant in test_list  %}
            ["{{ test }}", "{{ variant }}"],{% endfor %}
          ]);
        {% endif %}
        {% endfor %}
      {% endfor %}
    {% endfor %}
    });
</script>

<div id="testruns">
  <ul>
  {% for test_run in test_runs %}
    <li><a href="#testrun{{ test_run.id }}">{{ test_run.name }}</a></li>
  {% endfor %}
  </ul>

  {% for test_run in test_runs %}
  <div id="testrun{{ test_run.id }}" style="padding: 0px">
    <ul>
    {% for result_type, group in test_run.groups.items %}
    <li>
    <a href="#testrun{{ test_run.id }}-{{ forloop.counter }}">{{ result_type }}</a>
    </li>
    {% endfor %}
    </ul>
    {% for result_type, group in test_run.groups.items %}
    <div id="testrun{{ test_run.id }}-{{ forloop.counter }}">
      <div id="testrun{{ test_run.id }}-{{ result_type }}-chart" style="text-align: center"></div>
      <div id="testrun{{ test_run.id }}-{{ result_type }}-tables">
      {% for description, test_list in group.tests %}
      {% if test_list %}
        <h3><a href="#">{{ description }}</a></h3>
        <div id="testrun{{ test_run.id }}-{{ result_type }}-table-{{ forloop.counter }}"></div>
      {% endif %}
      {% endfor %}
      </div>
    </div>
    {% endfor %}
  </div>
{% endfor %}
</div>