wishlist: Code coverage testing for SelfTest
Bug #335995 reported by
Darsey Litzenberger
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Python-Crypto |
Confirmed
|
Wishlist
|
Unassigned |
Bug Description
It would be nice to see automatically how much code is actually covered by the SelfTest module.
Changed in pycrypto: | |
importance: | Undecided → Wishlist |
status: | New → Confirmed |
To post a comment you must log in.
I don't think this needs to become part of pycrypto. At least for the Python portions of pycrypto, coverage analysis is available using coverage.py. It currently, as of today's trunk, looks like the below.
Mainly, it'll show you what modules have tests in the first place. AllOrNothing is missing, as is elgamal, qNew, and random/random. Everything else gets tested to one extent or another.
Adding additional tests using public test vectors is always welcome.
I'm not quite sure whether coverage.py could handle the C extensions, had they been compiled with coverage support. It does show the test code written for those C extensions.
Please do experiment. :)
python -m coverage report ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- -- win-amd64- 3.1\crypto\ __init_ _ 5 0 100% win-amd64- 3.1\crypto\ cipher\ __init_ _ 3 0 100% win-amd64- 3.1\crypto\ hash\__ init__ 3 0 100% win-amd64- 3.1\crypto\ hash\hmac 44 2 95% win-amd64- 3.1\crypto\ hash\md5 15 7 53% win-amd64- 3.1\crypto\ hash\ripemd 1 0 100% win-amd64- 3.1\crypto\ hash\sha 15 7 53% win-amd64- 3.1\crypto\ pct_warnings 8 0 100% win-amd64- 3.1\crypto\ protocol\ __init_ _ 3 0 100% win-amd64- 3.1\crypto\ protocol\ chaffing 74 36 51% win-amd64- 3.1\crypto\ publickey\ __init_ _ 3 0 100% win-amd64- 3.1\crypto\ publickey\ _dsa 73 7 90% win-amd64- 3.1\crypto\ publickey\ _rsa 28 3 89% win-amd64- 3.1\crypto\ publickey\ _slowmath 83 7 92% win-amd64- 3.1\crypto\ publickey\ dsa 111 29 74% win-amd64- 3.1\crypto\ publickey\ pubkey 75 17 77% win-amd64- 3.1\crypto\ publickey\ rsa 159 28 82% win-amd64- 3.1\crypto\ random\ __init_ _ 10 1 90% win-amd64- 3.1\crypto\ random\ _userfriendlyrn g 118 19 84% win-amd64- 3.1\crypto\ random\ fortuna\ __init_ _ 0 0 100% win-amd64- 3.1\crypto\ random\ fortuna\ fortunaaccumula tor 72 5 93% win-amd64- 3.1\crypto\ random\ fortuna\ fortunagenerato r 60 3 95% win-amd64- 3.1\crypto\ random\ fortuna\ shad256 ...
Name Stmts Miss Cover
-------
build\lib.
build\lib.
build\lib.
build\lib.
build\lib.
build\lib.
build\lib.
build\lib.
build\lib.
build\lib.
build\lib.
build\lib.
build\lib.
build\lib.
build\lib.
build\lib.
build\lib.
build\lib.
build\lib.
build\lib.
build\lib.
build\lib.
build\lib.