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 31041-bd73e9fcdd) Lines: 80.6 % 15488 12486
Test Date: 2026-07-22 22:45:42 Functions: 85.9 % 1428 1227
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
parse.y
93.4%93.4%
93.4 % 122 114 -
gplib.c
62.1%62.1%
62.1 % 1032 641 74.0 % 104 77
eval.c
69.3%69.3%
69.3 % 1920 1330 75.6 % 156 118
default.c
74.4%74.4%
74.4 % 589 438 77.1 % 70 54
es.c
73.1%73.1%
73.1 % 2797 2046 81.3 % 310 252
init.c
76.8%76.8%
76.8 % 1488 1143 82.0 % 161 132
parse.c
78.3%78.3%
78.3 % 563 441 87.5 % 8 7
str.c
90.1%90.1%
90.1 % 131 118 93.3 % 15 14
anal.c
91.7%91.7%
91.7 % 695 637 94.1 % 101 95
forprime.c
87.1%87.1%
87.1 % 529 461 95.2 % 42 40
compile.c
90.4%90.4%
90.4 % 1811 1637 96.7 % 92 89
hash.c
91.2%91.2%
91.2 % 250 228 97.5 % 40 39
sumiter.c
94.8%94.8%
94.8 % 1303 1235 99.1 % 107 106
intnum.c
97.1%97.1%
97.1 % 1634 1587 99.2 % 133 132
parsec.h
97.1%97.1%
97.1 % 103 100 100.0 % 17 17
members.c
98.5%98.5%
98.5 % 335 330 100.0 % 55 55

Generated by: LCOV version 2.0-1