Next: , Previous: , Up: API  


1.9 (veritas reporter)

1.9.1 Macros

Macro: log x

Print msg on a line of its own.

(log "Hello World")
;; Outputs: \nHello World
Macro: log-assert x

Announce an assertion that is about to be checked, by name.

Macro: log-benchmark x

Report benchmark results, given a benchmark-result record.

Macro: log-debug x

Log a message for debugging.

Macro: log-error x

Report a runtime error.

Macro: log-fail x

Report a failing check.

Macro: log-info x

Log an informational message.

Macro: log-pass x

Report a passing check.

Macro: log-suite x

Announce a suite by name.

Macro: log-test x

Announce a test by name.

1.9.2 Procedures

Procedure: dispatch-log vc log-type msg

Send msg to the reporter chosen in vc.

The client names one under the key 'reporter; anything else falls back to emoji-reporter. log-type picks the entry to call ('log-pass, 'log-fail, and so on).

Procedure: ensure-parent-directories path

Create every directory in front of path, ignoring ones that exist.

Procedure: junit-report-data all-results KEY: #:seconds

Return the JUnit report of all-results as data rather than a file.

The result is an alist holding the numbers a testsuites element needs - tests, failures, errors and skipped - and xml, the testsuite elements themselves as a string. Writing the file is write-junit-document’s job; a separate process can be handed this alist and its run joined to others with merge-junit-data, which is how one document is made out of the parallel runs of --jobs.

Procedure: merge-junit-data datas

Combine the JUnit data of several runs into one.

The counts are summed and the testsuite elements are concatenated in the order given, so the merged document keeps the order the runs were scheduled in.

Procedure: read-junit-data path

Return the JUnit data recorded at path, or #f.

#f means there is nothing to merge: the file is missing, unreadable or not the alist write-junit-data writes.

Procedure: write-junit-data data KEY: #:path

Write JUnit data to path so another process can read it back.

An alist is plain Scheme data, so read restores it exactly: this is how a worker process hands its report to the process that merges them. Returns path.

Procedure: write-junit-document data KEY: #:seconds #:path

Write JUnit data, as made by junit-report-data, to path.

seconds is the wall clock of the run and becomes the document’s total time; for a run split over worker processes it is the wall clock of the whole parallel run, not the sum of the workers. Returns path.

testcase elements carry no time attribute: the result records do not keep per-test timings.

Procedure: write-junit-report all-results KEY: #:seconds #:path

Write all-results to path as one JUnit XML document.

seconds is the wall clock of the run and becomes the document’s total time. Every test becomes a testcase inside a testsuite named after the suites it sits in; loose tests land in a suite called veritas. A benchmark is reported as skipped, because it measures instead of asserting, and a task that raised is reported as an error rather than a failure. Returns path.

testcase elements carry no time attribute: the result records do not keep per-test timings.

1.9.3 Variables

Variable: ansi-color-escapes
((yellow . "\x1b[0;33m") (magenta . "\x1b[0;35m") (green . "\x1b[0;32m") (default . "\x1b[0;39m") (bold . "\x1b[1m") (red . "\x1b[0;31m") (blue . "\x1b[0;34m") (cyan . "\x1b[0;36m") (reset . "\x1b[0m"))
Variable: emoji-reporter
((reporter-name . emoji-reporter) (log-pass . #<procedure 7f3910a89dc8 at veritas/reporter.scm:134:47 (msg)>) (log-fail . #<procedure 7f3910a89dd8 at veritas/reporter.scm:144:14 (msg)>) (log-debug . #<procedure 7f3910a89de8 at veritas/reporter.scm:151:15 (msg)>) (log-info . #<procedure 7f3910a89df8 at veritas/reporter.scm:158:14 (msg)>) (log-error . #<procedure 7f3910a89e08 at veritas/reporter.scm:165:15 (msg)>) (log-test . #<procedure 7f3910a89e18 at veritas/reporter.scm:172:14 (msg)>) (log-benchmark . #<procedure 7f3910a89e28 at veritas/reporter.scm:185:19 (msg)>) (log-suite . #<procedure 7f3910a89e38 at veritas/reporter.scm:219:15 (msg)>) (log-assert . #<procedure 7f3910a89e48 at veritas/reporter.scm:233:16 (msg)>))
Variable: json-reporter
((reporter-name . json-reporter) (log-pass . #<procedure 7f3910a89f68 at veritas/reporter.scm:312:46 (msg)>) (log-fail . #<procedure 7f3910a89f78 at veritas/reporter.scm:321:14 (msg)>) (log-error . #<procedure 7f3910a89f88 at veritas/reporter.scm:327:15 (msg)>) (log-test . #<procedure 7f3910a89f98 at veritas/reporter.scm:333:14 (msg)>) (log-benchmark . #<procedure 7f3910a89fa8 at veritas/reporter.scm:339:19 (msg)>) (log-debug . #<procedure 7f3910a89fb8 at veritas/reporter.scm:366:15 (msg)>) (log-info . #<procedure 7f3910a89fc8 at veritas/reporter.scm:372:14 (msg)>) (log-suite . #<procedure 7f3910a89fd8 at veritas/reporter.scm:378:15 (msg)>) (log-assert . #<procedure 7f3910a89fe8 at veritas/reporter.scm:384:16 (msg)>))
Variable: junit-reporter
((reporter-name . junit-reporter) (log-pass . #<procedure junit-quiet (msg)>) (log-assert . #<procedure junit-quiet (msg)>) (log-test . #<procedure junit-quiet (msg)>) (log-suite . #<procedure junit-quiet (msg)>) (log-debug . #<procedure junit-quiet (msg)>) (log-benchmark . #<procedure junit-quiet (msg)>) (log-fail . #<procedure 7f3910a8a300 at veritas/reporter.scm:710:14 (msg)>) (log-error . #<procedure 7f3910a8a310 at veritas/reporter.scm:713:15 (msg)>) (log-info . #<procedure 7f3910a8a320 at veritas/reporter.scm:716:14 (msg)>))
Variable: monotone-reporter
((reporter-name . monotone-reporter) (log-pass . #<procedure 7f3910a89e90 at veritas/reporter.scm:248:50 (msg)>) (log-fail . #<procedure 7f3910a89ea0 at veritas/reporter.scm:252:14 (msg)>) (log-error . #<procedure 7f3910a89eb0 at veritas/reporter.scm:257:15 (msg)>) (log-test . #<procedure 7f3910a89ec0 at veritas/reporter.scm:262:14 (msg)>) (log-benchmark . #<procedure 7f3910a89ed0 at veritas/reporter.scm:267:19 (msg)>) (log-debug . #<procedure 7f3910a89ee0 at veritas/reporter.scm:287:15 (msg)>) (log-info . #<procedure 7f3910a89ef0 at veritas/reporter.scm:292:14 (msg)>) (log-suite . #<procedure 7f3910a89f00 at veritas/reporter.scm:297:15 (msg)>) (log-assert . #<procedure 7f3910a89f10 at veritas/reporter.scm:303:16 (msg)>))

Next: (veritas runner), Previous: (veritas prelude), Up: API