From e9b1aa7b26c15c773c6db7995861b1c100b7625e Mon Sep 17 00:00:00 2001 From: xd009642 Date: Sat, 27 Jun 2020 15:27:48 +0100 Subject: [PATCH 01/17] Add RunTypes and more flags, plus cargo calls * Added RunTypes::{Bins, Lib, AllTargets} * cargo test --bins, cargo test --all-targets, cargo test --lib * CLI arguments --bins, --lib, --examples, --tests, --all-targets, --benches, --doc * Add CLI arguments (not yet used) --bin, --example, --test, --bench --- src/cargo.rs | 3 +++ src/config/parse.rs | 25 +++++++++++++++++++++++-- src/config/types.rs | 3 +++ src/main.rs | 11 +++++++++++ 4 files changed, 40 insertions(+), 2 deletions(-) diff --git a/src/cargo.rs b/src/cargo.rs index 8232b0a3cc..6a4cb947da 100644 --- a/src/cargo.rs +++ b/src/cargo.rs @@ -288,6 +288,9 @@ fn create_command(manifest_path: &str, config: &Config, ty: &RunType) -> Command RunType::Doctests => test_cmd.arg("--doc"), RunType::Benchmarks => test_cmd.arg("--benches"), RunType::Examples => test_cmd.arg("--examples"), + RunType::AllTargets => test_cmd.arg("--all-targets"), + RunType::Lib => test_cmd.arg("--lib"), + RunType::Bins => test_cmd.arg("--bins"), }; init_args(&mut test_cmd, config); setup_environment(&mut test_cmd, config); diff --git a/src/config/parse.rs b/src/config/parse.rs index 6902ad1c85..0861ada8db 100644 --- a/src/config/parse.rs +++ b/src/config/parse.rs @@ -111,7 +111,29 @@ pub(super) fn get_output_directory(args: &ArgMatches) -> Option { } pub(super) fn get_run_types(args: &ArgMatches) -> Vec { - values_t!(args.values_of("run-types"), RunType).unwrap_or_else(|_| vec![RunType::Tests]) + let mut res = values_t!(args.values_of("run-types"), RunType).unwrap_or_else(|_| vec![]); + if args.is_present("lib") && !res.contains(&RunType::Lib) { + res.push(RunType::Lib); + } + if args.is_present("all-targets") && !res.contains(&RunType::AllTargets) { + res.push(RunType::AllTargets); + } + if args.is_present("benches") && !res.contains(&RunType::Benchmarks) { + res.push(RunType::Benchmarks); + } + if args.is_present("bins") && !res.contains(&RunType::Bins) { + res.push(RunType::Bins); + } + if args.is_present("examples") && !res.contains(&RunType::Examples) { + res.push(RunType::Examples); + } + if args.is_present("doc") && !res.contains(&RunType::Doctests) { + res.push(RunType::Doctests); + } + if res.is_empty() || (args.is_present("tests") && !res.contains(&RunType::Tests)) { + res.push(RunType::Tests); + } + res } pub(super) fn get_excluded(args: &ArgMatches) -> Vec { @@ -120,7 +142,6 @@ pub(super) fn get_excluded(args: &ArgMatches) -> Vec { pub(super) fn regexes_from_excluded(strs: &[String]) -> Vec { let mut files = vec![]; - for temp_str in strs { let s = &temp_str.replace(".", r"\.").replace("*", ".*"); diff --git a/src/config/types.rs b/src/config/types.rs index 1a2f9f313b..28af54bf92 100644 --- a/src/config/types.rs +++ b/src/config/types.rs @@ -10,6 +10,9 @@ arg_enum! { Doctests, Benchmarks, Examples, + Lib, + Bins, + AllTargets, } } diff --git a/src/main.rs b/src/main.rs index 7e0ae38a9a..77623d5a60 100644 --- a/src/main.rs +++ b/src/main.rs @@ -57,6 +57,17 @@ fn main() -> Result<(), String> { .args_from_usage( "--config [FILE] 'Path to a toml file specifying a list of options this will override any other options set' --ignore-config 'Ignore any project config files' + --lib 'Test only this package's library unit tests' + --bin [NAME]... 'Test only the specified binary` + --bins 'Test all binaries' + --example [NAME]... 'Test only the specified example' + --examples 'Test all examples' + --test [NAME]... 'Test only the specified test target' + --tests 'Test all tests' + --bench [NAME]... 'Test only the specified bench target' + --benches 'Test all benches' + --doc 'Test only this library's documentation' + --all-targets 'Test all targets' --debug 'Show debug output - this is used for diagnosing issues with tarpaulin' --verbose -v 'Show extra output' --ignore-tests 'Ignore lines of test functions when collecting coverage' From 0b3ea96d3d3f77f9ebd4d8d2731cec49c69b4953 Mon Sep 17 00:00:00 2001 From: xd009642 Date: Sat, 27 Jun 2020 18:03:02 +0100 Subject: [PATCH 02/17] Add running for named tests * Can now run a named test/bin/example/bench like in cargo test * ignored tests in bins, examples and benches now work as intended * run types and named tests are now merged * Remove default RunType::Tests from config, now filled in at cargo.rs stage --- src/cargo.rs | 203 ++++++++++++++++++++++++++------------------ src/config/mod.rs | 47 ++++++++++ src/config/parse.rs | 2 +- src/lib.rs | 2 +- 4 files changed, 171 insertions(+), 83 deletions(-) diff --git a/src/cargo.rs b/src/cargo.rs index 6a4cb947da..b7bc5816a3 100644 --- a/src/cargo.rs +++ b/src/cargo.rs @@ -1,6 +1,6 @@ use crate::config::*; use crate::errors::RunError; -use cargo_metadata::{diagnostic::DiagnosticLevel, CargoOpt, Message, MetadataCommand}; +use cargo_metadata::{diagnostic::DiagnosticLevel, CargoOpt, Message, Metadata, MetadataCommand}; use log::{error, trace, warn}; use std::collections::HashMap; use std::env; @@ -14,7 +14,7 @@ use walkdir::{DirEntry, WalkDir}; #[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct TestBinary { path: PathBuf, - ty: RunType, + ty: Option, cargo_dir: Option, pkg_name: Option, pkg_version: Option, @@ -29,7 +29,7 @@ struct DocTestBinaryMeta { } impl TestBinary { - pub fn new(path: PathBuf, ty: RunType) -> Self { + pub fn new(path: PathBuf, ty: Option) -> Self { Self { path, ty, @@ -45,7 +45,7 @@ impl TestBinary { &self.path } - pub fn run_type(&self) -> RunType { + pub fn run_type(&self) -> Option { self.ty } @@ -106,84 +106,106 @@ pub fn get_tests(config: &Config) -> Result, RunError> { .map_err(|e| RunError::Cargo(e.to_string()))?; for ty in &config.run_types { - let mut cmd = create_command(manifest, config, ty); - if ty != &RunType::Doctests { - cmd.stdout(Stdio::piped()); - } else { - clean_doctest_folder(&config.doctest_dir()); - cmd.stdout(Stdio::null()); - } - trace!("Running command {:?}", cmd); - let mut child = cmd.spawn().map_err(|e| RunError::Cargo(e.to_string()))?; + run_cargo(&metadata, manifest, config, Some(*ty), &mut result)?; + } + if config.has_named_tests() { + run_cargo(&metadata, manifest, config, None, &mut result)? + } else if config.run_types.is_empty() { + run_cargo( + &metadata, + manifest, + config, + Some(RunType::Tests), + &mut result, + )?; + } + Ok(result) +} - if ty != &RunType::Doctests { - let mut package_ids = vec![]; - let reader = std::io::BufReader::new(child.stdout.take().unwrap()); - for msg in Message::parse_stream(reader) { - match msg { - Ok(Message::CompilerArtifact(art)) => { - if let Some(path) = art.executable { - if !art.profile.test && ty == &RunType::Tests { - continue; - } - result.push(TestBinary::new(path, *ty)); - package_ids.push(art.package_id.clone()); +fn run_cargo( + metadata: &Metadata, + manifest: &str, + config: &Config, + ty: Option, + result: &mut Vec, +) -> Result<(), RunError> { + let mut cmd = create_command(manifest, config, ty); + if ty != Some(RunType::Doctests) { + cmd.stdout(Stdio::piped()); + } else { + clean_doctest_folder(&config.doctest_dir()); + cmd.stdout(Stdio::null()); + } + trace!("Running command {:?}", cmd); + let mut child = cmd.spawn().map_err(|e| RunError::Cargo(e.to_string()))?; + + if ty != Some(RunType::Doctests) { + let mut package_ids = vec![]; + let reader = std::io::BufReader::new(child.stdout.take().unwrap()); + for msg in Message::parse_stream(reader) { + match msg { + Ok(Message::CompilerArtifact(art)) => { + if let Some(path) = art.executable { + if !art.profile.test && ty == Some(RunType::Tests) { + continue; } + result.push(TestBinary::new(path, ty)); + package_ids.push(art.package_id.clone()); } - Ok(Message::CompilerMessage(m)) => match m.message.level { - DiagnosticLevel::Error | DiagnosticLevel::Ice => { - let _ = child.wait(); - return Err(RunError::TestCompile(m.message.message)); - } - _ => {} - }, - Err(e) => { - error!("Error parsing cargo messages {}", e); + } + Ok(Message::CompilerMessage(m)) => match m.message.level { + DiagnosticLevel::Error | DiagnosticLevel::Ice => { + let _ = child.wait(); + return Err(RunError::TestCompile(m.message.message)); } _ => {} + }, + Err(e) => { + error!("Error parsing cargo messages {}", e); } + _ => {} } - for (res, package) in result.iter_mut().zip(package_ids.iter()) { - let package = &metadata[package]; - res.cargo_dir = package.manifest_path.parent().map(|x| x.to_path_buf()); - res.pkg_name = Some(package.name.clone()); - res.pkg_version = Some(package.version.to_string()); - res.pkg_authors = Some(package.authors.clone()); - } - child.wait().map_err(|e| RunError::Cargo(e.to_string()))?; - } else { - // need to wait for compiling to finish before getting doctests - // also need to wait with output to ensure the stdout buffer doesn't fill up - let out = child - .wait_with_output() - .map_err(|e| RunError::Cargo(e.to_string()))?; - if !out.status.success() { - error!("Building doctests failed"); - } - let walker = WalkDir::new(&config.doctest_dir()).into_iter(); - let dir_entries = walker - .filter_map(|e| e.ok()) - .filter(|e| match e.metadata() { - Ok(ref m) if m.is_file() && m.len() != 0 => true, - _ => false, - }) - .collect::>(); + } + for (res, package) in result.iter_mut().zip(package_ids.iter()) { + let package = &metadata[package]; + res.cargo_dir = package.manifest_path.parent().map(|x| x.to_path_buf()); + res.pkg_name = Some(package.name.clone()); + res.pkg_version = Some(package.version.to_string()); + res.pkg_authors = Some(package.authors.clone()); + } + child.wait().map_err(|e| RunError::Cargo(e.to_string()))?; + } else { + // need to wait for compiling to finish before getting doctests + // also need to wait with output to ensure the stdout buffer doesn't fill up + let out = child + .wait_with_output() + .map_err(|e| RunError::Cargo(e.to_string()))?; + if !out.status.success() { + error!("Building doctests failed"); + } + let walker = WalkDir::new(&config.doctest_dir()).into_iter(); + let dir_entries = walker + .filter_map(|e| e.ok()) + .filter(|e| match e.metadata() { + Ok(ref m) if m.is_file() && m.len() != 0 => true, + _ => false, + }) + .collect::>(); - let should_panics = get_panic_candidates(&dir_entries, config); - for dt in &dir_entries { - trace!("Found doctest binary {}", dt.path().display()); - let mut tb = TestBinary::new(dt.path().to_path_buf(), *ty); - // Now to do my magic! - if let Some(meta) = DocTestBinaryMeta::new(dt.path()) { - if let Some(lines) = should_panics.get(&meta.prefix) { - tb.should_panic |= lines.contains(&meta.line); - } + let should_panics = get_panic_candidates(&dir_entries, config); + for dt in &dir_entries { + trace!("Found doctest binary {}", dt.path().display()); + let mut tb = TestBinary::new(dt.path().to_path_buf(), ty); + // Now to do my magic! + if let Some(meta) = DocTestBinaryMeta::new(dt.path()) { + if let Some(lines) = should_panics.get(&meta.prefix) { + tb.should_panic |= lines.contains(&meta.line); } - result.push(tb); } + result.push(tb); } } - Ok(result) + Ok(()) } fn convert_to_prefix(p: &Path) -> Option { @@ -265,9 +287,9 @@ fn find_panics_in_file(file: &Path) -> io::Result> { Ok(lines) } -fn create_command(manifest_path: &str, config: &Config, ty: &RunType) -> Command { +fn create_command(manifest_path: &str, config: &Config, ty: Option) -> Command { let mut test_cmd = Command::new("cargo"); - if *ty == RunType::Doctests { + if ty == Some(RunType::Doctests) { if let Some(toolchain) = env::var("RUSTUP_TOOLCHAIN") .ok() .filter(|t| t.starts_with("nightly")) @@ -283,15 +305,34 @@ fn create_command(manifest_path: &str, config: &Config, ty: &RunType) -> Command test_cmd.args(&["test", "--no-run"]); } test_cmd.args(&["--message-format", "json", "--manifest-path", manifest_path]); - match ty { - RunType::Tests => test_cmd.arg("--tests"), - RunType::Doctests => test_cmd.arg("--doc"), - RunType::Benchmarks => test_cmd.arg("--benches"), - RunType::Examples => test_cmd.arg("--examples"), - RunType::AllTargets => test_cmd.arg("--all-targets"), - RunType::Lib => test_cmd.arg("--lib"), - RunType::Bins => test_cmd.arg("--bins"), - }; + if let Some(ty) = ty { + match ty { + RunType::Tests => test_cmd.arg("--tests"), + RunType::Doctests => test_cmd.arg("--doc"), + RunType::Benchmarks => test_cmd.arg("--benches"), + RunType::Examples => test_cmd.arg("--examples"), + RunType::AllTargets => test_cmd.arg("--all-targets"), + RunType::Lib => test_cmd.arg("--lib"), + RunType::Bins => test_cmd.arg("--bins"), + }; + } else { + for test in &config.test_names { + test_cmd.arg("--test"); + test_cmd.arg(test); + } + for test in &config.bin_names { + test_cmd.arg("--bin"); + test_cmd.arg(test); + } + for test in &config.example_names { + test_cmd.arg("--example"); + test_cmd.arg(test); + } + for test in &config.bench_names { + test_cmd.arg("--bench"); + test_cmd.arg(test); + } + } init_args(&mut test_cmd, config); setup_environment(&mut test_cmd, config); test_cmd diff --git a/src/config/mod.rs b/src/config/mod.rs index 9cf8e9182a..9c3693ab0a 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -10,6 +10,7 @@ use log::{error, info, warn}; use regex::Regex; use serde::{Deserialize, Serialize}; use std::cell::{Ref, RefCell}; +use std::collections::HashSet; use std::env; use std::fs::File; use std::io::{Error, ErrorKind, Read}; @@ -126,6 +127,19 @@ pub struct Config { /// Output files to generate #[serde(rename = "out")] pub generate: Vec, + /// Names of tests to run corresponding to `cargo --test ...` + #[serde(rename = "test")] + pub test_names: HashSet, + /// Names of binaries to run corresponding to `cargo --bin ...` + #[serde(rename = "bin")] + pub bin_names: HashSet, + /// Names of examples to run corresponding to `cargo --example ...` + #[serde(rename = "example")] + pub example_names: HashSet, + /// Names of benches to run corresponding to `cargo --bench ...` + #[serde(rename = "bench")] + pub bench_names: HashSet, + /// Result of cargo_metadata ran on the crate #[serde(skip_deserializing, skip_serializing)] pub metadata: RefCell>, } @@ -171,6 +185,10 @@ impl Default for Config { target: None, target_dir: None, offline: false, + test_names: HashSet::new(), + example_names: HashSet::new(), + bin_names: HashSet::new(), + bench_names: HashSet::new(), metadata: RefCell::new(None), } } @@ -229,6 +247,10 @@ impl<'a> From<&'a ArgMatches<'a>> for ConfigWrapper { target: get_target(args), target_dir: get_target_dir(args), offline: args.is_present("offline"), + test_names: get_list(args, "test").iter().cloned().collect(), + bin_names: get_list(args, "bin").iter().cloned().collect(), + bench_names: get_list(args, "bench").iter().cloned().collect(), + example_names: get_list(args, "example").iter().cloned().collect(), metadata: RefCell::new(None), }; if args.is_present("ignore-config") { @@ -434,6 +456,24 @@ impl Config { keep }); + for test in &other.test_names { + self.test_names.insert(test.clone()); + } + for test in &other.bin_names { + self.bin_names.insert(test.clone()); + } + for test in &other.example_names { + self.example_names.insert(test.clone()); + } + for test in &other.bench_names { + self.bench_names.insert(test.clone()); + } + for ty in &other.run_types { + if !self.run_types.contains(ty) { + self.run_types.push(*ty); + } + } + if !other.excluded_files_raw.is_empty() { self.excluded_files_raw .extend_from_slice(&other.excluded_files_raw); @@ -455,6 +495,13 @@ impl Config { } } + pub fn has_named_tests(&self) -> bool { + !(self.test_names.is_empty() + && self.bin_names.is_empty() + && self.example_names.is_empty() + && self.bench_names.is_empty()) + } + #[inline] pub fn is_coveralls(&self) -> bool { self.coveralls.is_some() diff --git a/src/config/parse.rs b/src/config/parse.rs index 0861ada8db..ff6b32b918 100644 --- a/src/config/parse.rs +++ b/src/config/parse.rs @@ -130,7 +130,7 @@ pub(super) fn get_run_types(args: &ArgMatches) -> Vec { if args.is_present("doc") && !res.contains(&RunType::Doctests) { res.push(RunType::Doctests); } - if res.is_empty() || (args.is_present("tests") && !res.contains(&RunType::Tests)) { + if args.is_present("tests") && !res.contains(&RunType::Tests) { res.push(RunType::Tests); } res diff --git a/src/lib.rs b/src/lib.rs index 550f5fa878..51a7edc5fd 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -111,7 +111,7 @@ pub fn launch_tarpaulin(config: &Config) -> Result<(TraceMap, i32), RunError> { res.1 }; } - if config.run_ignored && exe.run_type() == RunType::Tests { + if config.run_ignored { let coverage = get_test_coverage(&exe, &project_analysis, config, true)?; if let Some(res) = coverage { result.merge(&res.0); From 4384b1e854cfd8611962c7aabc0d7c8ea1b1d42a Mon Sep 17 00:00:00 2001 From: xd009642 Date: Sat, 27 Jun 2020 19:58:12 +0100 Subject: [PATCH 03/17] Add tests * Add test for config file with new fields * extend examples test with --example option with same coverage --- CHANGELOG.md | 12 ++++++++++++ README.md | 3 +++ src/config/mod.rs | 9 +++++++++ tests/mod.rs | 4 ++++ 4 files changed, 28 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ddf08e3846..9b5e6882c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,18 @@ From 2019 onwards, all notable changes to tarpaulin will be documented in this file. +## [Unreleased] +### Added +- run-types for lib, bins and all-targets +- `--tests` `--lib`, `--examples, `--bins`, `--doc`, `--benches`, +`--all-targets` flags matching `cargo test` +- Add named test running and flags `--test`, `--example`, `--bin`, `--bench` + +### Changed +- Now merge run-types in configs + +### Removed + ## [0.14.0] - 2020-06-25 ### Added - Filtering for `cfg(not(tarpaulin_include))` also adding `--cfg=tarpaulin` to default config diff --git a/README.md b/README.md index 974aca550c..a595348d82 100644 --- a/README.md +++ b/README.md @@ -460,6 +460,9 @@ follow `--` in tarpaulin use `args` in the toml file. Setting the field `config` will have no effect on the run as it won't be parsed for additional configuration. +For the flags `--lib`, `--examples`, `--benches, `--tests`, `--all-targets`, +`--doc`, `--bins` use the `run-types` entry in the config file. + ## Extending Tarpaulin There are some tools available which can extend tarpaulin functionality for diff --git a/src/config/mod.rs b/src/config/mod.rs index 9c3693ab0a..d423f3244e 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -936,6 +936,10 @@ mod tests { manifest-path = "/home/rust/foo/Cargo.toml" ciserver = "travis-ci" args = ["--nocapture"] + test = ["test1", "test2"] + bin = ["bin"] + example = ["example"] + bench = ["bench"] "#; let mut configs = Config::parse_config_toml(toml.as_bytes()).unwrap(); assert_eq!(configs.len(), 1); @@ -979,5 +983,10 @@ mod tests { assert_eq!(config.ci_tool, Some(CiService::Travis)); assert_eq!(config.root, Some("/home/rust".to_string())); assert_eq!(config.manifest, PathBuf::from("/home/rust/foo/Cargo.toml")); + assert!(config.test_names.contains("test1")); + assert!(config.test_names.contains("test2")); + assert!(config.bin_names.contains("bin")); + assert!(config.example_names.contains("example")); + assert!(config.bench_names.contains("bench")); } } diff --git a/tests/mod.rs b/tests/mod.rs index 9ec70bb2e8..1c7b6e687d 100644 --- a/tests/mod.rs +++ b/tests/mod.rs @@ -196,6 +196,10 @@ fn examples_coverage() { let mut config = Config::default(); config.run_types = vec![RunType::Examples]; + check_percentage_with_config(test, 1.0f64, true, config.clone()); + + config.run_types.clear(); + config.example_names.insert("say_hello".to_string()); check_percentage_with_config(test, 1.0f64, true, config); } From 076a16fc9df0d013d0f5a3f869b40d3caf2060e5 Mon Sep 17 00:00:00 2001 From: xd009642 Date: Sat, 27 Jun 2020 20:32:08 +0100 Subject: [PATCH 04/17] Add --no-fail-fast and --profile --- CHANGELOG.md | 1 + README.md | 16 +++++++++++++++- src/cargo.rs | 7 +++++++ src/config/mod.rs | 18 ++++++++++++++++++ src/config/parse.rs | 4 ++++ src/main.rs | 2 ++ 6 files changed, 47 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b5e6882c1..fb4f05e480 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ file. - `--tests` `--lib`, `--examples, `--bins`, `--doc`, `--benches`, `--all-targets` flags matching `cargo test` - Add named test running and flags `--test`, `--example`, `--bin`, `--bench` +- Equivalent options for `--no-fail-fast` and `--profile` ### Changed - Now merge run-types in configs diff --git a/README.md b/README.md index a595348d82..a2126bc643 100644 --- a/README.md +++ b/README.md @@ -35,9 +35,14 @@ USAGE: FLAGS: --all Alias for --workspace (deprecated) --all-features Build all available features + --all-targets Test all targets + --benches Test all benches + --bins Test all binaries -b, --branch Branch coverage: NOT IMPLEMENTED --count Counts the number of hits during coverage --debug Show debug output - this is used for diagnosing issues with tarpaulin + --doc Test only this library's documentation + --examples Test all examples --force-clean Adds a clean stage to work around cargo bugs that may affect coverage results -f, --forward Forwards unexpected signals to test. Tarpaulin will still take signals it is expecting. --frozen Do not update Cargo.lock or any caches @@ -46,18 +51,23 @@ FLAGS: --ignore-panics Ignore panic macros in tests --ignore-tests Ignore lines of test functions when collecting coverage -i, --ignored Run ignored tests as well + --lib Test only this package's library unit tests -l, --line Line coverage --locked Do not update Cargo.lock --no-default-features Do not include default features + --no-fail-fast Run all tests regardless of failure --no-run Compile tests but don't run coverage --offline Run without accessing the network --release Build in release mode. + --tests Test all tests -V, --version Prints version information -v, --verbose Show extra output --workspace Test all packages in the workspace OPTIONS: -Z ... List of unstable nightly only flags + --bench ... Test only the specified bench target + --bin ... Test only the specified binary --ciserver Name of service, supported services are: travis-ci, travis-pro, circle-ci, semaphore, jenkins and codeship. If you are interfacing with coveralls.io or another site you can also specify a @@ -66,6 +76,7 @@ OPTIONS: options set --coveralls Coveralls key, either the repo token, or if you're using travis use $TRAVIS_JOB_ID and specify travis-{ci|pro} in --ciserver + --example ... Test only the specified example -e, --exclude ... Package id specifications to exclude from coverage. See cargo help pkgid for more info --exclude-files ... Exclude given files from coverage results has * wildcard @@ -76,12 +87,15 @@ OPTIONS: --output-dir Specify a custom directory to write report files -p, --packages ... Package id specifications for which package should be build. See cargo help pkgid for more info + --profile Build artefacts with the specified profile --report-uri URI to send report to, only used if the option --coveralls is used -r, --root Calculates relative paths to root directory. If --manifest-path isn't specified it will look for a Cargo.toml in root - --run-types ... Type of the coverage run [possible values: Tests, Doctests, Benchmarks, Examples] + --run-types ... Type of the coverage run [possible values: Tests, Doctests, Benchmarks, Examples, + Lib, Bins, AllTargets] --target Compilation target triple --target-dir Directory for all generated artifacts + --test ... Test only the specified test target -t, --timeout Integer for the maximum time in seconds without response from test before timeout (default is 1 minute). diff --git a/src/cargo.rs b/src/cargo.rs index b7bc5816a3..f9a8856839 100644 --- a/src/cargo.rs +++ b/src/cargo.rs @@ -348,6 +348,13 @@ fn init_args(test_cmd: &mut Command, config: &Config) { if config.frozen { test_cmd.arg("--frozen"); } + if config.no_fail_fast { + test_cmd.arg("--no-fail-fast"); + } + if let Some(profile) = config.profile.as_ref() { + test_cmd.arg("--profile"); + test_cmd.arg(profile); + } if let Some(features) = config.features.as_ref() { test_cmd.arg("--features"); test_cmd.arg(features); diff --git a/src/config/mod.rs b/src/config/mod.rs index d423f3244e..cc2a1d8f8b 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -139,6 +139,11 @@ pub struct Config { /// Names of benches to run corresponding to `cargo --bench ...` #[serde(rename = "bench")] pub bench_names: HashSet, + /// Whether to carry on or stop when a test failure occurs + #[serde(rename = "no-fail-fast")] + pub no_fail_fast: bool, + /// Run with the given profile + pub profile: Option, /// Result of cargo_metadata ran on the crate #[serde(skip_deserializing, skip_serializing)] pub metadata: RefCell>, @@ -189,6 +194,8 @@ impl Default for Config { example_names: HashSet::new(), bin_names: HashSet::new(), bench_names: HashSet::new(), + no_fail_fast: false, + profile: None, metadata: RefCell::new(None), } } @@ -218,6 +225,7 @@ impl<'a> From<&'a ArgMatches<'a>> for ConfigWrapper { ignore_tests: args.is_present("ignore-tests"), ignore_panics: args.is_present("ignore-panics"), force_clean: args.is_present("force-clean"), + no_fail_fast: args.is_present("no-fail-fast"), verbose, debug, count: args.is_present("count"), @@ -251,6 +259,7 @@ impl<'a> From<&'a ArgMatches<'a>> for ConfigWrapper { bin_names: get_list(args, "bin").iter().cloned().collect(), bench_names: get_list(args, "bench").iter().cloned().collect(), example_names: get_list(args, "example").iter().cloned().collect(), + profile: get_profile(args), metadata: RefCell::new(None), }; if args.is_present("ignore-config") { @@ -430,6 +439,11 @@ impl Config { self.locked |= other.locked; self.force_clean |= other.force_clean; self.ignore_tests |= other.ignore_tests; + self.no_fail_fast |= other.no_fail_fast; + + if self.profile.is_none() && other.profile.is_some() { + self.profile = other.profile.clone(); + } let additional_packages = other .packages @@ -940,6 +954,8 @@ mod tests { bin = ["bin"] example = ["example"] bench = ["bench"] + no-fail-fast = true + profile = "Release" "#; let mut configs = Config::parse_config_toml(toml.as_bytes()).unwrap(); assert_eq!(configs.len(), 1); @@ -983,6 +999,8 @@ mod tests { assert_eq!(config.ci_tool, Some(CiService::Travis)); assert_eq!(config.root, Some("/home/rust".to_string())); assert_eq!(config.manifest, PathBuf::from("/home/rust/foo/Cargo.toml")); + assert_eq!(config.profile, Some("Release".to_string())); + assert!(config.no_fail_fast); assert!(config.test_names.contains("test1")); assert!(config.test_names.contains("test2")); assert!(config.bin_names.contains("bin")); diff --git a/src/config/parse.rs b/src/config/parse.rs index ff6b32b918..22a5d31fda 100644 --- a/src/config/parse.rs +++ b/src/config/parse.rs @@ -102,6 +102,10 @@ pub(super) fn get_report_uri(args: &ArgMatches) -> Option { args.value_of("report-uri").map(ToString::to_string) } +pub(super) fn get_profile(args: &ArgMatches) -> Option { + args.value_of("profile").map(ToString::to_string) +} + pub(super) fn get_outputs(args: &ArgMatches) -> Vec { values_t!(args.values_of("out"), OutputFile).unwrap_or_else(|_| vec![]) } diff --git a/src/main.rs b/src/main.rs index 77623d5a60..3c527d28aa 100644 --- a/src/main.rs +++ b/src/main.rs @@ -68,6 +68,8 @@ fn main() -> Result<(), String> { --benches 'Test all benches' --doc 'Test only this library's documentation' --all-targets 'Test all targets' + --no-fail-fast 'Run all tests regardless of failure' + --profile [NAME] 'Build artefacts with the specified profile' --debug 'Show debug output - this is used for diagnosing issues with tarpaulin' --verbose -v 'Show extra output' --ignore-tests 'Ignore lines of test functions when collecting coverage' From c1f2ee6efe6b7dc3eccb396643e081dcee552460 Mon Sep 17 00:00:00 2001 From: xd009642 Date: Sat, 27 Jun 2020 20:43:45 +0100 Subject: [PATCH 05/17] Update features in readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a2126bc643..25b37da451 100644 --- a/README.md +++ b/README.md @@ -120,6 +120,7 @@ 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 +* Full compatibility with cargo test CLI arguments * Uploading coverage to or * HTML report generation and other coverage report types * Coverage of tests, doctests, benchmarks and examples possible From d0f56f6a74644262b586af4953964872f48fa053 Mon Sep 17 00:00:00 2001 From: xd009642 Date: Sun, 28 Jun 2020 11:43:49 +0100 Subject: [PATCH 06/17] Ignore contents of CARGO_HOME Added a path_util module which is now used across source_analysis, test_loader and the cargo module instead of having disparate implementations. Identify if CARGO_HOME is in the project directory and if so filter it from everything. --- src/cargo.rs | 15 ++--------- src/lib.rs | 1 + src/path_utils.rs | 52 ++++++++++++++++++++++++++++++++++++++ src/source_analysis/mod.rs | 30 +++------------------- src/test_loader.rs | 28 +++++++------------- 5 files changed, 67 insertions(+), 59 deletions(-) create mode 100644 src/path_utils.rs diff --git a/src/cargo.rs b/src/cargo.rs index f9a8856839..dc928e47e4 100644 --- a/src/cargo.rs +++ b/src/cargo.rs @@ -1,5 +1,6 @@ use crate::config::*; use crate::errors::RunError; +use crate::path_utils::get_source_walker; use cargo_metadata::{diagnostic::DiagnosticLevel, CargoOpt, Message, Metadata, MetadataCommand}; use log::{error, trace, warn}; use std::collections::HashMap; @@ -231,21 +232,9 @@ fn is_prefix_match(prefix: &str, entry: &Path) -> bool { fn get_panic_candidates(tests: &[DirEntry], config: &Config) -> HashMap> { let mut result = HashMap::new(); let root = config.root(); - let target = config.target_dir(); for test in tests { if let Some(test_binary) = DocTestBinaryMeta::new(test.path()) { - let walker = WalkDir::new(&root).into_iter(); - // TODO some walkdir stuff is being reused here and in source_analysis (and source - // analysis does it a bit wrong) Fix before merging - for dir_entry in walker - .filter_entry(|e| { - !(e.path().starts_with(&target) - || e.path() - .iter() - .any(|x| x.to_string_lossy().starts_with("."))) - }) - .filter_map(|e| e.ok()) - { + for dir_entry in get_source_walker(config) { let path = dir_entry.path(); if path.is_file() { if let Some(p) = path_relative_from(path, &root) { diff --git a/src/lib.rs b/src/lib.rs index 51a7edc5fd..a674fea6a0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -19,6 +19,7 @@ pub mod breakpoint; mod cargo; pub mod config; pub mod errors; +mod path_utils; mod process_handling; pub mod report; mod source_analysis; diff --git a/src/path_utils.rs b/src/path_utils.rs new file mode 100644 index 0000000000..e6354108f1 --- /dev/null +++ b/src/path_utils.rs @@ -0,0 +1,52 @@ +use crate::config::Config; +use std::env::var; +use std::ffi::OsStr; +use std::path::Path; +use walkdir::{DirEntry, WalkDir}; + +/// Returns true if the file is a rust source file +pub fn is_source_file(entry: &DirEntry) -> bool { + let p = entry.path(); + p.extension() == Some(OsStr::new("rs")) +} + +/// Returns true if the folder is a target folder +fn is_target_folder(entry: &Path, target: &Path) -> bool { + entry.starts_with(&target) +} + +/// Returns true if the file or folder is hidden +fn is_hidden(entry: &Path) -> bool { + entry.iter().any(|x| x.to_string_lossy().starts_with('.')) +} + +/// If `CARGO_HOME` is set filters out all folders within `CARGO_HOME` +fn is_cargo_home(entry: &Path, root: &Path) -> bool { + match var("CARGO_HOME") { + Ok(s) => { + let path = Path::new(&s); + if path.is_absolute() && entry.starts_with(path) { + true + } else { + let home = root.join(path); + entry.starts_with(&home) + } + } + _ => false, + } +} + +pub fn is_coverable_file_path(e: &Path, root: &Path, target: &Path) -> bool { + !(is_target_folder(e, &target) || is_hidden(e) || is_cargo_home(e, &root)) +} + +pub fn get_source_walker(config: &Config) -> impl Iterator { + let root = config.root(); + let target = config.target_dir(); + + let walker = WalkDir::new(&root).into_iter(); + walker + .filter_entry(move |e| is_coverable_file_path(e.path(), &root, &target)) + .filter_map(|e| e.ok()) + .filter(|e| is_source_file(e)) +} diff --git a/src/source_analysis/mod.rs b/src/source_analysis/mod.rs index 240ca7f1af..29aded0398 100644 --- a/src/source_analysis/mod.rs +++ b/src/source_analysis/mod.rs @@ -1,4 +1,5 @@ use crate::config::{Config, RunType}; +use crate::path_utils::{get_source_walker, is_source_file}; use items::process_items; use lazy_static::lazy_static; use log::trace; @@ -7,12 +8,11 @@ use quote::ToTokens; use regex::Regex; use std::cell::RefCell; use std::collections::{HashMap, HashSet}; -use std::ffi::OsStr; use std::fs::File; use std::io::{BufRead, BufReader, Read}; use std::path::{Path, PathBuf}; use syn::*; -use walkdir::{DirEntry, WalkDir}; +use walkdir::WalkDir; mod attributes; mod expressions; @@ -194,25 +194,6 @@ impl LineAnalysis { } } -/// Returns true if the file is a rust source file -fn is_source_file(entry: &DirEntry) -> bool { - let p = entry.path(); - p.extension() == Some(OsStr::new("rs")) -} - -/// Returns true if the folder is a target folder -fn is_target_folder(entry: &DirEntry, root: &Path) -> bool { - let target = root.join("target"); - entry.path().starts_with(&target) -} - -fn is_hidden(entry: &DirEntry) -> bool { - entry - .path() - .iter() - .any(|x| x.to_string_lossy().starts_with('.')) -} - /// Returns a list of files and line numbers to ignore (not indexes!) pub fn get_line_analysis(config: &Config) -> HashMap { let mut result: HashMap = HashMap::new(); @@ -220,12 +201,7 @@ pub fn get_line_analysis(config: &Config) -> HashMap { let mut ignored_files: HashSet = HashSet::new(); let root = config.root(); - let walker = WalkDir::new(&root).into_iter(); - for e in walker - .filter_entry(|e| !(is_target_folder(e, &root) || is_hidden(e))) - .filter_map(|e| e.ok()) - .filter(|e| is_source_file(e)) - { + for e in get_source_walker(config) { if !ignored_files.contains(e.path()) { analyse_package(e.path(), &root, &config, &mut result, &mut ignored_files); } else { diff --git a/src/test_loader.rs b/src/test_loader.rs index 38ea04239b..0c6c182b92 100644 --- a/src/test_loader.rs +++ b/src/test_loader.rs @@ -1,4 +1,5 @@ use crate::config::Config; +use crate::path_utils::is_coverable_file_path; use crate::source_analysis::*; use crate::traces::*; use gimli::read::Error; @@ -150,13 +151,14 @@ fn get_addresses_from_program( prog: IncompleteLineProgram, debug_strs: &DebugStr, entries: &[(u64, LineType, &Option)], - project: &Path, + config: &Config, result: &mut HashMap>, ) -> Result<()> where R: Reader, Offset: ReaderOffset, { + let project = config.root(); let get_string = |x: R| x.to_string().map(|y| y.to_string()).ok(); let (cprog, seq) = prog.sequences()?; for s in seq { @@ -167,28 +169,17 @@ where continue; } if let Some(file) = ln_row.file(header) { - let mut path = project.to_path_buf(); + let mut path = project.clone(); if let Some(dir) = file.directory(header) { if let Some(temp) = dir.string_value(debug_strs).and_then(get_string) { path.push(temp); } } - if let Ok(p) = path.canonicalize() { path = p; } - // Fix relative paths and determine if in target directory - // Source in target directory shouldn't be covered as it's either - // autogenerated or resulting from the projects Cargo.lock - let is_target = if path.is_relative() { - path.starts_with("target") - } else { - path.starts_with(project.join("target")) - }; - let is_hidden = path.iter().any(|x| x.to_string_lossy().starts_with('.')); - // Source is part of project so we cover it. - if !is_target && !is_hidden && path.starts_with(project) { + if is_coverable_file_path(&path, &project, &config.target_dir()) { if let Some(file) = ln_row.file(header) { let line = ln_row.line().unwrap(); let file = file.path_name(); @@ -231,11 +222,11 @@ where fn get_line_addresses( endian: RunTimeEndian, - project: &Path, obj: &OFile, analysis: &HashMap, config: &Config, ) -> Result { + let project = config.root(); let io_err = |e| { error!("Io error parsing section: {}", e); Error::Io @@ -276,7 +267,7 @@ fn get_line_addresses( let mut temp_map: HashMap> = HashMap::new(); if let Err(e) = - get_addresses_from_program(prog, &debug_strings, &entries, project, &mut temp_map) + get_addresses_from_program(prog, &debug_strings, &entries, config, &mut temp_map) { debug!("Potential issue reading test addresses {}", e); } else { @@ -287,7 +278,7 @@ fn get_line_addresses( let temp_map = temp_map .into_iter() .filter(|&(ref k, _)| { - !(config.ignore_tests && k.path.starts_with(project.join("tests"))) + !(config.ignore_tests && k.path.starts_with(&project.join("tests"))) }) .filter(|&(ref k, _)| !(config.exclude_path(&k.path))) .filter(|&(ref k, _)| { @@ -388,7 +379,6 @@ pub fn generate_tracemap( analysis: &HashMap, config: &Config, ) -> io::Result { - let manifest = config.root(); let file = open_symbols_file(test)?; let file = unsafe { MmapOptions::new().map(&file)? }; if let Ok(obj) = OFile::parse(&*file) { @@ -397,7 +387,7 @@ pub fn generate_tracemap( } else { RunTimeEndian::Big }; - if let Ok(result) = get_line_addresses(endian, &manifest, &obj, &analysis, config) { + if let Ok(result) = get_line_addresses(endian, &obj, &analysis, config) { Ok(result) } else { Err(io::Error::new( From f47491b8c9deb05b57f78da26e82ee38d5383b73 Mon Sep 17 00:00:00 2001 From: xd009642 Date: Sun, 28 Jun 2020 12:17:19 +0100 Subject: [PATCH 07/17] Added test from issue #477 --- CHANGELOG.md | 1 + tests/data/HttptestAndReqwest/.gitignore | 3 + tests/data/HttptestAndReqwest/Cargo.lock | 1207 +++++++++++++++++++++ tests/data/HttptestAndReqwest/Cargo.toml | 11 + tests/data/HttptestAndReqwest/src/main.rs | 36 + tests/mod.rs | 31 + 6 files changed, 1289 insertions(+) create mode 100644 tests/data/HttptestAndReqwest/.gitignore create mode 100644 tests/data/HttptestAndReqwest/Cargo.lock create mode 100644 tests/data/HttptestAndReqwest/Cargo.toml create mode 100644 tests/data/HttptestAndReqwest/src/main.rs diff --git a/CHANGELOG.md b/CHANGELOG.md index fb4f05e480..d8ee2dc7eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ file. `--all-targets` flags matching `cargo test` - Add named test running and flags `--test`, `--example`, `--bin`, `--bench` - Equivalent options for `--no-fail-fast` and `--profile` +- Filtering of `CARGO_HOME` contents when it exists in project directory ### Changed - Now merge run-types in configs diff --git a/tests/data/HttptestAndReqwest/.gitignore b/tests/data/HttptestAndReqwest/.gitignore new file mode 100644 index 0000000000..3fa506a791 --- /dev/null +++ b/tests/data/HttptestAndReqwest/.gitignore @@ -0,0 +1,3 @@ +/target +/new_home +tmp diff --git a/tests/data/HttptestAndReqwest/Cargo.lock b/tests/data/HttptestAndReqwest/Cargo.lock new file mode 100644 index 0000000000..4e7cbc35dd --- /dev/null +++ b/tests/data/HttptestAndReqwest/Cargo.lock @@ -0,0 +1,1207 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "aho-corasick" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8716408b8bc624ed7f65d223ddb9ac2d044c0547b6fa4b0d554f3a9540496ada" +dependencies = [ + "memchr", +] + +[[package]] +name = "autocfg" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" + +[[package]] +name = "base64" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d1ccbaf7d9ec9537465a97bf19edc1a4e158ecb49fc16178202238c569cc42" + +[[package]] +name = "bitflags" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" + +[[package]] +name = "bstr" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31accafdb70df7871592c058eca3985b71104e15ac32f64706022c58867da931" +dependencies = [ + "lazy_static", + "memchr", + "regex-automata", +] + +[[package]] +name = "bumpalo" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e8c087f005730276d1096a652e92a8bacee2e2472bcc9715a74d2bec38b5820" + +[[package]] +name = "byteorder" +version = "1.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" + +[[package]] +name = "bytes" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "130aac562c0dd69c56b3b1cc8ffd2e17be31d0b6c25b61c96b76231aa23e39e1" + +[[package]] +name = "cc" +version = "1.0.54" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bbb73db36c1246e9034e307d0fba23f9a2e251faa47ade70c1bd252220c8311" + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + +[[package]] +name = "core-foundation" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" + +[[package]] +name = "crossbeam-channel" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cced8691919c02aac3cb0a1bc2e9b73d89e832bf9a06fc579d4e71b68a2da061" +dependencies = [ + "crossbeam-utils", + "maybe-uninit", +] + +[[package]] +name = "crossbeam-utils" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" +dependencies = [ + "autocfg", + "cfg-if", + "lazy_static", +] + +[[package]] +name = "dtoa" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4358a9e11b9a09cf52383b451b49a169e8d797b68aa02301ff586d70d9661ea3" + +[[package]] +name = "encoding_rs" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8ac63f94732332f44fe654443c46f6375d1939684c17b0afb6cb56b0456e171" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "fuchsia-zircon" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" +dependencies = [ + "bitflags", + "fuchsia-zircon-sys", +] + +[[package]] +name = "fuchsia-zircon-sys" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" + +[[package]] +name = "futures" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e05b85ec287aac0dc34db7d4a569323df697f9c55b99b15d6b4ef8cde49f613" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f366ad74c28cca6ba456d95e6422883cfb4b252a83bed929c83abfdbbf2967d5" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59f5fff90fd5d971f936ad674802482ba441b6f09ba5e15fd8b39145582ca399" + +[[package]] +name = "futures-executor" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10d6bb888be1153d3abeb9006b11b02cf5e9b209fda28693c31ae1e4e012e314" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de27142b013a8e869c14957e6d2edeef89e97c289e69d042ee3a49acd8b51789" + +[[package]] +name = "futures-macro" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0b5a30a4328ab5473878237c447333c093297bded83a4983d10f4deea240d39" +dependencies = [ + "proc-macro-hack", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-sink" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f2032893cb734c7a05d85ce0cc8b8c4075278e93b24b66f9de99d6eb0fa8acc" + +[[package]] +name = "futures-task" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdb66b5f09e22019b1ab0830f7785bcea8e7a42148683f99214f73f8ec21a626" +dependencies = [ + "once_cell", +] + +[[package]] +name = "futures-util" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8764574ff08b701a084482c3c7031349104b07ac897393010494beaa18ce32c6" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project", + "pin-utils", + "proc-macro-hack", + "proc-macro-nested", + "slab", +] + +[[package]] +name = "getrandom" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "h2" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79b7246d7e4b979c03fa093da39cfb3617a96bbeee6310af63991668d7e843ff" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap", + "log", + "slab", + "tokio", + "tokio-util", +] + +[[package]] +name = "hermit-abi" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91780f809e750b0a89f5544be56617ff6b1227ee485bcb06ebe10cdf89bd3b71" +dependencies = [ + "libc", +] + +[[package]] +name = "http" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d569972648b2c512421b5f2a405ad6ac9666547189d0c5477a3f200f3e02f9" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "httparse" +version = "1.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" + +[[package]] +name = "httptest" +version = "0.1.0" +dependencies = [ + "httptest 0.13.1", + "reqwest", +] + +[[package]] +name = "httptest" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73a7841d52c94850769f37142e0d50f04edeac8384e98318dc8ee1532a8e9661" +dependencies = [ + "bstr", + "bytes", + "crossbeam-channel", + "futures", + "http", + "hyper", + "log", + "once_cell", + "regex", + "serde", + "serde_json", + "serde_urlencoded", + "tokio", + "url", +] + +[[package]] +name = "hyper" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6e7655b9594024ad0ee439f3b5a7299369dc2a3f459b47c696f9ff676f9aa1f" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "itoa", + "log", + "pin-project", + "socket2", + "time", + "tokio", + "tower-service", + "want", +] + +[[package]] +name = "hyper-tls" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3adcd308402b9553630734e9c36b77a7e48b3821251ca2493e8cd596763aafaa" +dependencies = [ + "bytes", + "hyper", + "native-tls", + "tokio", + "tokio-tls", +] + +[[package]] +name = "idna" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" +dependencies = [ + "matches", + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "indexmap" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c398b2b113b55809ceb9ee3e753fcbac793f1956663f3c36549c1346015c2afe" +dependencies = [ + "autocfg", +] + +[[package]] +name = "iovec" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" +dependencies = [ + "libc", +] + +[[package]] +name = "itoa" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8b7a7c0c47db5545ed3fef7468ee7bb5b74691498139e4b3f6a20685dc6dd8e" + +[[package]] +name = "js-sys" +version = "0.3.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce10c23ad2ea25ceca0093bd3192229da4c5b3c0f2de499c1ecac0d98d452177" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "kernel32-sys" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" +dependencies = [ + "winapi 0.2.8", + "winapi-build", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.71" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9457b06509d27052635f90d6466700c65095fdf75409b3fbdd903e988b886f49" + +[[package]] +name = "log" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "matches" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" + +[[package]] +name = "maybe-uninit" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" + +[[package]] +name = "memchr" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" + +[[package]] +name = "mime" +version = "0.3.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" + +[[package]] +name = "mime_guess" +version = "2.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2684d4c2e97d99848d30b324b00c8fcc7e5c897b7cbb5819b09e7c90e8baf212" +dependencies = [ + "mime", + "unicase", +] + +[[package]] +name = "mio" +version = "0.6.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fce347092656428bc8eaf6201042cb551b8d67855af7374542a92a0fbfcac430" +dependencies = [ + "cfg-if", + "fuchsia-zircon", + "fuchsia-zircon-sys", + "iovec", + "kernel32-sys", + "libc", + "log", + "miow", + "net2", + "slab", + "winapi 0.2.8", +] + +[[package]] +name = "miow" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" +dependencies = [ + "kernel32-sys", + "net2", + "winapi 0.2.8", + "ws2_32-sys", +] + +[[package]] +name = "native-tls" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b0d88c06fe90d5ee94048ba40409ef1d9315d86f6f38c2efdaad4fb50c58b2d" +dependencies = [ + "lazy_static", + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "net2" +version = "0.2.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ba7c918ac76704fb42afcbbb43891e72731f3dcca3bef2a19786297baf14af7" +dependencies = [ + "cfg-if", + "libc", + "winapi 0.3.8", +] + +[[package]] +name = "num_cpus" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "once_cell" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b631f7e854af39a1739f401cf34a8a013dfe09eac4fa4dba91e9768bd28168d" + +[[package]] +name = "openssl" +version = "0.10.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cee6d85f4cb4c4f59a6a85d5b68a233d280c82e29e822913b9c8b129fbf20bdd" +dependencies = [ + "bitflags", + "cfg-if", + "foreign-types", + "lazy_static", + "libc", + "openssl-sys", +] + +[[package]] +name = "openssl-probe" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" + +[[package]] +name = "openssl-sys" +version = "0.9.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a842db4709b604f0fe5d1170ae3565899be2ad3d9cbc72dedc789ac0511f78de" +dependencies = [ + "autocfg", + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "percent-encoding" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" + +[[package]] +name = "pin-project" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e75373ff9037d112bb19bc61333a06a159eaeb217660dcfbea7d88e1db823919" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10b4b44893d3c370407a1d6a5cfde7c41ae0478e31c516c85f67eb3adc51be6d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "pin-project-lite" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282adbf10f2698a7a77f8e983a74b2d18176c19a7fd32a45446139ae7b02b715" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05da548ad6865900e60eaba7f589cc0783590a92e940c26953ff81ddbab2d677" + +[[package]] +name = "ppv-lite86" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "237a5ed80e274dbc66f86bd59c1e25edc039660be53194b5fe0a482e0f2612ea" + +[[package]] +name = "proc-macro-hack" +version = "0.5.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e0456befd48169b9f13ef0f0ad46d492cf9d2dbb918bcf38e01eed4ce3ec5e4" + +[[package]] +name = "proc-macro-nested" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0afe1bd463b9e9ed51d0e0f0b50b6b146aec855c56fd182bb242388710a9b6de" + +[[package]] +name = "proc-macro2" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "beae6331a816b1f65d04c45b078fd8e6c93e8071771f41b8163255bbd8d7c8fa" +dependencies = [ + "unicode-xid", +] + +[[package]] +name = "quote" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom", + "libc", + "rand_chacha", + "rand_core", + "rand_hc", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core", +] + +[[package]] +name = "redox_syscall" +version = "0.1.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" + +[[package]] +name = "regex" +version = "1.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c3780fcf44b193bc4d09f36d2a3c87b251da4a046c87795a0d35f4f927ad8e6" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", + "thread_local", +] + +[[package]] +name = "regex-automata" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae1ded71d66a4a97f5e961fd0cb25a5f366a42a41570d16a763a69c092c26ae4" +dependencies = [ + "byteorder", +] + +[[package]] +name = "regex-syntax" +version = "0.6.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26412eb97c6b088a6997e05f69403a802a92d520de2f8e63c2b65f9e0f47c4e8" + +[[package]] +name = "remove_dir_all" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e" +dependencies = [ + "winapi 0.3.8", +] + +[[package]] +name = "reqwest" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b82c9238b305f26f53443e3a4bc8528d64b8d0bee408ec949eb7bf5635ec680" +dependencies = [ + "base64", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "http", + "http-body", + "hyper", + "hyper-tls", + "js-sys", + "lazy_static", + "log", + "mime", + "mime_guess", + "native-tls", + "percent-encoding", + "pin-project-lite", + "serde", + "serde_json", + "serde_urlencoded", + "tokio", + "tokio-tls", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "winreg", +] + +[[package]] +name = "ryu" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" + +[[package]] +name = "schannel" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f05ba609c234e60bee0d547fe94a4c7e9da733d1c962cf6e59efa4cd9c8bc75" +dependencies = [ + "lazy_static", + "winapi 0.3.8", +] + +[[package]] +name = "security-framework" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64808902d7d99f78eaddd2b4e2509713babc3dc3c85ad6f4c447680f3c01e535" +dependencies = [ + "bitflags", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17bf11d99252f512695eb468de5516e5cf75455521e69dfe343f3b74e4748405" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "serde" +version = "1.0.111" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9124df5b40cbd380080b2cc6ab894c040a3070d995f5c9dc77e18c34a8ae37d" + +[[package]] +name = "serde_json" +version = "1.0.55" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec2c5d7e739bc07a3e73381a39d61fdb5f671c60c1df26a130690665803d8226" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ec5d77e2d4c73717816afac02670d5c4f534ea95ed430442cad02e7a6e32c97" +dependencies = [ + "dtoa", + "itoa", + "serde", + "url", +] + +[[package]] +name = "slab" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" + +[[package]] +name = "smallvec" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7cb5678e1615754284ec264d9bb5b4c27d2018577fd90ac0ceb578591ed5ee4" + +[[package]] +name = "socket2" +version = "0.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03088793f677dce356f3ccc2edb1b314ad191ab702a5de3faf49304f7e104918" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "winapi 0.3.8", +] + +[[package]] +name = "syn" +version = "1.0.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5304cfdf27365b7585c25d4af91b35016ed21ef88f17ced89c7093b43dba8b6" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + +[[package]] +name = "tempfile" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" +dependencies = [ + "cfg-if", + "libc", + "rand", + "redox_syscall", + "remove_dir_all", + "winapi 0.3.8", +] + +[[package]] +name = "thread_local" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "time" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" +dependencies = [ + "libc", + "winapi 0.3.8", +] + +[[package]] +name = "tokio" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d099fa27b9702bed751524694adbe393e18b36b204da91eb1cbbbbb4a5ee2d58" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "iovec", + "lazy_static", + "memchr", + "mio", + "num_cpus", + "pin-project-lite", + "slab", + "tokio-macros", +] + +[[package]] +name = "tokio-macros" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0c3acc6aa564495a0f2e1d59fab677cd7f81a19994cfc7f3ad0e64301560389" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a70f4fcd7b3b24fb194f837560168208f669ca8cb70d0c4b862944452396343" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be8242891f2b6cbef26a2d7e8605133c2c554cd35b3e4948ea892d6d68436499" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "log", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tower-service" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e987b6bf443f4b5b3b6f38704195592cca41c5bb7aedd3c3693c7081f8289860" + +[[package]] +name = "try-lock" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" + +[[package]] +name = "unicase" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" +dependencies = [ + "version_check", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" +dependencies = [ + "matches", +] + +[[package]] +name = "unicode-normalization" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5479532badd04e128284890390c1e876ef7a993d0570b3597ae43dfa1d59afa4" +dependencies = [ + "smallvec", +] + +[[package]] +name = "unicode-xid" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" + +[[package]] +name = "url" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "829d4a8476c35c9bf0bbce5a3b23f4106f79728039b726d292bb93bc106787cb" +dependencies = [ + "idna", + "matches", + "percent-encoding", +] + +[[package]] +name = "vcpkg" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6454029bf181f092ad1b853286f23e2c507d8e8194d01d92da4a55c274a5508c" + +[[package]] +name = "version_check" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" + +[[package]] +name = "want" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +dependencies = [ + "log", + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + +[[package]] +name = "wasm-bindgen" +version = "0.2.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c2dc4aa152834bc334f506c1a06b866416a8b6697d5c9f75b9a689c8486def0" +dependencies = [ + "cfg-if", + "serde", + "serde_json", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded84f06e0ed21499f6184df0e0cb3494727b0c5da89534e0fcc55c51d812101" +dependencies = [ + "bumpalo", + "lazy_static", + "log", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64487204d863f109eb77e8462189d111f27cb5712cc9fdb3461297a76963a2f6" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "838e423688dac18d73e31edce74ddfac468e37b1506ad163ffaf0a46f703ffe3" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3156052d8ec77142051a533cdd686cba889537b213f948cd1d20869926e68e92" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9ba19973a58daf4db6f352eda73dc0e289493cd29fb2632eb172085b6521acd" + +[[package]] +name = "web-sys" +version = "0.3.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b72fe77fd39e4bd3eaa4412fd299a0be6b3dfe9d2597e2f1c20beb968f41d17" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "winapi" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" + +[[package]] +name = "winapi" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-build" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "winreg" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0120db82e8a1e0b9fb3345a539c478767c0048d842860994d96113d5b667bd69" +dependencies = [ + "winapi 0.3.8", +] + +[[package]] +name = "ws2_32-sys" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" +dependencies = [ + "winapi 0.2.8", + "winapi-build", +] diff --git a/tests/data/HttptestAndReqwest/Cargo.toml b/tests/data/HttptestAndReqwest/Cargo.toml new file mode 100644 index 0000000000..011e6cff36 --- /dev/null +++ b/tests/data/HttptestAndReqwest/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "httptest" +version = "0.1.0" +authors = ["Thomas Sioutas "] +edition = "2018" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +reqwest = { version = "0.10", features = ["blocking", "json"] } +httptest = "0.13" \ No newline at end of file diff --git a/tests/data/HttptestAndReqwest/src/main.rs b/tests/data/HttptestAndReqwest/src/main.rs new file mode 100644 index 0000000000..7bad6eb20d --- /dev/null +++ b/tests/data/HttptestAndReqwest/src/main.rs @@ -0,0 +1,36 @@ +fn main() { + println!("Hello, world!"); +} + +#[cfg(test)] +mod tests { + use httptest::{matchers::*, responders::*, Expectation, Server}; + use reqwest::Error as ReqWestError; + use std::time::Duration; + // Builds a reqwest blocking client + fn build_client() -> Result { + const TIMEOUT_IN_SECS: u64 = 5; + reqwest::blocking::Client::builder() + .timeout(Duration::from_secs(TIMEOUT_IN_SECS)) + .build() + } + + #[test] + fn test_httptest() { + let server = Server::run(); + // Expect request of given method on specified url + let request_path = request::method_path("GET", "/foo"); + let expectation = Expectation::matching(all_of![request_path]); + server.expect(expectation.respond_with(status_code(200))); + + let url = server.url("/foo"); + let port = url.port_u16().unwrap(); + let host = url.host().unwrap().to_string(); + let uri = format!("http://{}:{}/{}", host, port, "foo"); + + let client = build_client().unwrap(); + let req_builder = client.get(&uri); + let response = req_builder.send().unwrap(); + assert!(response.status().is_success()); + } +} diff --git a/tests/mod.rs b/tests/mod.rs index 1c7b6e687d..2535e1c884 100644 --- a/tests/mod.rs +++ b/tests/mod.rs @@ -4,6 +4,8 @@ use cargo_tarpaulin::launch_tarpaulin; use cargo_tarpaulin::traces::*; use clap::App; use std::env; +use std::path::Path; +use std::process::Command; use std::time::Duration; #[cfg(nightly)] @@ -221,3 +223,32 @@ fn tarpaulin_attrs() { fn tarpaulin_tool_attr() { check_percentage("tool_attr", 0.0f64, false); } + +#[test] +fn cargo_home_filtering() { + let new_home = + Path::new(env!("CARGO_MANIFEST_DIR")).join("tests/data/HttptestAndReqwest/new_home"); + let previous = env::var("CARGO_HOME"); + + let mut config = Config::default(); + config.test_timeout = Duration::from_secs(60); + let restore_dir = env::current_dir().unwrap(); + let test_dir = get_test_path("HttptestAndReqwest"); + env::set_current_dir(&test_dir).unwrap(); + config.manifest = test_dir; + config.manifest.push("Cargo.toml"); + + env::set_var("CARGO_HOME", new_home.display().to_string()); + let run = launch_tarpaulin(&config); + match previous { + Ok(s) => env::set_var("CARGO_HOME", s), + Err(_) => { + let _ = Command::new("unset").args(&["CARGO_HOME"]).output(); + } + } + let (res, _) = run.unwrap(); + + env::set_current_dir(restore_dir).unwrap(); + + assert_eq!(res.iter().count(), 1); +} From 379571d046deb0c235f8e868506abfb95eaccf5a Mon Sep 17 00:00:00 2001 From: xd009642 Date: Sun, 28 Jun 2020 10:17:09 +0100 Subject: [PATCH 08/17] Start debug logger --- src/event_log.rs | 43 +++++++++++++++++++++++++++++++++++++++++++ src/lib.rs | 1 + 2 files changed, 44 insertions(+) create mode 100644 src/event_log.rs diff --git a/src/event_log.rs b/src/event_log.rs new file mode 100644 index 0000000000..301058d430 --- /dev/null +++ b/src/event_log.rs @@ -0,0 +1,43 @@ +use serde::{Deserialize, Serialize}; +use std::path::PathBuf; +use libc::pid_t; + +#[derive(Clone, Eq, PartialEq, PartialOrd, Ord, Hash, Serialize, Deserialize)] +pub struct Event { + pid: pid_t, + child: Option, + addr: i64, + description: String, +} + +#[derive(Clone, Eq, PartialEq, PartialOrd, Ord, Hash, Serialize, Deserialize)] +pub struct EventStream { + binary: PathBuf, + trace_events: Vec, +} + +#[derive(Clone, Eq, PartialEq, PartialOrd, Ord, Hash, Serialize, Deserialize)] +pub struct EventLog { + streams: Vec, +} + +impl EventLog { + pub fn push_binary(&mut self, binary: PathBuf) { + let new_event = EventStream { + binary, + trace_events: vec![], + }; + self.streams.push(new_event); + } + + pub fn push_event(&mut self, event: Event) { + if let Some(current) = self.streams.last_mut() { + current.trace_events.push(event); + } else { + self.streams.push(EventStream { + binary: PathBuf::new(), + trace_events: vec![event], + }); + } + } +} diff --git a/src/lib.rs b/src/lib.rs index a674fea6a0..ca1d67036f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -19,6 +19,7 @@ pub mod breakpoint; mod cargo; pub mod config; pub mod errors; +mod event_log; mod path_utils; mod process_handling; pub mod report; From 6b1bf0906cc4d990f0b2760dcf7194f1b7f96daf Mon Sep 17 00:00:00 2001 From: xd009642 Date: Sun, 28 Jun 2020 19:07:22 +0100 Subject: [PATCH 09/17] Added EventLog This lets me push events into a list which gets serialized in debug mode for debugging tarpaulin issues. --- src/cargo.rs | 3 +- src/event_log.rs | 154 +++++++++++++++++++++++++++++++------- src/lib.rs | 49 ++++++++++-- src/statemachine/linux.rs | 25 ++++++- 4 files changed, 193 insertions(+), 38 deletions(-) diff --git a/src/cargo.rs b/src/cargo.rs index dc928e47e4..a5f1d9646c 100644 --- a/src/cargo.rs +++ b/src/cargo.rs @@ -3,6 +3,7 @@ use crate::errors::RunError; use crate::path_utils::get_source_walker; use cargo_metadata::{diagnostic::DiagnosticLevel, CargoOpt, Message, Metadata, MetadataCommand}; use log::{error, trace, warn}; +use serde::{Deserialize, Serialize}; use std::collections::HashMap; use std::env; use std::fs::{read_dir, remove_dir_all, File}; @@ -12,7 +13,7 @@ use std::path::{Component, Path, PathBuf}; use std::process::{Command, Stdio}; use walkdir::{DirEntry, WalkDir}; -#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Deserialize, Serialize)] pub struct TestBinary { path: PathBuf, ty: Option, diff --git a/src/event_log.rs b/src/event_log.rs index 301058d430..c4b2929a53 100644 --- a/src/event_log.rs +++ b/src/event_log.rs @@ -1,43 +1,145 @@ +use crate::cargo::TestBinary; +use crate::ptrace_control::*; +use crate::statemachine::{ProcessInfo, TracerAction}; +use nix::libc::*; +use nix::sys::{signal::Signal, wait::WaitStatus}; use serde::{Deserialize, Serialize}; -use std::path::PathBuf; -use libc::pid_t; +use std::cell::RefCell; #[derive(Clone, Eq, PartialEq, PartialOrd, Ord, Hash, Serialize, Deserialize)] -pub struct Event { - pid: pid_t, +pub enum Event { + ConfigLaunch(String), + BinaryLaunch(TestBinary), + Trace(TraceEvent), +} + +#[derive(Clone, Default, Eq, PartialEq, PartialOrd, Ord, Hash, Serialize, Deserialize)] +pub struct TraceEvent { + pid: Option, child: Option, - addr: i64, + signal: Option, + addr: Option, + return_val: Option, description: String, } -#[derive(Clone, Eq, PartialEq, PartialOrd, Ord, Hash, Serialize, Deserialize)] -pub struct EventStream { - binary: PathBuf, - trace_events: Vec, +impl TraceEvent { + pub(crate) fn new_from_action(action: &TracerAction) -> Self { + match *action { + TracerAction::TryContinue(t) => TraceEvent { + pid: Some(t.pid.as_raw()), + signal: t.signal.map(|x| x.to_string()), + description: "Trying to continuing child".to_string(), + ..Default::default() + }, + TracerAction::Continue(t) => TraceEvent { + pid: Some(t.pid.as_raw()), + signal: t.signal.map(|x| x.to_string()), + description: "Continuing child".to_string(), + ..Default::default() + }, + TracerAction::Step(t) => TraceEvent { + pid: Some(t.pid.as_raw()), + description: "Stepping child".to_string(), + ..Default::default() + }, + TracerAction::Detach(t) => TraceEvent { + pid: Some(t.pid.as_raw()), + description: "Detaching child".to_string(), + ..Default::default() + }, + _ => TraceEvent { + description: "Unexpected action".to_string(), + ..Default::default() + }, + } + } + + pub(crate) fn new_from_wait(wait: &WaitStatus) -> Self { + let pid = wait.pid().map(|p| p.as_raw()); + let mut event = TraceEvent { + pid, + ..Default::default() + }; + match wait { + WaitStatus::Exited(_, i) => { + event.description = "Exited".to_string(); + event.return_val = Some(*i as _); + } + WaitStatus::Signaled(_, sig, _) => { + event.signal = Some(sig.to_string()); + event.description = "Signaled".to_string(); + } + WaitStatus::Stopped(c, sig) => { + event.signal = Some(sig.to_string()); + if *sig == Signal::SIGTRAP { + event.description = "Stopped".to_string(); + event.addr = current_instruction_pointer(*c).ok().map(|x| (x - 1) as u64); + } else { + event.description = "Non-trace stop".to_string(); + } + } + WaitStatus::PtraceEvent(pid, sig, val) => { + event.signal = Some(sig.to_string()); + match *val { + PTRACE_EVENT_CLONE => { + event.description = "Ptrace Clone".to_string(); + if *sig == Signal::SIGTRAP { + event.child = get_event_data(*pid).ok().map(|x| x as pid_t); + } + } + PTRACE_EVENT_FORK => { + event.description = "Ptrace fork".to_string(); + } + PTRACE_EVENT_VFORK => { + event.description = "Ptrace vfork".to_string(); + } + PTRACE_EVENT_EXEC => { + event.description = "Ptrace exec".to_string(); + } + PTRACE_EVENT_EXIT => { + event.description = "Ptrace exit".to_string(); + } + _ => { + event.description = "Ptrace unknown event".to_string(); + } + } + } + WaitStatus::Continued(_) => { + event.description = "Continued".to_string(); + } + WaitStatus::StillAlive => { + event.description = "StillAlive".to_string(); + } + WaitStatus::PtraceSyscall(_) => { + event.description = "PtraceSyscall".to_string(); + } + } + event + } } -#[derive(Clone, Eq, PartialEq, PartialOrd, Ord, Hash, Serialize, Deserialize)] +#[derive(Clone, Eq, PartialEq, PartialOrd, Ord, Serialize, Deserialize)] pub struct EventLog { - streams: Vec, + events: RefCell>, } impl EventLog { - pub fn push_binary(&mut self, binary: PathBuf) { - let new_event = EventStream { - binary, - trace_events: vec![], - }; - self.streams.push(new_event); + pub fn new() -> Self { + Self { + events: RefCell::new(vec![]), + } } - pub fn push_event(&mut self, event: Event) { - if let Some(current) = self.streams.last_mut() { - current.trace_events.push(event); - } else { - self.streams.push(EventStream { - binary: PathBuf::new(), - trace_events: vec![event], - }); - } + pub fn push_binary(&self, binary: TestBinary) { + self.events.borrow_mut().push(Event::BinaryLaunch(binary)); + } + + pub fn push_trace(&self, event: TraceEvent) { + self.events.borrow_mut().push(Event::Trace(event)); + } + + pub fn push_config(&self, name: String) { + self.events.borrow_mut().push(Event::ConfigLaunch(name)); } } diff --git a/src/lib.rs b/src/lib.rs index ca1d67036f..1896e32a86 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,18 +1,20 @@ use crate::cargo::TestBinary; use crate::config::*; use crate::errors::*; +use crate::event_log::*; use crate::process_handling::*; use crate::report::report_coverage; use crate::source_analysis::LineAnalysis; use crate::statemachine::*; use crate::test_loader::*; use crate::traces::*; +use chrono::offset::Local; use log::{error, info, trace, warn}; use nix::unistd::*; use std::collections::HashMap; use std::env; use std::ffi::CString; -use std::fs::create_dir_all; +use std::fs::{create_dir_all, File}; use std::path::{Path, PathBuf}; pub mod breakpoint; @@ -34,11 +36,24 @@ pub fn trace(configs: &[Config]) -> Result { let mut tracemap = TraceMap::new(); let mut tarpaulin_result = Ok(()); let mut ret = 0i32; + let logger = if configs.iter().any(|c| c.debug) { + Some(EventLog::new()) + } else { + None + }; for config in configs.iter() { if config.name == "report" { continue; } + if let Some(log) = logger.as_ref() { + let name = if config.name.is_empty() { + "".to_string() + } else { + config.name.clone() + }; + log.push_config(name); + } let tgt = config.target_dir(); if !tgt.exists() { let create_dir_result = create_dir_all(&tgt); @@ -46,7 +61,7 @@ pub fn trace(configs: &[Config]) -> Result { warn!("Failed to create target-dir {}", e); } } - match launch_tarpaulin(config) { + match launch_tarpaulin(config, &logger) { Ok((t, r)) => { ret |= r; tracemap.merge(&t); @@ -58,6 +73,18 @@ pub fn trace(configs: &[Config]) -> Result { } } tracemap.dedup(); + if let Some(log) = logger.as_ref() { + let fname = format!("tarpaulin-run-{}.json", Local::now().to_rfc3339()); + let path = Path::new(&fname); + info!("Serializing tarpaulin debug log to {}", path.display()); + if let Ok(output) = File::create(path) { + if let Err(e) = serde_json::to_writer(output, log) { + warn!("Failed to serialise or write result: {}", e); + } + } else { + warn!("Failed to create log file"); + } + } if ret == 0 { tarpaulin_result.map(|_| tracemap) @@ -87,7 +114,10 @@ pub fn run(configs: &[Config]) -> Result<(), RunError> { } /// Launches tarpaulin with the given configuration. -pub fn launch_tarpaulin(config: &Config) -> Result<(TraceMap, i32), RunError> { +pub fn launch_tarpaulin( + config: &Config, + logger: &Option, +) -> Result<(TraceMap, i32), RunError> { if !config.name.is_empty() { info!("Running config {}", config.name); } @@ -104,7 +134,7 @@ pub fn launch_tarpaulin(config: &Config) -> Result<(TraceMap, i32), RunError> { if exe.should_panic() { info!("Running a test executable that is expected to panic"); } - let coverage = get_test_coverage(&exe, &project_analysis, config, false)?; + let coverage = get_test_coverage(&exe, &project_analysis, config, false, logger)?; if let Some(res) = coverage { result.merge(&res.0); return_code |= if exe.should_panic() { @@ -114,7 +144,7 @@ pub fn launch_tarpaulin(config: &Config) -> Result<(TraceMap, i32), RunError> { }; } if config.run_ignored { - let coverage = get_test_coverage(&exe, &project_analysis, config, true)?; + let coverage = get_test_coverage(&exe, &project_analysis, config, true, logger)?; if let Some(res) = coverage { result.merge(&res.0); return_code |= res.1; @@ -132,6 +162,7 @@ pub fn get_test_coverage( analysis: &HashMap, config: &Config, ignored: bool, + logger: &Option, ) -> Result, RunError> { if !test.path().exists() { return Ok(None); @@ -139,9 +170,12 @@ pub fn get_test_coverage( if let Err(e) = limit_affinity() { warn!("Failed to set processor affinity {}", e); } + if let Some(log) = logger.as_ref() { + log.push_binary(test.clone()); + } match fork() { Ok(ForkResult::Parent { child }) => { - match collect_coverage(test.path(), child, analysis, config) { + match collect_coverage(test.path(), child, analysis, config, logger) { Ok(t) => Ok(Some(t)), Err(e) => Err(RunError::TestCoverage(e.to_string())), } @@ -165,12 +199,13 @@ fn collect_coverage( test: Pid, analysis: &HashMap, config: &Config, + logger: &Option, ) -> Result<(TraceMap, i32), RunError> { let mut ret_code = 0; let mut traces = generate_tracemap(test_path, analysis, config)?; { trace!("Test PID is {}", test); - let (mut state, mut data) = create_state_machine(test, &mut traces, config); + let (mut state, mut data) = create_state_machine(test, &mut traces, config, logger); loop { state = state.step(&mut data, config)?; if state.is_finished() { diff --git a/src/statemachine/linux.rs b/src/statemachine/linux.rs index 945a4e90a1..3f4c488027 100644 --- a/src/statemachine/linux.rs +++ b/src/statemachine/linux.rs @@ -1,5 +1,6 @@ use crate::config::Config; use crate::errors::RunError; +use crate::event_log::*; use crate::statemachine::*; use log::{debug, trace}; use nix::errno::Errno; @@ -13,8 +14,9 @@ pub fn create_state_machine<'a>( test: Pid, traces: &'a mut TraceMap, config: &'a Config, + event_log: &'a Option, ) -> (TestState, LinuxData<'a>) { - let mut data = LinuxData::new(traces, config); + let mut data = LinuxData::new(traces, config, event_log); data.parent = test; (TestState::start_state(), data) } @@ -23,8 +25,8 @@ pub type UpdateContext = (TestState, TracerAction); #[derive(Debug, Copy, Clone, Eq, PartialEq)] pub struct ProcessInfo { - pid: Pid, - signal: Option, + pub(crate) pid: Pid, + pub(crate) signal: Option, } impl ProcessInfo { @@ -61,6 +63,8 @@ pub struct LinuxData<'a> { config: &'a Config, /// Thread count. Hopefully getting rid of in future thread_count: isize, + /// Optional event log to update as the test progresses + event_log: &'a Option, } impl<'a> StateData for LinuxData<'a> { @@ -171,6 +175,10 @@ impl<'a> StateData for LinuxData<'a> { let pending = self.wait_queue.clone(); self.wait_queue.clear(); for status in &pending { + if let Some(log) = self.event_log.as_ref() { + let event = TraceEvent::new_from_wait(&status); + log.push_trace(event); + } let state = match status { WaitStatus::PtraceEvent(c, s, e) => match self.handle_ptrace_event(*c, *s, *e) { Ok(s) => Ok(s), @@ -254,6 +262,10 @@ impl<'a> StateData for LinuxData<'a> { } let mut continued = false; for a in &actions { + if let Some(log) = self.event_log.as_ref() { + let event = TraceEvent::new_from_action(&a); + log.push_trace(event); + } match a { TracerAction::TryContinue(t) => { continued = true; @@ -283,7 +295,11 @@ impl<'a> StateData for LinuxData<'a> { } impl<'a> LinuxData<'a> { - pub fn new(traces: &'a mut TraceMap, config: &'a Config) -> LinuxData<'a> { + pub fn new( + traces: &'a mut TraceMap, + config: &'a Config, + event_log: &'a Option, + ) -> LinuxData<'a> { LinuxData { wait_queue: Vec::new(), current: Pid::from_raw(0), @@ -291,6 +307,7 @@ impl<'a> LinuxData<'a> { breakpoints: HashMap::new(), traces, config, + event_log, thread_count: 0, } } From 754117eca929299e4c67f22832e7e157bdfbc234 Mon Sep 17 00:00:00 2001 From: xd009642 Date: Sun, 28 Jun 2020 20:32:20 +0100 Subject: [PATCH 10/17] Update tests to match new interface --- tests/doc_coverage.rs | 8 ++++---- tests/failures.rs | 2 +- tests/line_coverage.rs | 2 +- tests/mod.rs | 10 +++++----- tests/test_types.rs | 8 ++++---- tests/workspaces.rs | 12 ++++++------ 6 files changed, 21 insertions(+), 21 deletions(-) diff --git a/tests/doc_coverage.rs b/tests/doc_coverage.rs index d0b92ad6ce..2b7975b392 100644 --- a/tests/doc_coverage.rs +++ b/tests/doc_coverage.rs @@ -16,7 +16,7 @@ fn doc_test_coverage() { config.run_types = vec![RunType::Doctests]; - let (res, ret) = launch_tarpaulin(&config).unwrap(); + let (res, ret) = launch_tarpaulin(&config, &None).unwrap(); assert_eq!(ret, 0); assert!(res.total_covered() > 0); @@ -24,7 +24,7 @@ fn doc_test_coverage() { config.run_types = vec![RunType::Tests]; - let (res, ret) = launch_tarpaulin(&config).unwrap(); + let (res, ret) = launch_tarpaulin(&config, &None).unwrap(); assert_eq!(ret, 0); assert_eq!(res.total_covered(), 0); @@ -42,7 +42,7 @@ fn doc_test_panics() { config.run_types = vec![RunType::Doctests]; - let (res, ret) = launch_tarpaulin(&config).unwrap(); + let (res, ret) = launch_tarpaulin(&config, &None).unwrap(); assert_eq!(ret, 0); assert!(res.total_covered() > 0); @@ -50,7 +50,7 @@ fn doc_test_panics() { config.run_types = vec![RunType::Tests]; - let (res, ret) = launch_tarpaulin(&config).unwrap(); + let (res, ret) = launch_tarpaulin(&config, &None).unwrap(); assert_eq!(ret, 0); assert_eq!(res.total_covered(), 0); diff --git a/tests/failures.rs b/tests/failures.rs index a68e2b65b7..8a5df20838 100644 --- a/tests/failures.rs +++ b/tests/failures.rs @@ -11,7 +11,7 @@ fn error_if_compilation_fails() { config.manifest = test_dir; config.manifest.push("Cargo.toml"); - let result = launch_tarpaulin(&config); + let result = launch_tarpaulin(&config, &None); assert!(result.is_err()); diff --git a/tests/line_coverage.rs b/tests/line_coverage.rs index c5ddfe4abe..2c7fe1ad54 100644 --- a/tests/line_coverage.rs +++ b/tests/line_coverage.rs @@ -16,7 +16,7 @@ fn simple_project_coverage() { config.manifest = test_dir.clone(); config.manifest.push("Cargo.toml"); - let (res, ret) = launch_tarpaulin(&config).unwrap(); + let (res, ret) = launch_tarpaulin(&config, &None).unwrap(); assert_eq!(ret, 0); env::set_current_dir(restore_dir).unwrap(); let unused_file = test_dir.join("src/unused.rs"); diff --git a/tests/mod.rs b/tests/mod.rs index 2535e1c884..a5b0c88702 100644 --- a/tests/mod.rs +++ b/tests/mod.rs @@ -30,7 +30,7 @@ pub fn check_percentage_with_cli_args(minimum_coverage: f64, has_lines: bool, ar let configs = ConfigWrapper::from(&matches).0; let mut res = TraceMap::new(); for config in &configs { - let (t, _) = launch_tarpaulin(&config).unwrap(); + let (t, _) = launch_tarpaulin(&config, &None).unwrap(); res.merge(&t); } res.dedup(); @@ -59,7 +59,7 @@ pub fn check_percentage_with_config( config.manifest = test_dir; config.manifest.push("Cargo.toml"); - let (res, _) = launch_tarpaulin(&config).unwrap(); + let (res, _) = launch_tarpaulin(&config, &None).unwrap(); env::set_current_dir(restore_dir).unwrap(); if has_lines { @@ -84,7 +84,7 @@ pub fn check_percentage(project_name: &str, minimum_coverage: f64, has_lines: bo fn incorrect_manifest_path() { let mut config = Config::default(); config.manifest.push("__invalid_dir__"); - let launch = launch_tarpaulin(&config); + let launch = launch_tarpaulin(&config, &None); assert!(launch.is_err()); } @@ -94,7 +94,7 @@ fn proc_macro_link() { config.test_timeout = Duration::from_secs(60); let test_dir = get_test_path("proc_macro"); config.manifest = test_dir.join("Cargo.toml"); - assert!(launch_tarpaulin(&config).is_ok()); + assert!(launch_tarpaulin(&config, &None).is_ok()); } #[test] @@ -239,7 +239,7 @@ fn cargo_home_filtering() { config.manifest.push("Cargo.toml"); env::set_var("CARGO_HOME", new_home.display().to_string()); - let run = launch_tarpaulin(&config); + let run = launch_tarpaulin(&config, &None); match previous { Ok(s) => env::set_var("CARGO_HOME", s), Err(_) => { diff --git a/tests/test_types.rs b/tests/test_types.rs index 126dec0ee2..5b6508b59e 100644 --- a/tests/test_types.rs +++ b/tests/test_types.rs @@ -16,7 +16,7 @@ fn only_test_coverage() { config.manifest = test_dir; config.manifest.push("Cargo.toml"); - let (res, ret) = launch_tarpaulin(&config).unwrap(); + let (res, ret) = launch_tarpaulin(&config, &None).unwrap(); assert_eq!(ret, 0); env::set_current_dir(restore_dir).unwrap(); @@ -42,7 +42,7 @@ fn only_example_coverage() { config.manifest = test_dir; config.manifest.push("Cargo.toml"); - let (res, ret) = launch_tarpaulin(&config).unwrap(); + let (res, ret) = launch_tarpaulin(&config, &None).unwrap(); assert_eq!(ret, 0); env::set_current_dir(restore_dir).unwrap(); @@ -69,7 +69,7 @@ fn only_bench_coverage() { config.manifest = test_dir; config.manifest.push("Cargo.toml"); - let (res, ret) = launch_tarpaulin(&config).unwrap(); + let (res, ret) = launch_tarpaulin(&config, &None).unwrap(); assert_eq!(ret, 0); env::set_current_dir(restore_dir).unwrap(); @@ -96,7 +96,7 @@ fn only_doctest_coverage() { config.manifest = test_dir; config.manifest.push("Cargo.toml"); - let (res, ret) = launch_tarpaulin(&config).unwrap(); + let (res, ret) = launch_tarpaulin(&config, &None).unwrap(); assert_eq!(ret, 0); env::set_current_dir(restore_dir).unwrap(); diff --git a/tests/workspaces.rs b/tests/workspaces.rs index 1021dc0f69..8cf9f25952 100644 --- a/tests/workspaces.rs +++ b/tests/workspaces.rs @@ -12,7 +12,7 @@ fn package_exclude() { config.manifest.push("Cargo.toml"); config.all = true; - let result = launch_tarpaulin(&config); + let result = launch_tarpaulin(&config, &None); let result = result.expect("Test failed").0; let files = result.files(); files.iter().for_each(|f| { @@ -22,14 +22,14 @@ fn package_exclude() { assert!(files.iter().any(|f| f.ends_with("bar/src/lib.rs"))); config.exclude = vec!["foo".to_string()]; - let result = launch_tarpaulin(&config); + let result = launch_tarpaulin(&config, &None); let result = result.expect("Test failed").0; let files = result.files(); assert!(!files.iter().any(|f| f.ends_with("foo/src/lib.rs"))); assert!(files.iter().any(|f| f.ends_with("bar/src/lib.rs"))); config.exclude = vec!["bar".to_string()]; - let result = launch_tarpaulin(&config); + let result = launch_tarpaulin(&config, &None); let result = result.expect("Test failed").0; let files = result.files(); assert!(files.iter().any(|f| f.ends_with("foo/src/lib.rs"))); @@ -44,21 +44,21 @@ fn specify_package() { config.manifest = test_dir; config.manifest.push("Cargo.toml"); config.packages = vec!["foo".to_string()]; - let result = launch_tarpaulin(&config); + let result = launch_tarpaulin(&config, &None); let result = result.expect("Test failed").0; let files = result.files(); assert!(files.iter().any(|f| f.ends_with("foo/src/lib.rs"))); assert!(!files.iter().any(|f| f.ends_with("bar/src/lib.rs"))); config.packages = vec!["bar".to_string()]; - let result = launch_tarpaulin(&config); + let result = launch_tarpaulin(&config, &None); let result = result.expect("Test failed").0; let files = result.files(); assert!(!files.iter().any(|f| f.ends_with("foo/src/lib.rs"))); assert!(files.iter().any(|f| f.ends_with("bar/src/lib.rs"))); config.packages = vec!["bar".to_string(), "foo".to_string()]; - let result = launch_tarpaulin(&config); + let result = launch_tarpaulin(&config, &None); let result = result.expect("Test failed").0; let files = result.files(); assert!(files.iter().any(|f| f.ends_with("foo/src/lib.rs"))); From c4775efa93ce0d80876242d254adffab4ba59d6b Mon Sep 17 00:00:00 2001 From: xd009642 Date: Sun, 28 Jun 2020 20:33:07 +0100 Subject: [PATCH 11/17] Make event_log module public --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 1896e32a86..a0754c9e9f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -21,7 +21,7 @@ pub mod breakpoint; mod cargo; pub mod config; pub mod errors; -mod event_log; +pub mod event_log; mod path_utils; mod process_handling; pub mod report; From 16563e68aa3b5d11d200e926511729393a34c08a Mon Sep 17 00:00:00 2001 From: xd009642 Date: Sun, 28 Jun 2020 21:41:53 +0100 Subject: [PATCH 12/17] Update messages Made the action messages tidier grammatically and length wise --- src/event_log.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/event_log.rs b/src/event_log.rs index c4b2929a53..1e892dc0b4 100644 --- a/src/event_log.rs +++ b/src/event_log.rs @@ -29,23 +29,23 @@ impl TraceEvent { TracerAction::TryContinue(t) => TraceEvent { pid: Some(t.pid.as_raw()), signal: t.signal.map(|x| x.to_string()), - description: "Trying to continuing child".to_string(), + description: "Try continue child".to_string(), ..Default::default() }, TracerAction::Continue(t) => TraceEvent { pid: Some(t.pid.as_raw()), signal: t.signal.map(|x| x.to_string()), - description: "Continuing child".to_string(), + description: "Continue child".to_string(), ..Default::default() }, TracerAction::Step(t) => TraceEvent { pid: Some(t.pid.as_raw()), - description: "Stepping child".to_string(), + description: "Step child".to_string(), ..Default::default() }, TracerAction::Detach(t) => TraceEvent { pid: Some(t.pid.as_raw()), - description: "Detaching child".to_string(), + description: "Detach child".to_string(), ..Default::default() }, _ => TraceEvent { From e520423e0cf3f73e041e18f08fb5cbd05bbbf8b7 Mon Sep 17 00:00:00 2001 From: xd009642 Date: Sun, 28 Jun 2020 23:04:41 +0100 Subject: [PATCH 13/17] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d8ee2dc7eb..cad744e525 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ file. - Add named test running and flags `--test`, `--example`, `--bin`, `--bench` - Equivalent options for `--no-fail-fast` and `--profile` - Filtering of `CARGO_HOME` contents when it exists in project directory +- `--debug` now outputs a json log format that can be used to plot tarpaulin execution ### Changed - Now merge run-types in configs From d22d2fbdfb1f37df2e2265c1f2db942ac057a262 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 30 Jun 2020 06:55:26 +0000 Subject: [PATCH 14/17] Bump serde_json from 1.0.55 to 1.0.56 Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.55 to 1.0.56. - [Release notes](https://github.com/serde-rs/json/releases) - [Commits](https://github.com/serde-rs/json/compare/v1.0.55...v1.0.56) Signed-off-by: dependabot-preview[bot] --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 55d2393374..0be58b7f35 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -645,9 +645,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.55" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec2c5d7e739bc07a3e73381a39d61fdb5f671c60c1df26a130690665803d8226" +checksum = "3433e879a558dde8b5e8feb2a04899cf34fdde1fafb894687e52105fc1162ac3" dependencies = [ "itoa", "ryu", From 9b21ec9a27e6e336faf1d53c28cf7ed429f5520a Mon Sep 17 00:00:00 2001 From: xd009642 Date: Tue, 30 Jun 2020 21:35:29 +0100 Subject: [PATCH 15/17] add --dump-traces flag save logs in drop --- README.md | 1 + src/config/mod.rs | 9 +++++++++ src/event_log.rs | 19 +++++++++++++++++++ src/lib.rs | 17 ++--------------- src/main.rs | 1 + 5 files changed, 32 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 25b37da451..899bf7784f 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,7 @@ FLAGS: --count Counts the number of hits during coverage --debug Show debug output - this is used for diagnosing issues with tarpaulin --doc Test only this library's documentation + --dump-traces Log tracing events and save to a json file. Also, enabled when --debug is used --examples Test all examples --force-clean Adds a clean stage to work around cargo bugs that may affect coverage results -f, --forward Forwards unexpected signals to test. Tarpaulin will still take signals it is expecting. diff --git a/src/config/mod.rs b/src/config/mod.rs index cc2a1d8f8b..10c50bd3a3 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -50,6 +50,9 @@ pub struct Config { pub verbose: bool, /// Debug flag for printing internal debugging information to the user pub debug: bool, + /// Enable the event logger + #[serde(rename = "dump-traces")] + pub dump_traces: bool, /// Flag to count hits in coverage pub count: bool, /// Flag specifying to run line coverage (default) @@ -163,6 +166,7 @@ impl Default for Config { force_clean: false, verbose: false, debug: false, + dump_traces: false, count: false, line_coverage: true, branch_coverage: false, @@ -205,6 +209,7 @@ impl<'a> From<&'a ArgMatches<'a>> for ConfigWrapper { fn from(args: &'a ArgMatches<'a>) -> Self { info!("Creating config"); let debug = args.is_present("debug"); + let dump_traces = debug || args.is_present("dump-traces"); let verbose = args.is_present("verbose") || debug; let excluded_files = get_excluded(args); let excluded_files_raw = get_list(args, "exclude-files"); @@ -228,6 +233,7 @@ impl<'a> From<&'a ArgMatches<'a>> for ConfigWrapper { no_fail_fast: args.is_present("no-fail-fast"), verbose, debug, + dump_traces, count: args.is_present("count"), line_coverage: get_line_cov(args), branch_coverage: get_branch_cov(args), @@ -425,6 +431,7 @@ impl Config { } else if other.verbose { self.verbose = other.verbose; } + self.dump_traces |= other.dump_traces; self.manifest = other.manifest.clone(); self.root = Config::pick_optional_config(&self.root, &other.root); self.coveralls = Config::pick_optional_config(&self.coveralls, &other.coveralls); @@ -956,12 +963,14 @@ mod tests { bench = ["bench"] no-fail-fast = true profile = "Release" + dump-traces = true "#; let mut configs = Config::parse_config_toml(toml.as_bytes()).unwrap(); assert_eq!(configs.len(), 1); let config = configs.remove(0); assert!(config.debug); assert!(config.verbose); + assert!(config.dump_traces); assert!(config.ignore_panics); assert!(config.count); assert!(config.run_ignored); diff --git a/src/event_log.rs b/src/event_log.rs index 1e892dc0b4..f4dc1da30e 100644 --- a/src/event_log.rs +++ b/src/event_log.rs @@ -1,10 +1,14 @@ use crate::cargo::TestBinary; use crate::ptrace_control::*; use crate::statemachine::{ProcessInfo, TracerAction}; +use chrono::offset::Local; +use log::{info, warn}; use nix::libc::*; use nix::sys::{signal::Signal, wait::WaitStatus}; use serde::{Deserialize, Serialize}; use std::cell::RefCell; +use std::fs::File; +use std::path::Path; #[derive(Clone, Eq, PartialEq, PartialOrd, Ord, Hash, Serialize, Deserialize)] pub enum Event { @@ -143,3 +147,18 @@ impl EventLog { self.events.borrow_mut().push(Event::ConfigLaunch(name)); } } + +impl Drop for EventLog { + fn drop(&mut self) { + let fname = format!("tarpaulin-run-{}.json", Local::now().to_rfc3339()); + let path = Path::new(&fname); + info!("Serializing tarpaulin debug log to {}", path.display()); + if let Ok(output) = File::create(path) { + if let Err(e) = serde_json::to_writer(output, self) { + warn!("Failed to serialise or write result: {}", e); + } + } else { + warn!("Failed to create log file"); + } + } +} diff --git a/src/lib.rs b/src/lib.rs index a0754c9e9f..344dd886b0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -8,13 +8,12 @@ use crate::source_analysis::LineAnalysis; use crate::statemachine::*; use crate::test_loader::*; use crate::traces::*; -use chrono::offset::Local; use log::{error, info, trace, warn}; use nix::unistd::*; use std::collections::HashMap; use std::env; use std::ffi::CString; -use std::fs::{create_dir_all, File}; +use std::fs::create_dir_all; use std::path::{Path, PathBuf}; pub mod breakpoint; @@ -36,7 +35,7 @@ pub fn trace(configs: &[Config]) -> Result { let mut tracemap = TraceMap::new(); let mut tarpaulin_result = Ok(()); let mut ret = 0i32; - let logger = if configs.iter().any(|c| c.debug) { + let logger = if configs.iter().any(|c| c.dump_traces) { Some(EventLog::new()) } else { None @@ -73,18 +72,6 @@ pub fn trace(configs: &[Config]) -> Result { } } tracemap.dedup(); - if let Some(log) = logger.as_ref() { - let fname = format!("tarpaulin-run-{}.json", Local::now().to_rfc3339()); - let path = Path::new(&fname); - info!("Serializing tarpaulin debug log to {}", path.display()); - if let Ok(output) = File::create(path) { - if let Err(e) = serde_json::to_writer(output, log) { - warn!("Failed to serialise or write result: {}", e); - } - } else { - warn!("Failed to create log file"); - } - } if ret == 0 { tarpaulin_result.map(|_| tracemap) diff --git a/src/main.rs b/src/main.rs index 3c527d28aa..52a1a2cabf 100644 --- a/src/main.rs +++ b/src/main.rs @@ -71,6 +71,7 @@ fn main() -> Result<(), String> { --no-fail-fast 'Run all tests regardless of failure' --profile [NAME] 'Build artefacts with the specified profile' --debug 'Show debug output - this is used for diagnosing issues with tarpaulin' + --dump-traces 'Log tracing events and save to a json file. Also, enabled when --debug is used' --verbose -v 'Show extra output' --ignore-tests 'Ignore lines of test functions when collecting coverage' --ignore-panics 'Ignore panic macros in tests' From d018088454b6b55d5dea9bfdb4c4d7b450bfcf05 Mon Sep 17 00:00:00 2001 From: xd009642 Date: Tue, 30 Jun 2020 21:48:53 +0100 Subject: [PATCH 16/17] Tweak changelog --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cad744e525..e1a5b60c12 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,8 @@ file. - Add named test running and flags `--test`, `--example`, `--bin`, `--bench` - Equivalent options for `--no-fail-fast` and `--profile` - Filtering of `CARGO_HOME` contents when it exists in project directory -- `--debug` now outputs a json log format that can be used to plot tarpaulin execution +- `--debug` or `--dump-traces` now outputs a json log format that can be used +to plot tarpaulin execution ### Changed - Now merge run-types in configs From 8af0d80cec307feb1a4775c07ad9002bf76a327f Mon Sep 17 00:00:00 2001 From: xd009642 Date: Wed, 1 Jul 2020 20:22:40 +0100 Subject: [PATCH 17/17] Prepare for 0.14.1 --- CHANGELOG.md | 7 +++++++ Cargo.lock | 2 +- Cargo.toml | 2 +- README.md | 2 +- travis-install.sh | 2 +- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e1a5b60c12..73d85d9279 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ file. ## [Unreleased] ### Added + +### Changed + +### Removed + +## [0.14.1] - 2020-07-01 +### Added - run-types for lib, bins and all-targets - `--tests` `--lib`, `--examples, `--bins`, `--doc`, `--benches`, `--all-targets` flags matching `cargo test` diff --git a/Cargo.lock b/Cargo.lock index 0be58b7f35..efdbcd4d89 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -55,7 +55,7 @@ checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" [[package]] name = "cargo-tarpaulin" -version = "0.14.0" +version = "0.14.1" dependencies = [ "cargo_metadata", "chrono", diff --git a/Cargo.toml b/Cargo.toml index ef75c05b39..522a77295b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cargo-tarpaulin" -version = "0.14.0" +version = "0.14.1" authors = ["Daniel McKenna "] description = "Cargo-Tarpaulin is a tool to determine code coverage achieved via tests" repository = "https://github.com/xd009642/tarpaulin" diff --git a/README.md b/README.md index 899bf7784f..19cada9521 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ Below is the help-text for a thorough explanation of the flags and features available: ```bash -cargo-tarpaulin version: 0.14.0 +cargo-tarpaulin version: 0.14.1 Tool to analyse test coverage of cargo projects USAGE: diff --git a/travis-install.sh b/travis-install.sh index 78d5430b22..f6d7cfc2c0 100755 --- a/travis-install.sh +++ b/travis-install.sh @@ -1,2 +1,2 @@ #!/bin/bash -curl -sL https://github.com/xd009642/tarpaulin/releases/download/0.14.0/cargo-tarpaulin-0.14.0-travis.tar.gz | tar xvz -C $HOME/.cargo/bin +curl -sL https://github.com/xd009642/tarpaulin/releases/download/0.14.1/cargo-tarpaulin-0.14.1-travis.tar.gz | tar xvz -C $HOME/.cargo/bin