summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorFeceoru, Gabriel <gabriel.feceoru@intel.com>2015-11-03 17:50:41 +0200
committerDylan Baker <baker.dylan.c@gmail.com>2015-11-24 16:21:57 -0800
commitf16d011db75b08ceae241e7370599146691340ab (patch)
tree66774025a997b421aedfcdd1a8726294fabdb7cc /templates
parentfb07979aa7d0eae8949a5f4799e4a5307cad2526 (diff)
framework: Add support for feature readiness.
This adds a new "summary feature" command to piglit which creates a HTML table with the feature x DUT status (useful for multiple features, multiple DUTs). Another use case is the feature status for subsequent test results (depending on the meaning of that test result - DUT or build) A feature readiness is defined by the piglit regexp which selects the tests relevant for that feature and the acceptance percentage threshold (pass rate). It requires an input json file containing the list of features, in the following format (this is just an example): { "glsl" : { "include_tests" : "glsl", "exclude_tests" : "", "target_rate" : 90 }, "arb" : { "include_tests" : "arb_gpu", "exclude_tests" : "", "target_rate" : 10 } } v3: Changed json rate to int instead of string Applied other review comments v2: Apply review comments (Dylan, Thomas) Fixed 2nd round of review comments Signed-off-by: Gabriel Feceoru <gabriel.feceoru@intel.com> Reviewed-by: Dylan Baker <baker.dylan.c@gmail.com>
Diffstat (limited to 'templates')
-rw-r--r--templates/feature.mako73
1 files changed, 73 insertions, 0 deletions
diff --git a/templates/feature.mako b/templates/feature.mako
new file mode 100644
index 000000000..ac9bc8677
--- /dev/null
+++ b/templates/feature.mako
@@ -0,0 +1,73 @@
+<%!
+ import posixpath # this must be posixpath, since we want /'s not \'s
+ import re
+
+
+ def feat_result(result):
+ """Percentage result string"""
+ return '{}/{}'.format(result[0], result[1])
+
+
+ def escape_filename(key):
+ """Avoid reserved characters in filenames."""
+ return re.sub(r'[<>:"|?*#]', '_', key)
+
+
+ def escape_pathname(key):
+ """ Remove / and \\ from names """
+ return re.sub(r'[/\\]', '_', key)
+
+
+ def normalize_href(href):
+ """Force backward slashes in URLs."""
+ return href.replace('\\', '/')
+%>
+
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <title>Result summary</title>
+ <link rel="stylesheet" href="index.css" type="text/css" />
+ </head>
+ <body>
+ <h1>Feature readiness</h1>
+ <table>
+ <colgroup>
+ ## Name Column
+ <col />
+
+ ## Status columns
+ ## Create an additional column for each summary
+ % for _ in xrange(len(results.results)):
+ <col />
+ % endfor
+ </colgroup>
+ <tr>
+ <th/>
+ % for res in results.results:
+ <th class="head"><b>${res.name}</b><br />\
+ (<a href="${normalize_href(posixpath.join(escape_pathname(res.name), 'index.html'))}">info</a>)</th>
+ % endfor
+ </tr>
+ % for feature in results.features:
+ <tr>
+ ## Add the left most column, the feature name
+ <td>
+ <div class="group">
+ <b>${feature}</b>
+ </div>
+ </td>
+ ## add the feature totals
+ % for res in results.results:
+ <td class="${results.feat_status[res.name][feature]}">
+ <b>${feat_result(results.feat_fractions[res.name][feature])}</b>
+ </td>
+ % endfor
+ </tr>
+ % endfor
+ </table>
+ </body>
+</html>