diff --git a/extra/webapps/mason/report/report-tests.factor b/extra/webapps/mason/report/report-tests.factor new file mode 100644 index 0000000000..e6236906a6 --- /dev/null +++ b/extra/webapps/mason/report/report-tests.factor @@ -0,0 +1,7 @@ +USING: accessors stack-checker tools.test webapps.mason.report ; +IN: webapps.mason.report.tests + +! +{ ( -- x ) } [ + display>> infer +] unit-test diff --git a/extra/webapps/mason/report/report.factor b/extra/webapps/mason/report/report.factor index 6f64f4c9b5..a82fc30e8f 100644 --- a/extra/webapps/mason/report/report.factor +++ b/extra/webapps/mason/report/report.factor @@ -4,18 +4,17 @@ USING: accessors furnace.actions http.server.responses kernel urls xml.syntax webapps.mason.backend webapps.mason.utils ; IN: webapps.mason.report +: build-report ( -- response ) + [ + current-builder [ + last-report>> + ] [ <404> ] if* + ] with-mason-db ; + : ( -- action ) [ validate-os/cpu ] >>init - [ - [ - current-builder [ - last-report>> - ] [ - <404> - ] if - ] with-mason-db - ] >>display ; + [ build-report ] >>display ; : report-link ( builder -- xml ) [ URL" report" ] dip