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 30702-bddb8d6928) Lines: 11375 15407 73.8 %
Date: 2026-02-23 02:23:56 Functions: 1094 1425 76.8 %
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
gplib.c
33.6%33.6%
33.6 % 347 / 1032 44.2 % 46 / 104
default.c
56.7%56.7%
56.7 % 334 / 589 58.6 % 41 / 70
es.c
58.8%58.8%
58.8 % 1648 / 2801 63.2 % 196 / 310
init.c
68.1%68.1%
68.1 % 1013 / 1487 71.6 % 116 / 162
eval.c
66.1%66.1%
66.1 % 1251 / 1893 72.1 % 111 / 154
parse.c
79.3%79.3%
79.3 % 437 / 551 87.5 % 7 / 8
anal.c
88.6%88.6%
88.6 % 616 / 695 90.1 % 91 / 101
compile.c
88.2%88.2%
88.2 % 1569 / 1779 92.3 % 84 / 91
str.c
90.1%90.1%
90.1 % 118 / 131 93.3 % 14 / 15
hash.c
88.4%88.4%
88.4 % 221 / 250 95.0 % 38 / 40
forprime.c
87.1%87.1%
87.1 % 461 / 529 95.2 % 40 / 42
intnum.c
97.1%97.1%
97.1 % 1586 / 1633 99.3 % 133 / 134
parse.y
95.7%95.7%
95.7 % 112 / 117 - 0 / 0
parsec.h
97.1%97.1%
97.1 % 100 / 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 % 1232 / 1296 100.0 % 105 / 105

Generated by: LCOV version 1.16