MPS issue job003443

TitleNo coverage testing
Statusclosed
Priorityoptional
Assigned userGareth Rees
OrganizationRavenbrook
DescriptionIt would be useful to have some kind of report on the coverage achieved by the test suite.
AnalysisOn OS X:
1. In the mps.xcodeproj, select the "mps" project in the leftmost panel, and in the second-leftmost panel, select the targets that you want to generate coverage data for.
2. In the "Build Settings" tab, go down to the "Apple LLVM compiler - Code Generation" section, and turn on "Generate Test Coverage Files" and "Instrument Program Flow".
3. Build.
4. Run the test suite.
5. cd xc/mps.build/Debug/mps.build/Objects-normal/x86_64/
6. gcov mps.c
7. Look at the gcov files.

I put the coverage results as of changelevel 181788 into an e-mail [2].

A brief look at the detailed coverage results reveals that the omissions include:

* Error paths. Very few error paths are covered (I suspect that's because it's quite hard to arrange for many of these functions to fail, but still).
* "Describe" functions like ArenaDescribe and description support functions like WriteULongest.
* Function versions of macros like BTGet and mps_commit.
* Allocation frames (deprecated).
* The "fixed" object format (deprecated).
* BufferModeLOGGED (shouldn't this use the event system?).
* Emergency collections.
* Extending an arena.
* Spare committed memory.
* Reservoirs.
* Telemetry.
* In the public interface: mps_arena_start_collect, mps_ld_merge, mps_message_type_disable, mps_message_type.

Note: gcov reports blocks containing NOTREACHED as being uncovered. I wonder what happens if we mark these with Clang's __builtin_unreachable() directive [1]? See job003446. [GDR 2013-05-16: this directive makes no difference to the coverage report.]
How foundinspection
Evidence[1] <http://clang.llvm.org/docs/LanguageExtensions.html#builtin-unreachable>
[2] <https://info.ravenbrook.com/mail/2013/05/15/18-39-24/0/>
Observed in1.110.0
Created byGareth Rees
Created on2013-03-13 14:18:05
Last modified byGareth Rees
Last modified on2013-05-16 11:48:30
History2013-03-13 GDR Created.

Fixes

Change Effect Date User Description
181822 closed 2013-05-15 19:25:16 Gareth Rees Test coverage report on OS X.