Skip to content

Improve test coverage #1255

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

Merged
merged 13 commits into from
Oct 3, 2016
Merged

Improve test coverage #1255

merged 13 commits into from
Oct 3, 2016

Conversation

mcarton
Copy link
Member

@mcarton mcarton commented Oct 2, 2016

This adds a script util/cov.sh to run kcov on clippy.
I did not configure travis to use because it takes some time (~15min on my machine), and uses a lot of memory. Also some results are weird:

  • kcov does not seem to like rust's match very much;
  • kcov definitely does not like our it_let_chain! macro (it only considers the first line, and we have a lot of those);
  • how is that even possible?:
    screenshot from 2016-10-02 15-17-56

Anyway, it did show some stuffs that we were not testing but could easily do: reported coverage goes up from 90.9% to 91.4% 🎉 🎈

For fun,^w^w here are the reports before and after.

@Manishearth
Copy link
Member

This is amazing work! Will review tomorrow.

@Manishearth
Copy link
Member

We could let kcov only be run on master, fwiw. We don't care about travis cycle times on master (do we?)

@mcarton
Copy link
Member Author

mcarton commented Oct 2, 2016

do we?

Don't think so.

@llogiq
Copy link
Contributor

llogiq commented Oct 2, 2016

We could also use coveralls?

@mcarton
Copy link
Member Author

mcarton commented Oct 2, 2016

If we integrate it in travis, yes. kcov supports that.

@@ -0,0 +1,2 @@
fn this_is_obviously(not: a, toml: file) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we place this in tests/aux?

@@ -0,0 +1 @@
blacklisted-names = 42
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto regarding aux

--verify \
--include-path="$(pwd)/src","$(pwd)/clippy_lints/src" \
"$tmpdir/$t" \
cargo test --test "$t"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wonder if there's a better way of doing this. perhaps we could turn off the compiletest tests with an env var, and then just run cargo test?

@Manishearth
Copy link
Member

r=me when ready

@Manishearth
Copy link
Member

Actually, looks ready now 😄

@Manishearth Manishearth merged commit a4198c1 into master Oct 3, 2016
@Manishearth Manishearth deleted the cov branch October 3, 2016 16:45
@mcarton mcarton mentioned this pull request Oct 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants