Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New "ctest" feature is confusing #140

Open
mgeier opened this issue Nov 25, 2020 · 1 comment
Open

New "ctest" feature is confusing #140

mgeier opened this issue Nov 25, 2020 · 1 comment
Labels
F-Documentation Related to the documentation

Comments

@mgeier
Copy link
Contributor

mgeier commented Nov 25, 2020

I think this would be a reasonable thing to do:

cd example-project
cargo test --all-features

However, it doesn't work, the tests fail.

OTOH, if I run

cargo ctest

... it doesn't only test the C API (which I would expect), but instead it tests everything, including the Rust-only tests.

Wouldn't it make more sense to separate the two kinds of tests a bit more?

What about establishing the convention of having all C API tests in a directory named ctests?

This way the two would be separated more clearly and I think the whole situation would be less confusing.

Or am I missing something?

@lu-zero
Copy link
Owner

lu-zero commented Nov 25, 2020

In general cargo test --all-features is the best way to have surprising results and it should be actively avoided. The most common problem is when you have mutually exclusive features such as a crate supporting either tokio or async-std.

Right now ctest uses the testing infrastructure provided by cargo as-is. inline-c let you build tests as unit-tests and I do not have a mean to filter inline-c tests from the others.

Ergonomy-wise I'd expect the users to not run cargo test --features=capi.

@lu-zero lu-zero added the F-Documentation Related to the documentation label Dec 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-Documentation Related to the documentation
Projects
None yet
Development

No branches or pull requests

2 participants