Make LCOV ignore code unreachable in tests
I'm not sure if you want to use this tactic or not -- this is my first time working on a project with coverage testing, so I'm unsure of the wisdom of what I've done.
I've identified 3 types of code that I believe to be unreachable in testing:
- code that requires interactivity (like being able to type ^C)
- code that tests for an OOM error
- bugs, that should be unreachable by design
I've made 3 different commits, ordered in how certain I am about their legitimacy:
9a4dccf4 - sig_handler() and OOM check in xmalloc() 94bf6404 - bug() and all calls to BUG() d04e1e58 - some bits of misc.c that I think are unreachable because they require interactivity, but could be wrong
Also: am I correct that dungeon.c is going away eventually, and thus I shouldn't worry about getting perfect test coverage there?