mason.report: fix timings-table, and add unit tests
parent
a4d48a1cd4
commit
dff8f80ea6
|
@ -0,0 +1 @@
|
||||||
|
Benchmarks
|
|
@ -0,0 +1 @@
|
||||||
|
{ "benchmarks" }
|
|
@ -0,0 +1 @@
|
||||||
|
1234
|
|
@ -0,0 +1 @@
|
||||||
|
H{ { "a" 1 } { "b" 2 } }
|
|
@ -0,0 +1,2 @@
|
||||||
|
Boot
|
||||||
|
Log
|
|
@ -0,0 +1 @@
|
||||||
|
1234
|
|
@ -0,0 +1,2 @@
|
||||||
|
Compile
|
||||||
|
Log
|
|
@ -0,0 +1 @@
|
||||||
|
Compiler errors
|
|
@ -0,0 +1 @@
|
||||||
|
{ "compiler-errors" }
|
|
@ -0,0 +1 @@
|
||||||
|
"deadbeef"
|
|
@ -0,0 +1 @@
|
||||||
|
Help lint
|
|
@ -0,0 +1 @@
|
||||||
|
1234
|
|
@ -0,0 +1 @@
|
||||||
|
{ "help-lint" }
|
|
@ -0,0 +1 @@
|
||||||
|
1234
|
|
@ -0,0 +1 @@
|
||||||
|
Load everything
|
|
@ -0,0 +1 @@
|
||||||
|
{ "load-everything" }
|
|
@ -0,0 +1 @@
|
||||||
|
1234
|
|
@ -0,0 +1 @@
|
||||||
|
Test all errors
|
|
@ -0,0 +1 @@
|
||||||
|
{ "test-all" }
|
|
@ -0,0 +1,2 @@
|
||||||
|
Test
|
||||||
|
Log
|
|
@ -0,0 +1 @@
|
||||||
|
1234
|
|
@ -1,4 +1,28 @@
|
||||||
IN: mason.report.tests
|
IN: mason.report.tests
|
||||||
USING: mason.report tools.test ;
|
USING: io.files io.directories kernel mason.report mason.common
|
||||||
|
tools.test xml xml.writer ;
|
||||||
|
|
||||||
{ 0 0 } [ [ ] with-report ] must-infer-as
|
{ 0 0 } [ [ ] with-report ] must-infer-as
|
||||||
|
|
||||||
|
: verify-report ( -- )
|
||||||
|
[ t ] [ "report" exists? ] unit-test
|
||||||
|
[ ] [ "report" file>xml drop ] unit-test
|
||||||
|
[ ] [ "report" delete-file ] unit-test ;
|
||||||
|
|
||||||
|
"resource:extra/mason/report/fake-data/" [
|
||||||
|
[ ] [
|
||||||
|
timings-table pprint-xml
|
||||||
|
] unit-test
|
||||||
|
|
||||||
|
[ ] [ successful-report ] unit-test
|
||||||
|
verify-report
|
||||||
|
|
||||||
|
[ status-error ] [ 1234 compile-failed ] unit-test
|
||||||
|
verify-report
|
||||||
|
|
||||||
|
[ status-error ] [ 1235 boot-failed ] unit-test
|
||||||
|
verify-report
|
||||||
|
|
||||||
|
[ status-error ] [ 1236 test-failed ] unit-test
|
||||||
|
verify-report
|
||||||
|
] with-directory
|
||||||
|
|
|
@ -3,7 +3,8 @@
|
||||||
USING: benchmark combinators.smart debugger fry io assocs
|
USING: benchmark combinators.smart debugger fry io assocs
|
||||||
io.encodings.utf8 io.files io.sockets io.streams.string kernel
|
io.encodings.utf8 io.files io.sockets io.streams.string kernel
|
||||||
locals mason.common mason.config mason.platform math namespaces
|
locals mason.common mason.config mason.platform math namespaces
|
||||||
prettyprint sequences xml.syntax xml.writer combinators.short-circuit ;
|
prettyprint sequences xml.syntax xml.writer combinators.short-circuit
|
||||||
|
literals ;
|
||||||
IN: mason.report
|
IN: mason.report
|
||||||
|
|
||||||
: common-report ( -- xml )
|
: common-report ( -- xml )
|
||||||
|
@ -56,15 +57,14 @@ IN: mason.report
|
||||||
|
|
||||||
: timings-table ( -- xml )
|
: timings-table ( -- xml )
|
||||||
{
|
{
|
||||||
boot-time-file
|
$ boot-time-file
|
||||||
load-time-file
|
$ load-time-file
|
||||||
test-time-file
|
$ test-time-file
|
||||||
help-lint-time-file
|
$ help-lint-time-file
|
||||||
benchmark-time-file
|
$ benchmark-time-file
|
||||||
html-help-time-file
|
$ html-help-time-file
|
||||||
} [
|
} [
|
||||||
execute( -- string )
|
dup eval-file milli-seconds>time
|
||||||
dup utf8 file-contents milli-seconds>time
|
|
||||||
[XML <tr><td><-></td><td><-></td></tr> XML]
|
[XML <tr><td><-></td><td><-></td></tr> XML]
|
||||||
] map [XML <h2>Timings</h2> <table><-></table> XML] ;
|
] map [XML <h2>Timings</h2> <table><-></table> XML] ;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue