Skip to content

Commit

Permalink
Run llvm-cov with nextest
Browse files Browse the repository at this point in the history
  • Loading branch information
messense committed Mar 20, 2022
1 parent 8a96df5 commit fae77c9
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,8 @@ jobs:
components: llvm-tools-preview
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Install cargo-nextest
uses: taiki-e/install-action@nextest
- run: python -m pip install -U pip nox
- run: cargo xtask coverage --output-lcov coverage.lcov
- uses: codecov/codecov-action@v2
Expand Down
37 changes: 26 additions & 11 deletions xtask/src/llvm_cov.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,44 +12,59 @@ pub fn run(opts: CoverageOpts) -> Result<()> {

cli::run(
Command::new("cargo")
.args(&["test", "--manifest-path", "pyo3-build-config/Cargo.toml"])
.args(&[
"nextest",
"run",
"--manifest-path",
"pyo3-build-config/Cargo.toml",
])
.envs(&env),
)?;
cli::run(
Command::new("cargo")
.args(&["test", "--manifest-path", "pyo3-macros-backend/Cargo.toml"])
.args(&[
"nextest",
"run",
"--manifest-path",
"pyo3-macros-backend/Cargo.toml",
])
.envs(&env),
)?;
cli::run(
Command::new("cargo")
.args(&["test", "--manifest-path", "pyo3-macros/Cargo.toml"])
.args(&[
"nextest",
"run",
"--manifest-path",
"pyo3-macros/Cargo.toml",
])
.envs(&env),
)?;

cli::run(Command::new("cargo").arg("test").envs(&env))?;
cli::run(Command::new("cargo").arg("nextest").arg("run").envs(&env))?;
cli::run(
Command::new("cargo")
.args(&["test", "--features", "abi3"])
.args(&["nextest", "run", "--features", "abi3"])
.envs(&env),
)?;
cli::run(
Command::new("cargo")
.args(&["test", "--features", "full"])
.args(&["nextest", "run", "--features", "full"])
.envs(&env),
)?;
cli::run(
Command::new("cargo")
.args(&["test", "--features", "abi3 full"])
.args(&["nextest", "run", "--features", "abi3 full"])
.envs(&env),
)?;

crate::pytests::run(&env)?;

match opts.output_lcov {
Some(path) => {
cli::run(llvm_cov_command(&["--no-run", "--lcov", "--output-path", &path]).envs(&env))?
}
None => cli::run(llvm_cov_command(&["--no-run", "--summary-only"]).envs(&env))?,
Some(path) => cli::run(
llvm_cov_command(&["nextest", "--no-run", "--lcov", "--output-path", &path]).envs(&env),
)?,
None => cli::run(llvm_cov_command(&["nextest", "--no-run", "--summary-only"]).envs(&env))?,
}

Ok(())
Expand Down

0 comments on commit fae77c9

Please sign in to comment.