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 - kernel/none - mp_indep.c (source / functions) Coverage Total Hit
Test: PARI/GP v2.19.0 lcov report (development 31092-e6893b0017) Lines: 94.3 % 562 530
Test Date: 2026-09-17 17:02:44 Functions: 96.2 % 52 50
Legend: Lines:     hit not hit

Function Name Sort by function name Hit count Sort by function hit count
dblmantissa 0
div0r 0
divsi 175
divsr 798
int2um1 8807
mul0r 481863
sqrs 742871
divur 2456247
divir 3278537
truedvmdsi 6202318
dbltor 13604678
divrs 20390108
int2u 25996683
dblexpo 27752028
mulrrz_int 54818665
mantissa_real 56110932
invmod2BIL 61396729
trunc2nr 62907321
invr 64290130
invr_basecase 64290130
addmulii_gen 99936214
int2n 111055959
mulsr 132691967
truedvmdis 139267926
truedvmdii 143860946
addmulii 191210116
mulss 201188911
usqrt 258441290
rtodbl 312596490
addmulii_lg3 496983669
sqrz_i 568892153
sqrr 602905199
mulsi 621542647
sqru 648496921
mulrrz_3 666759237
mulur_2 757920274
mulrrz_3end 789797461
mulur 971008717
mulir 1024564257
divru 1165694662
mului 1168011048
affrr 1422922577
addmulii_inplace 1633097853
sqri 1964049971
shifti 2325326441
vals 2386817848
modii 3154972395
mulrrz_end 3786903656
mulrrz_i 3957570420
mulrr 4206412162
muluu 4811981357
mulii 22012826078

Generated by: LCOV version 2.0-1