Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
Releasing 0.6.7
  • Loading branch information
xd009642 committed Sep 13, 2018
2 parents e2e7494 + 3f92d1f commit 3b9da36
Show file tree
Hide file tree
Showing 28 changed files with 1,037 additions and 977 deletions.
9 changes: 2 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,14 @@ env:
global:
- CRATE_NAME=cargo-tarpaulin
rust:
- stable
- beta
- nightly
matrix:
allow_failures:
- rust: nightly
script:
- cargo clean
- RUST_BACKTRACE=1 cargo build
- cargo test
after_success: |
test $TRAVIS_BRANCH = develop &&
test $TRAVIS_RUST_VERSION = stable &&
test $TRAVIS_RUST_VERSION = nightly &&
./ci/trigger_docker_build.sh
before_deploy:
- cargo package
Expand All @@ -38,5 +33,5 @@ deploy:
skip_cleanup: true
on:
repo: xd009642/tarpaulin
condition: $TRAVIS_RUST_VERSION = stable
condition: $TRAVIS_RUST_VERSION = nightly
tags: true
1,014 changes: 508 additions & 506 deletions Cargo.lock

Large diffs are not rendered by default.

32 changes: 18 additions & 14 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,33 +1,37 @@
cargo-features = ["publish-lockfile"]

[package]
name = "cargo-tarpaulin"
version = "0.6.6"
version = "0.6.7"
authors = ["Daniel McKenna <[email protected]>"]
description = "Cargo-Tarpaulin is a tool to determine code coverage achieved via tests"
repository = "https://github.com/xd009642/tarpaulin"
readme = "README.md"
license = "MIT/Apache-2.0"
categories = ["development-tools"]
keywords = ["cargo", "cargo-subcommand", "testing"]
publish-lockfile = true

[[bin]]
name = "cargo-tarpaulin"

[dependencies]
nix = "0.11.0"
libc = "0.2.40"
gimli = "0.16.0"
cargo = "0.29"
clap = "2.31.2"
coveralls-api = "0.3.3"
fallible-iterator = "0.1.4"
gimli = "0.16.1"
lazy_static = "1.0"
libc = "0.2.40"
memmap = "0.6.2"
object = "0.9"
nix = "0.11.0"
object = "0.10"
proc-macro2 = "0.4.19"
quick-xml = "0.12.3"
regex = "1.0"
rustc-demangle = "0.1.7"
cargo = "0.24"
clap = "2.31.2"
serde = "1.0"
serde_json = "1.0"
coveralls-api = "0.3.3"
quick-xml = "0.12.1"
regex = "1.0"
lazy_static = "1.0"
syn = { version = "0.14.4", features = ["full"]}
proc-macro2 = "0.4.6"
walkdir = "2"
syn = { version = "0.15.3", features = ["full"]}
void = "1.0"
walkdir = "2.2.5"
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Tarpaulin

[![Build Status](https://travis-ci.org/xd009642/tarpaulin.svg?branch=master)](https://travis-ci.org/xd009642/tarpaulin) [![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) [![Docker](https://img.shields.io/docker/automated/xd009642/tarpaulin.svg)](https://hub.docker.com/r/xd009642/tarpaulin/)
[![Build Status](https://travis-ci.org/xd009642/tarpaulin.svg?branch=master)](https://travis-ci.org/xd009642/tarpaulin)[![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)[![Docker](https://img.shields.io/docker/automated/xd009642/tarpaulin.svg)](https://hub.docker.com/r/xd009642/tarpaulin/)

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,
Expand All @@ -18,6 +18,10 @@ popular CI tools like Travis.
It can also be run in Docker, which is useful for when you don't use Linux but
want to run it locally, e.g. during development. See below for how to do that.

**Due to unstable features in syn and issues with no packaging tarpaulin with
the Cargo.lock file tarpaulin is now a nightly only crate. Replace all calls to
`cargo tarpaulin` with `cargo +nightly tarpaulin`**

## Features

Below is a list of features currently implemented. As Tarpaulin loads binary
Expand Down Expand Up @@ -130,7 +134,9 @@ for your coverage reporting site of choice.

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.
rustc you require. Tarpaulin is installed in `before_cache` to allow it to be cached
and prevent having to reinstall every Travis run. You can also replace `cargo test`
with a verbose run of tarpaulin to see the test results as well as coverage output.

For codecov.io you'll need to export CODECOV_TOKEN are instructions on this in
the settings of your codecov project.
Expand All @@ -151,14 +157,19 @@ rust:
matrix:
allow_failures:
- rust: nightly

before_cache: |
if [[ "$TRAVIS_RUST_VERSION" == stable ]]; then
RUSTFLAGS="--cfg procmacro2_semver_exempt" cargo install cargo-tarpaulin
fi
script:
- cargo clean
- cargo build
- cargo test

after_success: |
if [[ "$TRAVIS_RUST_VERSION" == stable ]]; then
RUSTFLAGS="--cfg procmacro2_semver_exempt" cargo install cargo-tarpaulin
# Uncomment the following line for coveralls.io
# cargo tarpaulin --ciserver travis-ci --coveralls $TRAVIS_JOB_ID
Expand Down
18 changes: 9 additions & 9 deletions src/breakpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,31 @@ const INT: u64 = 0xCC;


/// Breakpoint construct used to monitor program execution. As tarpaulin is an
/// automated process, this will likely have less functionality than most
/// automated process, this will likely have less functionality than most
/// breakpoint implementations.
#[derive(Debug)]
pub struct Breakpoint {
pub struct Breakpoint {
/// Program counter
pub pc: u64,
/// Bottom byte of address data.
/// Bottom byte of address data.
/// This is replaced to enable the interrupt. Rest of data is never changed.
data: u8,
/// Reading from memory with ptrace gives addresses aligned to bytes.
/// Reading from memory with ptrace gives addresses aligned to bytes.
/// We therefore need to know the shift to place the breakpoint in the right place
shift: u64,
/// Map of the state of the breakpoint on each thread/process
/// Map of the state of the breakpoint on each thread/process
is_running: HashMap<Pid, bool>
}

impl Breakpoint {
/// Creates a new breakpoint for the given process and program counter.
/// Creates a new breakpoint for the given process and program counter.
pub fn new(pid:Pid, pc:u64) ->Result<Breakpoint> {
let aligned = pc & !0x7u64;
let data = read_address(pid, aligned)?;
let shift = 8 * (pc - aligned);
let data = ((data >> shift) & 0xFF) as u8;
let mut b = Breakpoint{

let mut b = Breakpoint{
pc,
data,
shift,
Expand All @@ -57,7 +57,7 @@ impl Breakpoint {
write_to_address(pid, self.aligned_address(), intdata)
}
}

fn disable(&self, pid: Pid) -> Result<c_long> {
// I require the bit fiddlin this end.
let data = read_address(pid, self.aligned_address())?;
Expand Down
Loading

0 comments on commit 3b9da36

Please sign in to comment.