Skip to content

Developers

xd009642 edited this page Nov 20, 2018 · 29 revisions

This section aims to layout some of the structure of Tarpaulin and provide a technical reference for the technologies underpinning it.

When Tarpaulin runs, the basic sequence of events is as follows (assuming the user is collecting coverage):

  1. Build the tests for the project to cover with any user supplied options
  2. Take the list of test binaries and for each one:
    • Run source analysis on the project identifying lines that can't be covered or will be absent from debug info but can be covered
    • Load the object file and parse to find lines that can be instrumented
    • Return a list of these lines and their addresses to populate with coverage stats
    • Fork the process, have the child run the test and the parent instrument it
    • The parent now steps through the code like a debugger logging coverage stats
  3. Merge all the coverage statistics to get unified stats for the project
  4. Generate any reports and save or send them

We can split tarpaulin into a few function areas as a result

  1. Interactions with the Rust build system (compiler, linker, Cargo)
  2. Source code analysis: what lines are uncoverable (#[derive(..)], what lines will be missed (unused templates)
  3. Finding lines to instrument - understanding what's in the DWARF tables or x86_64 assembly
  4. Tracing the process - ptrace in Linux, other tools for other operating systems
  5. Coverage reports - codecov.io, coveralls.io, Cobertura.xml, HTML, other useful formats
  6. General usability/code quality
Clone this wiki locally