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 30703-cd958ce78c) Lines: 12300 15407 79.8 %
Date: 2026-02-23 09:22:43 Functions: 1209 1425 84.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
56.0%56.0%
56.0 % 578 / 1032 65.4 % 68 / 104
default.c
63.3%63.3%
63.3 % 373 / 589 62.9 % 44 / 70
eval.c
68.8%68.8%
68.8 % 1303 / 1893 75.3 % 116 / 154
es.c
73.5%73.5%
73.5 % 2058 / 2801 81.9 % 254 / 310
init.c
76.6%76.6%
76.6 % 1139 / 1487 82.7 % 134 / 162
parse.c
79.3%79.3%
79.3 % 437 / 551 87.5 % 7 / 8
forprime.c
87.1%87.1%
87.1 % 461 / 529 95.2 % 40 / 42
str.c
90.1%90.1%
90.1 % 118 / 131 93.3 % 14 / 15
compile.c
90.4%90.4%
90.4 % 1608 / 1779 96.7 % 88 / 91
hash.c
91.2%91.2%
91.2 % 228 / 250 97.5 % 39 / 40
anal.c
91.7%91.7%
91.7 % 637 / 695 94.1 % 95 / 101
sumiter.c
95.1%95.1%
95.1 % 1232 / 1296 100.0 % 105 / 105
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
intnum.c
97.1%97.1%
97.1 % 1586 / 1633 99.3 % 133 / 134
members.c
98.5%98.5%
98.5 % 330 / 335 100.0 % 55 / 55

Generated by: LCOV version 1.16