Skip to content

Commit

Permalink
Added Contributing.md and updated readme.
Browse files Browse the repository at this point in the history
Also renamed the auto-generated LICENSE-APACHE for consistency.
  • Loading branch information
xd009642 committed Jul 23, 2017
1 parent bddaee0 commit 5f07d9b
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 15 deletions.
39 changes: 39 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Contributing to Tarpaulin

Contributions to Tarpaulin are always welcome and encouraged. Check below to
information on the various methods of contributing.

## Feature Requests

Currently there's no mechanism for feature requests as such so just use the
Github issue tracker.

## Reporting bugs

If you find an issue in Tarpaulin, please report it using the Github issue
tracker. When you make the issue if you could provide the following information
we can recreate the issue and resolve it quicker.

* A description of the problem
* Tarpaulin output
* The rust project you ran Tarpaulin on
* Your linux distro and version (output of `uname -a` is sufficient)
* Version of rustc used

The verbose output of Tarpaulin is preferred but isn't always necessary. If you
want to include the verbose output and it's very long a pastebin link or similar
is ideal.

If there's a reason you can't share your project code publicly, a small example
project which recreates the issue would help a great deal. You can always
download one of the example projects used to test Tarpaulin from tests/data and
see if they work.

## Pull Requests

Pull requests are welcome, after you've implemented your feature test it on your
own system and submit a PR. Make sure to explain what the feature adds to
Tarpaulin and any information you feel will make the review go easier.

Any changes which break existing functionality won't be merged, but you'll
receive feedback and help to resolve those issues and close the PR.
File renamed without changes.
63 changes: 48 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,46 @@

![Build Status](https://travis-ci.org/xd009642/tarpaulin.svg?branch=master) [![Latest Version](https://img.shields.io/crates/v/cargo-tarpaulin.svg)](https://crates.io/crates/cargo-tarpaulin) [![License:MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Tarpaulin is designed to be a code coverage reporting tool for the Cargo build system, named for a waterproof cloth used to cover cargo on a ship. Currently, tarpaulin provides working line coverage but is still in the early development stage and therefore may contain some bugs. A lot of work has been done to get it working on some example projects and smaller crates so please report anything you find that's wrong. Also, check out our roadmap for planned features.

Tarpaulin only supports x86/x86_64 processors running linux. This is because instrumenting breakpoints into executables and tracing their execution requires processor and OS specific code. It is a goal when greater stability is reached to add wider system support, however this is sufficient to run Tarpaulin on popular CI tools like Travis.
Tarpaulin is designed to be a code coverage reporting tool for the Cargo build
system, named for a waterproof cloth used to cover cargo on a ship. Currently,
tarpaulin provides working line coverage but is still in the early development
stage and therefore may contain some bugs. A lot of work has been done to get it
working on some example projects and smaller crates so please report anything
you find that's wrong. Also, check out our roadmap for planned features.

Tarpaulin only supports x86_64 processors running linux. This is because
instrumenting breakpoints into executables and tracing their execution requires
processor and OS specific code. It is a goal when greater stability is reached
to add wider system support, however this is sufficient to run Tarpaulin on
popular CI tools like Travis.

## Features

Below is a list of features currently implemented. As Tarpaulin loads binary files into memory and parses the debugging information, different setups could lead to coverage not working. In this instance, please raise an issue detailing your setup and an example project and I'll attempt to fix it (please link us to a repo and the commit containing your project and paste the verbose output).
Below is a list of features currently implemented. As Tarpaulin loads binary
files into memory and parses the debugging information, different setups could
lead to coverage not working. In this instance, please raise an issue detailing
your setup and an example project and I'll attempt to fix it (please link us to
a repo and the commit containing your project and paste the verbose output).

* Line coverage
* Uploading coverage to https://coveralls.io

## Usage

Tarpaulin depends on cargo which depends on SSL. Make sure you've installed your distros ssl development libraries and they are on your path before attempting to install tarpaulin.
Tarpaulin depends on cargo which depends on SSL. Make sure you've installed
your distros ssl development libraries and they are on your path before
attempting to install tarpaulin.

