Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
xd009642 committed Sep 5, 2021
2 parents 9bca12b + 1e45178 commit 58f22f6
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 6 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
From 2019 onwards, all notable changes to tarpaulin will be documented in this
file.

## [Unreleased]
## [0.18.2] 2021-09-05
### Added

### Changed
- Fix #819 incorrect handling of test args caused by removing the executable path as first program arg in execve

### Removed

Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cargo-tarpaulin"
version = "0.18.1"
version = "0.18.2"
authors = ["Daniel McKenna <[email protected]>"]
description = "Cargo-Tarpaulin is a tool to determine code coverage achieved via tests"
repository = "https://github.com/xd009642/tarpaulin"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Below is the help-text for a thorough explanation of the flags and features
available:

```
cargo-tarpaulin version: 0.18.0
cargo-tarpaulin version: 0.18.2
Tool to analyse test coverage of cargo projects
USAGE:
Expand Down
5 changes: 4 additions & 1 deletion src/process_handling/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,10 @@ fn execute_test(test: &TestBinary, ignored: bool, config: &Config) -> Result<Tes
Ok(hnd.into())
}
#[cfg(target_os = "linux")]
TraceEngine::Ptrace => execute(test.path(), &argv, envars.as_slice()),
TraceEngine::Ptrace => {
argv.insert(0, test.path().display().to_string());
execute(test.path(), &argv, envars.as_slice())
}
e => Err(RunError::Engine(format!(
"invalid execution engine {:?}",
e
Expand Down
28 changes: 28 additions & 0 deletions tests/line_coverage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,31 @@ fn debug_info_0() {
assert!(!res.is_empty());
env::set_current_dir(restore_dir).unwrap();
}

#[test]
fn test_threads_1() {
let mut config = Config::default();
config.force_clean = false;
let restore_dir = env::current_dir().unwrap();
let test_dir = get_test_path("simple_project");
env::set_current_dir(&test_dir).unwrap();
config.manifest = test_dir.clone();
config.manifest.push("Cargo.toml");
config.varargs.push("--test-threads".to_string());
config.varargs.push("1".to_string());

let (res, ret) = launch_tarpaulin(&config, &None).unwrap();
assert_eq!(ret, 0);
assert!(!res.is_empty());
env::set_current_dir(restore_dir).unwrap();

let lib_file = test_dir.join("src/lib.rs");
let lib_traces = res.get_child_traces(&lib_file);
for l in &lib_traces {
if l.line == 6 {
assert_eq!(CoverageStat::Line(0), l.stats);
} else if l.line == 8 {
assert_eq!(CoverageStat::Line(1), l.stats);
}
}
}
2 changes: 1 addition & 1 deletion travis-install.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/bash
curl -sL https://github.com/xd009642/tarpaulin/releases/download/0.18.1/cargo-tarpaulin-0.18.1-travis.tar.gz | tar xvz -C $HOME/.cargo/bin
curl -sL https://github.com/xd009642/tarpaulin/releases/download/0.18.2/cargo-tarpaulin-0.18.2-travis.tar.gz | tar xvz -C $HOME/.cargo/bin

0 comments on commit 58f22f6

Please sign in to comment.