From: František Dvořák Date: Sun, 13 Sep 2015 20:43:20 +0000 (+0200) Subject: Full HTML report. X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=62112739a215f96cef805d804e3c97cc847f5bf4;p=pOCCI-flask.git Full HTML report. --- diff --git a/app.py b/app.py index 6bd302b..a2cd8de 100755 --- a/app.py +++ b/app.py @@ -44,15 +44,15 @@ class SubmitForm(Form): @app.route('/', methods=['GET', 'POST']) def launch(): - error = None + error = False if request.method == 'POST': - opts = [] + opts = ['--format', 'htmltable'] for p in params.keys(): if p in request.form and request.form[p]: opts.append(params[p]) opts.append(request.form[p]) - opts.append('-t') + opts.append('--tests') opts.append(','.join(request.form.getlist('tests'))) #print opts @@ -63,11 +63,11 @@ def launch(): pOCCI.main(opts) except SystemExit as se: if se.args[0] >= 2: - error = 'Fatal error.' + error = True sys.stdout = sys.__stdout__ sys.stderr = sys.__stderr__ - return render_template('output.html', result = out[0].getvalue() + out[1].getvalue(), error = error) + return render_template('output.html', result = out[0].getvalue(), stderr = out[1].getvalue(), error = error) form = SubmitForm() diff --git a/static/style.css b/static/style.css index d909c29..96194da 100644 --- a/static/style.css +++ b/static/style.css @@ -1 +1,6 @@ label.field {font-weight: bold;} +th {text-align:left;} +td.ok {color:green;} +td.fail {color:red;} +td.skipped {color:orange;} +span.fail {font-size:large;} diff --git a/templates/output.html b/templates/output.html index 6d97a01..3996694 100644 --- a/templates/output.html +++ b/templates/output.html @@ -7,9 +7,23 @@ -
{{ result }}
{% if error %} -

{{error}} + +

{{result}} +{% else %} + + + + + + + +{{ result|safe }} +
TestRunning TimeStatusReason
+{% endif %} +{% if stderr %} + +

{{stderr}} {% endif %}