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 Coverage Total Hit
Test: PARI/GP v2.18.1 lcov report (development 31042-0fbe168e69) Lines: 79.4 % 15489 12297
Test Date: 2026-07-23 17:04:59 Functions: 84.2 % 1428 1202
Legend: Rating: low: < 75 % medium: >= 75 % high: >= 90 %

File Sort by file name Line Coverage Sort by line coverage Function Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
readline.c
0.0%
0.0 % 186 0.0 % 17
gplib.c
55.7%55.7%
55.7 % 1032 575 65.4 % 104 68
default.c
64.3%64.3%
64.3 % 589 379 64.3 % 70 45
eval.c
69.3%69.3%
69.3 % 1920 1330 75.6 % 156 118
es.c
71.8%71.8%
71.8 % 2798 2008 80.0 % 310 248
init.c
76.5%76.5%
76.5 % 1488 1139 81.4 % 161 131
parse.c
78.3%78.3%
78.3 % 563 441 87.5 % 8 7
forprime.c
87.1%87.1%
87.1 % 529 461 95.2 % 42 40
anal.c
89.5%89.5%
89.5 % 695 622 92.1 % 101 93
str.c
90.1%90.1%
90.1 % 131 118 93.3 % 15 14
compile.c
90.0%90.0%
90.0 % 1811 1630 96.7 % 92 89
hash.c
91.2%91.2%
91.2 % 250 228 97.5 % 40 39
parse.y
93.4%93.4%
93.4 % 122 114 -
sumiter.c
94.8%94.8%
94.8 % 1303 1235 99.1 % 107 106
parsec.h
97.1%97.1%
97.1 % 103 100 100.0 % 17 17
intnum.c
97.1%97.1%
97.1 % 1634 1587 99.2 % 133 132
members.c
98.5%98.5%
98.5 % 335 330 100.0 % 55 55

Generated by: LCOV version 2.0-1