3 Creating Custom Output Formats

Warning: The API presented here is unstable, and may change without warning.

Any package may add an output format to cover. A format is, roughly, a function that takes coverage information and transforms it into some other format. To add a format put a definition for cover-formats into a packages "info.rkt". This should be a (listof (list command-name module-path function-name)):
  • command-name is a string which will be used as the argument to -c to use this format.

  • module-path should be the path to a racket file providing this format.

  • function-name should be a symbol that is bound to a function in module-path. It should match the contract (->* (coverage/c (listof any/c)) (path-string?) any), and is the implementation of the format. The first argument is the coverage map, the second are the files in the map, and the third is the directory to put the coverage in.

Output formats should log any “verbose” output at the 'debug level to the topic 'cover. These are printed with Cover’s -v flag.