Improve test coverage for codebase
jonhoo opened this issue · comments
Jon Gjengset commented
The code coverage of our tests is good, but not as good as we'd like it to be. In particular, I see some obvious candidates for new tests.
In perf
stack collapsing (see coverage report):
- Collapsing a
perf
trace with an empty line. - Collapsing a
perf
trace with a "weird" event line. - Collapsing a
perf
trace with a "process name". - Collapsing a
perf
trace with an inline Java function. - Collapsing a
perf
trace with a "weird" stack line. - Collapse a profile with Go names.
In DTrace stack collapsing (see coverage report):
- Collapse a file with only header lines.
- Collapse a file with a line that has
::
, but not a trailing argument list.
Stack collapsing in general:
- Collapse using
collapse_file
. - Collapse using
collapse_file
onSTDIN
.
In flamegraph
(see coverage report):
- Use a palette file.
- Ignore bad lines.
- Plot an empty trace.
- Plot a file where frames get pruned.
- Plot an inverted flame graph.
- Include grey frames.
- Test a non-sorted multi-reader input.
- Add tests for all the various color mappings.
- Add unit tests for Java semantic coloring.
- Add unit tests for Perl semantic coloring.
- Add unit tests for JavaScript semantic coloring.
- Add tests for various malformed palette lines (see coverage).
- Add a test that has to generate colors (you may need to enable
hash
). - Add tests for various malformed nameattribute lines.
Jon Gjengset commented
It'd also be really cool if someone fuzzed inferno to see that we don't have any truly silly crashes!