Skip to content

Rework tests for better consumer visibility. #43

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

Closed

Conversation

kentfredric
Copy link
Contributor

This patch moves as many tests as viable to tests/, in order to make
nuking "non-critical" code easier.

( Nothing will hurt if you nuke tests/*, just you won't have as many
tests )

All tests that require src/normalization_tests.rs are gated by

  #[cfg(bloaty_test)]

So that they only run when invoked as:

RUSTFLAGS="--cfg bloaty_test" cargo test

If you do this, its your reponsibility to make sure that file is there.

This means nuking src/normalization_tests.rs doesn't break what happens
by default when a consumer runs cargo test in a published crate.

One tests that previously lived in its own file was folded back
into src/lib.rs, because it was more concise that way, and after the
migration to tests/, it was pretty much there on its own, not
warranting an individual file.

Closes: #38

This patch moves as many tests as viable to tests/, in order to make
nuking "non-critical" code easier.

( Nothing will hurt if you nuke tests/*, just you won't have as many
  tests )

All tests that require src/normalization_tests.rs are gated by

```rust
  #[cfg(bloaty_test)]
```

So that they only run when invoked as:

  RUSTFLAGS="--cfg bloaty_test" cargo test

If you do this, its your reponsibility to make sure that file is there.

This means nuking src/normalization_tests.rs doesn't break what happens
by default when a consumer runs `cargo test` in a published crate.

One tests that previously lived in its own file was folded back
into src/lib.rs, because it was more concise that way, and after the
migration to tests/,  it was pretty much there on its own, not
warranting an individual file.
@Manishearth
Copy link
Member

I'm sorry, putting the main tests out of the happy path is not a viable solution here.

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.

cargo test fails from crates.io tarball
2 participants