nextest-rs / datatest-stable Goto Github PK
View Code? Open in Web Editor NEWData-driven tests on stable Rust
Home Page: https://docs.rs/datatest-stable
License: Other
Data-driven tests on stable Rust
Home Page: https://docs.rs/datatest-stable
License: Other
I'm not sure if this is just some kind of user error, but I can't see to get coverage information generated for my datatests.
Coverage information is being generated, but it only seems to contain the hits from the non-datatest
tests. When I clear the '*.profraw' files and run just the datatest
tests, there is 0% coverage.
Initially I tried running cargo llvm-cov --html
, then I tried following the steps for external tests but that didn't work either.
What might make my use-case a bit unusual is the fact that the datatest
tests are in their own crate in the workspace, and I'm expecting coverage information to be generated for another crate in the workspace.
I thought this structure could be part of the problem, so I tried replacing the datatest_stable::harness!
macro with a main
function that directly calls a function from the other crate, and then coverage information was successfully generated.
Any help on this issue would be greatly appreciated.
Let's say you have 10k files. Datatest-stable iterates over all files currently to build the list of tests. Since nextest has a process-per-test model, each test will iterate over every file. That's not great.
Instead, if --exact
is passed in, we should be able to pinpoint the exact test and just use that.
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
Renovate tried to run on this repository, but found these problems.
These updates encountered an error and will be retried. Click on a checkbox below to force a retry now.
cloudflare/pages-action
, taiki-e/install-action
)These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
Cargo.toml
camino 1.1.7
fancy-regex 0.13.0
libtest-mimic 0.7.3
walkdir 2.5.0
camino-tempfile 1.1.1
fs_extra 1.3.0
.github/workflows/ci.yml
actions/checkout v4@692973e3d937129bcbf40652eb9f2f61becf3332
dtolnay/rust-toolchain stable
Swatinem/rust-cache v2@23bce251a8cd2ffc3c1075eaa2367cf899916d84
taiki-e/install-action v2@36d793de2e01530e47054966bebba5d4ef6e9b9e
actions/checkout v4@692973e3d937129bcbf40652eb9f2f61becf3332
dtolnay/rust-toolchain stable
Swatinem/rust-cache v2@23bce251a8cd2ffc3c1075eaa2367cf899916d84
actions/checkout v4@692973e3d937129bcbf40652eb9f2f61becf3332
dtolnay/rust-toolchain master
Swatinem/rust-cache v2@23bce251a8cd2ffc3c1075eaa2367cf899916d84
taiki-e/install-action nextest
.github/workflows/coverage.yml
actions/checkout v4@692973e3d937129bcbf40652eb9f2f61becf3332
dtolnay/rust-toolchain nightly
Swatinem/rust-cache v2@23bce251a8cd2ffc3c1075eaa2367cf899916d84
taiki-e/install-action nextest
taiki-e/install-action cargo-llvm-cov
codecov/codecov-action v4@84508663e988701840491b86de86b666e8a86bed
.github/workflows/docs.yml
actions/checkout v4@692973e3d937129bcbf40652eb9f2f61becf3332
dtolnay/rust-toolchain stable
cloudflare/pages-action 1
.github/workflows/release.yml
actions/checkout v4@692973e3d937129bcbf40652eb9f2f61becf3332
dtolnay/rust-toolchain stable
taiki-e/install-action v2@36d793de2e01530e47054966bebba5d4ef6e9b9e
taiki-e/create-gh-release-action v1@72d65cee1f8033ef0c8b5d79eaf0c45c7c578ce3
Hi,
I have been using this harness with Great Success (tm), apart from a minor inconvenience.
To reduce boilerplate with tests separated into modules, I made the following wrapper:
macro_rules! generate_harness{
($($test:ident),*) => {
datatest_stable::harness!(
$(
$test::run_test,
$test::test_dir(),
$test::FILE_PATTERN,
)*
);
}
}
generate_harness!(test_pdf_parser, test_structure_parser, test_reference_parsing);
Unfortunately if I modify the wrapper to use paths:
macro_rules! generate_harness{
($($test:path),*) => {
datatest_stable::harness!(
$(
$test::run_test,
$test::test_dir(),
$test::FILE_PATTERN,
)*
);
}
}
generate_harness!(pdf::test_pdf_parser, structure::test_structure_parser, grammar::test_reference_parsing);
It suddenly doesn't work, because rustc cannot properly comprehend $test::run_test
if $test
a path
and not an ident
.
This is due to rust-lang/rust#48067.
Apparently, one possible workaround is using $Va : ident $( :: $Vb : ident )*
instead of path
, but I have not tested this.
Loosening $name
to expr
would also solve the problem I think.
I'd also be happy with any other idea. What I currently do is just import everything into the crate namespace, but that's going to be problematic sooner or later.
Use fancy_regex crate instead of standard regex crate.
Thank you very much.
Sometimes
developers want to skip some tests files for run and even want to place such test files in codebase skipping tests for them entirely.
or want to just run only one test file to save time.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.