1<link type="text/css" rel="Stylesheet" 2href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/ui-lightness/jquery-ui.css"/> 3 4<script type="text/javascript" src="https://www.google.com/jsapi"></script> 5<script type="text/javascript"> 6 google.load("visualization", "1.1", {packages: ["corechart", "table"]}); 7 google.load("jquery", "1.6.2"); 8 google.load("jqueryui", "1.8.16"); 9 10 function drawChart(name, label, table) { 11 var data = google.visualization.arrayToDataTable(table); 12 var chart = new google.visualization.PieChart( 13 document.getElementById(name)); 14 15 chart.draw(data, 16 {title: label, pieSliceText: "value", width: 800, height: 400}); 17 } 18 19 function drawTable(name, table) { 20 var data = google.visualization.arrayToDataTable(table); 21 var table = new google.visualization.Table( 22 document.getElementById(name)); 23 24 table.draw(data, { 25 showRowNumber: false, allowHtml: true, sortColumn: 0}); 26 } 27 28 google.setOnLoadCallback(function () { 29 $( "#testruns" ).tabs(); 30 31 {% for test_run in test_runs %} 32 $( "#testrun{{ test_run.id }}" ).tabs(); 33 34 {% for result_type, group in test_run.groups.items %} 35 $( "#testrun{{ test_run.id }}-{{ result_type }}-tables" ).accordion({ 36 autoHeight: false, collapsible: true, active: false }); 37 38 drawChart( 39 "testrun{{ test_run.id }}-{{ result_type }}-chart", 40 "DejaGNU test {{ result_type }} summary for {{ test_run.name }}", 41 [ 42 ["Result", "Count"], 43 {% for result, count in group.summary %} 44 ["{{ result }}", {{ count }}],{% endfor %} 45 ]); 46 47 {% for description, test_list in group.tests %} 48 {% if test_list %} 49 drawTable( 50 "testrun{{ test_run.id }}-{{ result_type }}-table-{{ forloop.counter }}", 51 [ 52 ["Test", "Variant"], 53 {% for test, variant in test_list %} 54 ["{{ test }}", "{{ variant }}"],{% endfor %} 55 ]); 56 {% endif %} 57 {% endfor %} 58 {% endfor %} 59 {% endfor %} 60 }); 61</script> 62 63<div id="testruns"> 64 <ul> 65 {% for test_run in test_runs %} 66 <li><a href="#testrun{{ test_run.id }}">{{ test_run.name }}</a></li> 67 {% endfor %} 68 </ul> 69 70 {% for test_run in test_runs %} 71 <div id="testrun{{ test_run.id }}" style="padding: 0px"> 72 <ul> 73 {% for result_type, group in test_run.groups.items %} 74 <li> 75 <a href="#testrun{{ test_run.id }}-{{ forloop.counter }}">{{ result_type }}</a> 76 </li> 77 {% endfor %} 78 </ul> 79 {% for result_type, group in test_run.groups.items %} 80 <div id="testrun{{ test_run.id }}-{{ forloop.counter }}"> 81 <div id="testrun{{ test_run.id }}-{{ result_type }}-chart" style="text-align: center"></div> 82 <div id="testrun{{ test_run.id }}-{{ result_type }}-tables"> 83 {% for description, test_list in group.tests %} 84 {% if test_list %} 85 <h3><a href="#">{{ description }}</a></h3> 86 <div id="testrun{{ test_run.id }}-{{ result_type }}-table-{{ forloop.counter }}"></div> 87 {% endif %} 88 {% endfor %} 89 </div> 90 </div> 91 {% endfor %} 92 </div> 93{% endfor %} 94</div> 95