Skip to content

Commit

Permalink
release 0.29.1
Browse files Browse the repository at this point in the history
  • Loading branch information
xd009642 committed May 3, 2024
2 parents f24a5cc + f2546c8 commit 895bd94
Show file tree
Hide file tree
Showing 11 changed files with 124 additions and 48 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
From 2019 onwards, all notable changes to tarpaulin will be documented in this
file.

## [0.29.1] 2024-05-03
### Added
- Use `RUSTUP_HOME` to handle rustup being installed in non-standard directories

## [0.29.0] 2024-05-01
### Added
- Troubleshooting guide
Expand Down
34 changes: 29 additions & 5 deletions Cargo.lock

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

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cargo-tarpaulin"
version = "0.29.0"
version = "0.29.1"
authors = ["Daniel McKenna <danielmckenna93@gmail.com>"]
description = "Cargo-Tarpaulin is a tool to determine code coverage achieved via tests"
repository = "https://github.com/xd009642/tarpaulin"
Expand Down Expand Up @@ -71,6 +71,7 @@ rustc_version = "0.4"
[dev-dependencies]
lcov = "0.8.1"
rusty-fork = "0.3.0"
tracing-test = { version = "0.2.4", features = ["no-env-filter"] }

[package.metadata.binstall]
pkg-url = "{ repo }/releases/download/{ version }/cargo-tarpaulin-{ target }{ archive-suffix }"
Expand Down
3 changes: 2 additions & 1 deletion src/cargo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,8 @@ fn create_command(manifest_path: &str, config: &Config, ty: Option<RunType>) ->
let mut test_cmd = Command::new("cargo");
let bootstrap = matches!(env::var("RUSTC_BOOTSTRAP").as_deref(), Ok("1"));
let override_toolchain = if cfg!(windows) {
if env::var("PATH").unwrap_or_default().contains(".rustup") {
let rustup_home = env::var("RUSTUP_HOME").unwrap_or(".rustup".into());
if env::var("PATH").unwrap_or_default().contains(&rustup_home) {
// So the specific cargo we're using is in the path var so rustup toolchains won't
// work. This only started happening recently so special casing it for older versions
env::remove_var("RUSTUP_TOOLCHAIN");
Expand Down
16 changes: 9 additions & 7 deletions tests/doc_coverage.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
use crate::utils::get_test_path;
use cargo_tarpaulin::config::{Color, Config, RunType};
use cargo_tarpaulin::{launch_tarpaulin, setup_logging};
use cargo_tarpaulin::launch_tarpaulin;
use rusty_fork::rusty_fork_test;
use std::time::Duration;
use std::{env, path::PathBuf};
use tracing_test::traced_test;

rusty_fork_test! {
#[test]
#[traced_test]
fn doc_test_env() {
setup_logging(Color::Never, false, false);
let mut config = Config::default();
config.set_clean(false);
config.test_timeout = Duration::from_secs(60);
Expand All @@ -29,8 +30,8 @@ fn doc_test_env() {
}

#[test]
#[traced_test]
fn doc_test_coverage() {
setup_logging(Color::Never, false, false);
let mut config = Config::default();
config.verbose = true;
config.set_clean(false);
Expand Down Expand Up @@ -60,8 +61,8 @@ fn doc_test_coverage() {
}

#[test]
#[traced_test]
fn doc_test_panics() {
setup_logging(Color::Never, false, false);
let mut config = Config::default();
config.verbose = true;
config.set_clean(false);
Expand Down Expand Up @@ -91,8 +92,8 @@ fn doc_test_panics() {
}

#[test]
#[traced_test]
fn doc_test_panics_workspace() {
setup_logging(Color::Never, false, false);
let mut config = Config::default();
config.verbose = true;
config.set_clean(false);
Expand Down Expand Up @@ -122,8 +123,8 @@ fn doc_test_panics_workspace() {
}

#[test]
#[traced_test]
fn doc_test_compile_fail() {
setup_logging(Color::Never, false, false);
let mut config = Config::default();
config.verbose = true;
config.set_clean(false);
Expand All @@ -140,8 +141,8 @@ fn doc_test_compile_fail() {
}

#[test]
#[traced_test]
fn doc_test_no_run() {
setup_logging(Color::Never, false, false);
let mut config = Config::default();
config.verbose = true;
config.set_clean(false);
Expand All @@ -159,6 +160,7 @@ fn doc_test_no_run() {
}

#[test]
#[traced_test]
fn rustdocflags_handling() {
env::set_var("RUSTDOCFLAGS", "--cfg=foo");
let mut config = Config::default();
Expand Down
14 changes: 6 additions & 8 deletions tests/failure_thresholds.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
use crate::utils::get_test_path;
use cargo_tarpaulin::{
config::{Color, Config},
errors::RunError,
};
use cargo_tarpaulin::{run, setup_logging};
use cargo_tarpaulin::run;
use cargo_tarpaulin::{config::Config, errors::RunError};
use rusty_fork::rusty_fork_test;
use std::{env, path::PathBuf};
use tracing_test::traced_test;

rusty_fork_test! {

#[test]
#[traced_test]
fn coverage_below_threshold() {
setup_logging(Color::Never, false, false);
let mut config = Config::default();
let test_dir = get_test_path("simple_project");
env::set_current_dir(&test_dir).unwrap();
Expand All @@ -34,8 +32,8 @@ fn coverage_below_threshold() {
}

#[test]
#[traced_test]
fn coverage_above_threshold() {
setup_logging(Color::Never, false, false);
let mut config = Config::default();
let test_dir = get_test_path("simple_project");
env::set_current_dir(&test_dir).unwrap();
Expand All @@ -52,8 +50,8 @@ fn coverage_above_threshold() {
}

#[test]
#[traced_test]
fn report_coverage_fail() {
setup_logging(Color::Never, false, false);
let mut config = Config::default();
let test_dir = get_test_path("simple_project");
env::set_current_dir(&test_dir).unwrap();
Expand Down
13 changes: 7 additions & 6 deletions tests/failures.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
use crate::utils::get_test_path;
use cargo_tarpaulin::{
config::{Color, Config, Mode},
config::{Config, Mode},
errors::RunError,
};
use cargo_tarpaulin::{launch_tarpaulin, run, setup_logging};
use cargo_tarpaulin::{launch_tarpaulin, run};
use rusty_fork::rusty_fork_test;
use std::env;
use tracing_test::traced_test;

rusty_fork_test! {

#[test]
#[traced_test]
fn error_if_build_script_fails() {
setup_logging(Color::Never, false, false);
let mut config = Config::default();
let test_dir = get_test_path("build_script_fail");
env::set_current_dir(&test_dir).unwrap();
Expand All @@ -31,8 +32,8 @@ fn error_if_build_script_fails() {
}

#[test]
#[traced_test]
fn error_if_compilation_fails() {
setup_logging(Color::Never, false, false);
let mut config = Config::default();
let test_dir = get_test_path("compile_fail");
env::set_current_dir(&test_dir).unwrap();
Expand All @@ -52,8 +53,8 @@ fn error_if_compilation_fails() {
}

#[test]
#[traced_test]
fn error_if_test_fails() {
setup_logging(Color::Never, false, false);
let mut config = Config::default();
let test_dir = get_test_path("failing_test");
env::set_current_dir(&test_dir).unwrap();
Expand All @@ -73,8 +74,8 @@ fn error_if_test_fails() {
}

#[test]
#[traced_test]
fn issue_610() {
setup_logging(Color::Never, false, false);
let mut config = Config::default();
let test_dir = get_test_path("issue_610");
config.test_names.insert("foo".to_string());
Expand Down
11 changes: 6 additions & 5 deletions tests/line_coverage.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
use crate::utils::get_test_path;
use cargo_tarpaulin::config::{Color, Config};
use cargo_tarpaulin::config::Config;
use cargo_tarpaulin::launch_tarpaulin;
use cargo_tarpaulin::traces::CoverageStat;
use cargo_tarpaulin::{launch_tarpaulin, setup_logging};
use rusty_fork::rusty_fork_test;
use std::env;
use std::time::Duration;
use tracing_test::traced_test;

rusty_fork_test! {

#[test]
#[traced_test]
fn simple_project_coverage() {
setup_logging(Color::Never, false, false);
let mut config = Config::default();
config.set_clean(false);
config.test_timeout = Duration::from_secs(60);
Expand Down Expand Up @@ -51,8 +52,8 @@ fn simple_project_coverage() {
}

#[test]
#[traced_test]
fn debug_info_0() {
setup_logging(Color::Never, false, false);
// From issue #601
let mut config = Config::default();
config.set_clean(false);
Expand All @@ -75,8 +76,8 @@ fn debug_info_0() {
}

#[test]
#[traced_test]
fn test_threads_1() {
setup_logging(Color::Never, false, false);
let mut config = Config::default();
config.set_clean(false);
let restore_dir = env::current_dir().unwrap();
Expand Down
Loading

0 comments on commit 895bd94

Please sign in to comment.