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

Test framework for common interfaces #96

Merged
merged 34 commits into from Oct 6, 2019
Merged

Test framework for common interfaces #96

merged 34 commits into from Oct 6, 2019

Conversation

brycx
Copy link
Member

@brycx brycx commented Sep 7, 2019

Currently a lot of tests are repeated through multiple modules. For example, all implementations that offer incremental processing of data, such a hashing, use the same consistency-tests.

This PR suggests traits that are implemented by the interfaces that share common tests, and defines tests for these interfaces. Such that the actual test-cases only are implemented once. One drawback that has already come up is, that the generalisation makes it harder to develop no_std-compatible tests. Though tests are not currently run in CI on a no_std image, the library is only built to check for compatibility.

The motivation behind this is to reduce the amount of work required to review tests.

This should not be merged before #87 is finalised.

@brycx brycx added testing All testing, except for fuzzing related improvement General improvements to code labels Sep 7, 2019
@codecov
Copy link

codecov bot commented Sep 14, 2019

Codecov Report

Merging #96 into master will increase coverage by 1.04%.
The diff coverage is 95.06%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #96      +/-   ##
==========================================
+ Coverage   96.18%   97.23%   +1.04%     
==========================================
  Files          43       46       +3     
  Lines        6220     5708     -512     
==========================================
- Hits         5983     5550     -433     
+ Misses        237      158      -79
Impacted Files Coverage Δ
tests/stream/rfc_xchacha20.rs 100% <100%> (ø) ⬆️
src/hazardous/aead/chacha20poly1305.rs 97.93% <100%> (+8.64%) ⬆️
src/hazardous/aead/xchacha20poly1305.rs 100% <100%> (+15.38%) ⬆️
src/hazardous/mac/hmac.rs 93.02% <100%> (-4.11%) ⬇️
src/hazardous/hash/blake2b.rs 92.72% <100%> (-0.56%) ⬇️
src/hazardous/stream/xchacha20.rs 94.66% <100%> (+10.45%) ⬆️
src/hazardous/hash/sha512.rs 96.84% <100%> (-0.67%) ⬇️
tests/stream/rfc_chacha20.rs 100% <100%> (ø) ⬆️
src/hazardous/mac/poly1305.rs 94.53% <100%> (-1.83%) ⬇️
src/hazardous/stream/chacha20.rs 94.96% <100%> (+2.05%) ⬆️
... and 20 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c856a74...6595c3c. Read the comment docs.

@brycx brycx changed the title [WIP] Test framework for common interfaces Test framework for common interfaces Oct 4, 2019
@brycx brycx merged commit 2492076 into master Oct 6, 2019
@brycx brycx deleted the test-framework branch October 6, 2019 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement General improvements to code testing All testing, except for fuzzing related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant