Code coverage tests

This page documents the degree to which the PARI/GP source code is tested by our public test suite, distributed with the source distribution in directory src/test/. This is measured by the gcov utility; we then process gcov output using the lcov frond-end.

We test a few variants depending on Configure flags on the pari.math.u-bordeaux.fr machine (x86_64 architecture), and agregate them in the final report:

The target is to exceed 90% coverage for all mathematical modules (given that branches depending on DEBUGLEVEL or DEBUGMEM are not covered). This script is run to produce the results below.

LCOV - code coverage report
Current view: top level - language Hit Total Coverage
Test: PARI/GP v2.18.1 lcov report (development 30074-db9b3c0519) Lines: 12171 15324 79.4 %
Date: 2025-03-13 08:38:27 Functions: 1192 1415 84.2 %
Legend: Rating: low: < 75 % medium: >= 75 % high: >= 90 %

Filename Sort by name Line Coverage Sort by line coverage Functions Sort by function coverage
readline.c
0.0%
0.0 % 0 / 186 0.0 % 0 / 17
default.c
63.1%63.1%
63.1 % 373 / 591 62.9 % 44 / 70
gplib.c
55.8%55.8%
55.8 % 575 / 1030 65.4 % 68 / 104
eval.c
68.8%68.8%
68.8 % 1300 / 1889 75.3 % 116 / 154
init.c
74.8%74.8%
74.8 % 1118 / 1495 79.0 % 128 / 162
es.c
73.6%73.6%
73.6 % 2056 / 2792 81.9 % 254 / 310
parse.c
77.0%77.0%
77.0 % 424 / 551 87.5 % 7 / 8
anal.c
91.1%91.1%
91.1 % 631 / 693 93.1 % 94 / 101
str.c
89.5%89.5%
89.5 % 111 / 124 93.3 % 14 / 15
forprime.c
87.3%87.3%
87.3 % 454 / 520 95.1 % 39 / 41
compile.c
90.3%90.3%
90.3 % 1607 / 1779 96.7 % 88 / 91
hash.c
87.9%87.9%
87.9 % 167 / 190 96.9 % 31 / 32
intnum.c
97.0%97.0%
97.0 % 1583 / 1632 99.2 % 132 / 133
parse.y
94.9%94.9%
94.9 % 111 / 117 - 0 / 0
parsec.h
95.1%95.1%
95.1 % 98 / 103 100.0 % 17 / 17
members.c
98.5%98.5%
98.5 % 330 / 335 100.0 % 55 / 55
sumiter.c
95.1%95.1%
95.1 % 1233 / 1297 100.0 % 105 / 105

Generated by: LCOV version 1.16