MozillaSecurity / lithium

Line-based testcase reducer
Mozilla Public License 2.0
95 stars 25 forks source link

Convert to argparse, and other doc/test updates #53

Closed nth10sd closed 7 years ago

nth10sd commented 7 years ago

Here's a bunch of changes to convert optparse usages to argparse, and lots of documentation updates and test updates where available.

Logs are flushed after every log statement in tests_lithium.py as well. The range interestingness test got renamed to repeat as requested over IRC, and its test was improved. The old way of testing it was incorrect, so I fixed it.

I activated the diff_test interestingness test but could not think of a way to test it other than with a js binary for now. I added documentation on how to use it (and am successfully using it now), so let's land these improvements first.

codecov-io commented 7 years ago

Codecov Report

Merging #53 into master will increase coverage by 1.51%. The diff coverage is 96.06%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #53      +/-   ##
==========================================
+ Coverage   83.01%   84.52%   +1.51%     
==========================================
  Files          13       13              
  Lines        1666     1706      +40     
==========================================
+ Hits         1383     1442      +59     
+ Misses        283      264      -19
Impacted Files Coverage Δ
...ithium/docs/examples/arithmetic/product_divides.py 100% <ø> (ø) :arrow_up:
src/lithium/interestingness/utils.py 56.38% <ø> (ø) :arrow_up:
src/lithium/reducer.py 80.92% <ø> (ø) :arrow_up:
src/lithium/interestingness/timed_run.py 72.81% <ø> (+1.94%) :arrow_up:
src/lithium/interestingness/__init__.py 100% <100%> (ø) :arrow_up:
src/lithium/interestingness/outputs.py 100% <100%> (ø) :arrow_up:
src/lithium/interestingness/crashes.py 100% <100%> (ø) :arrow_up:
src/lithium/__init__.py 100% <100%> (ø) :arrow_up:
tests/test_lithium.py 95.22% <100%> (+0.26%) :arrow_up:
src/lithium/interestingness/hangs.py 100% <100%> (ø) :arrow_up:
... and 4 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 f69ee76...6d0defa. Read the comment docs.

nth10sd commented 7 years ago

I added a super-simple test for diff_test that merely tests that the parsing of the spaces between flags still work correctly.