diff --git a/pykat/testing/web/templates/finesse_test_view.html b/pykat/testing/web/templates/finesse_test_view.html index d59784b23419d5c465dd5e044609787078ec1a26..7e9531497d13ff67a98289ed2a2c43340764b476 100644 --- a/pykat/testing/web/templates/finesse_test_view.html +++ b/pykat/testing/web/templates/finesse_test_view.html @@ -23,8 +23,10 @@ <li>{{ suite }}</li> <ul> {% for item in kats[suite] %} - <li><span style="display:inline-block;width: 300px"> - {{item[0]}}</span> <a href="/finesse/kat/{{suite}}/{{item[0]}}">Kat</a> + <li><span style="display:inline-block;width: 300px">{{item[0]}}</span> + <a href="/finesse/kat/{{suite}}/{{item[0]}}">Kat</a> + <a href="/finesse/out/{{view_test_id}}/{{suite}}/{{item[0]}}">Out</a> + <a href="/finesse/ref/{{suite}}/{{item[0]}}">Ref</a> <a href="/finesse/view/{{view_test_id}}/diff/{{suite}}/{{item[0]}}">Diff</a> <a href="/finesse/kat_history/{{suite}}/{{item[0]}}">History</a> Max rel diff = {{item[1]}}</li> diff --git a/pykat/testing/web/web_interface.py b/pykat/testing/web/web_interface.py index a994e611eb0739d3b716a1ba70b52ea74cc562ee..ff2fbca29c1c0284858cf60d6140c4fc7a63872d 100644 --- a/pykat/testing/web/web_interface.py +++ b/pykat/testing/web/web_interface.py @@ -610,6 +610,36 @@ def finesse_view_kat(suite, kat): return response +@app.route('/finesse/out/<test_id>/<suite>/<out>', methods=["GET"]) +def finesse_view_out(test_id,suite, out): + out = str(out).replace(".kat",".out") + OUT_FILE = os.path.join(app.instance_path,"tests",str(test_id),"outputs",suite,out) + + if os.path.exists(OUT_FILE): + contents = open(OUT_FILE).read() + else: + contents = "out file not found" + + response = make_response(contents) + response.headers["Content-type"] = "text/plain" + + return response + +@app.route('/finesse/ref/<suite>/<out>', methods=["GET"]) +def finesse_view_ref(suite, out): + out = str(out).replace(".kat",".out") + OUT_FILE = os.path.join(app.instance_path,"finesse_test","kat_test",suite,"reference",out) + + if os.path.exists(OUT_FILE): + kat_contents = open(OUT_FILE).read() + else: + kat_contents = "out file not found" + + response = make_response(kat_contents) + response.headers["Content-type"] = "text/plain" + + return response + @app.route('/finesse/kat_history/<suite>/<kat>', methods=["GET"]) def finesse_view_kat_history(suite, kat):