-
-
Notifications
You must be signed in to change notification settings - Fork 181
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):
- Build the tests for the project to cover with any user supplied options
- 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
- Merge all the coverage statistics to get unified stats for the project
- Generate any reports and save or send them
We can split tarpaulin into a few function areas as a result
- Interactions with the Rust build system (compiler, linker, Cargo)
- Source code analysis: what lines are uncoverable (
#[derive(..)]
, what lines will be missed (unused templates) - Finding lines to instrument - understanding what's in the DWARF tables or x86_64 assembly
- Tracing the process - ptrace in Linux, other tools for other operating systems
- Coverage reports - codecov.io, coveralls.io, Cobertura.xml, HTML, other useful formats
- General usability/code quality