To get detailed help on available arguments when running tarpaulin call:
```text
cargo tarpaulin --help
```
Currently no options are required, if no root directory is defined Tarpaulin will run in the current working directory.
Currently no options are required, if no root directory is defined Tarpaulin
will run in the current working directory.

Below is a Tarpaulin run utilising one of our example projects. This is a relatively simple project to test and if you check the test, you can see the output correctly reports the lines the test hits.
Below is a Tarpaulin run utilising one of our example projects. This is a
relatively simple project to test and if you check the test, you can see the
output correctly reports the lines the test hits.


```text
Expand Down Expand Up @@ -58,13 +76,24 @@ src/unused.rs: 0/4
58.33% coverage, 7/12 lines covered
```

Hint: if using coveralls.io with travis-ci run with the options "--ciserver travis-ci --coveralls $TRAVIS_JOB_ID". The coveralls.io repo-token is mainly designed for private repos and it won't generate a badge for the coverage results submitted (although you can still see them on the coveralls web interface). For an example of a project using Tarpaulin, you can check out my crate [keygraph-rs](https://github.com/xd009642/keygraph-rs).
Hint: if using coveralls.io with travis-ci run with the options
"--ciserver travis-ci --coveralls $TRAVIS_JOB_ID". The coveralls.io repo-token
is mainly designed for private repos and it won't generate a badge for the
coverage results submitted (although you can still see them on the coveralls
web interface). For an example of a project using Tarpaulin, you can check out
my crate [keygraph-rs](https://github.com/xd009642/keygraph-rs).

### Travis-ci and Coveralls.io

The expected most common usecase is launching coverage via a CI service to upload to a site like codecov or coveralls. Given the built in support and ubiquity of travis-ci it seems prudent to document the required steps here for new users. To follow these steps you'll first need a travis-ci and coveralls project for your repo.
The expected most common usecase is launching coverage via a CI service to
upload to a site like codecov or coveralls. Given the built in support and
ubiquity of travis-ci it seems prudent to document the required steps here for
new users. To follow these steps you'll first need a travis-ci and coveralls
project for your repo.

We recommend taking the minimal rust .travis.yml, installing the libssl-dev dependency tarpaulin has and then after the clean, build and test with the stable compiler installing tarpaulin and running it on the cleaned project. The clean step shouldn't be necessary but it's just to make sure for people who may have more complicated build steps (i.e. code generation).
We recommend taking the minimal rust .travis.yml, installing the libssl-dev
dependency tarpaulin has and then running Tarpaulin with the version of rustc
you require.

```text
language: rust
Expand Down Expand Up @@ -93,10 +122,11 @@ after_success: |
fi
```

## Issues and Contributing

## Limitations

Tarpaulin has currently only been tested on small crates or projects. It is entirely possible issues could occur with larger or more complicated projects. Please raise any issues you find to help improve tarpaulin for everyone.
Issues, feature requests and pull requests are always welcome! For a guide on
how to approach bugs found in Tarpaulin and adding features please check
CONTRIBUTING.md.

## Roadmap

Expand All @@ -111,8 +141,11 @@ Tarpaulin has currently only been tested on small crates or projects. It is enti

## License

Tarpaulin is currently licensed under the terms of both the MIT license and the Apache License (Version 2.0). See LICENSE-MIT and LICENSE-APACHE for more details.
Tarpaulin is currently licensed under the terms of both the MIT license and the
Apache License (Version 2.0). See LICENSE-MIT and LICENSE-APACHE for more details.

## Thanks

I wouldn't have been able to make progress as quickly in this project without Joseph Kain's blog on writing a debugger in Rust and C. It's a great read, so I recommend you check it out [here](http://system.joekain.com/debugger/).
I wouldn't have been able to make progress as quickly in this project without
Joseph Kain's blog on writing a debugger in Rust and C. It's a great read, so I
recommend you check it out [here](http://system.joekain.com/debugger/).

0 comments on commit 5f07d9b

Please sign in to comment.