]> gitweb.factorcode.org Git - factor.git/blob - extra/mason/report/report-tests.factor
io.files: exists? -> file-exists? and rename primitive.
[factor.git] / extra / mason / report / report-tests.factor
1 USING: io.directories io.files io.files.temp kernel mason.common
2 mason.config mason.report namespaces tools.test xml xml.writer ;
3 IN: mason.report.tests
4
5 { 0 0 } [ [ ] with-report ] must-infer-as
6
7 : verify-report ( -- )
8      [ t ] [ "report" file-exists? ] unit-test
9      [ ] [ "report" file>xml drop ] unit-test
10      [ ] [ "report" delete-file ] unit-test ;
11
12 "builds" temp-file builds-dir [
13     [
14         "resource:extra/mason/report/fake-data/" "." copy-tree
15
16         [ ] [
17             timings-table pprint-xml
18         ] unit-test
19
20         [ ] [ successful-report ] unit-test
21         verify-report
22
23         [ status-error ] [ 1234 compile-failed ] unit-test
24         verify-report
25
26         [ status-error ] [ 1235 boot-failed ] unit-test
27         verify-report
28
29         [ status-error ] [ 1236 test-failed ] unit-test
30         verify-report
31
32     ] with-temp-directory
33 ] with-variable