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-21 17:02:41 Functions: 96.2 % 52 50
Legend: Lines:     hit not hit

Function Name Sort by function name Hit count Sort by function hit count
addmulii 191173239
addmulii_gen 99916269
addmulii_inplace 1632958742
addmulii_lg3 496938860
affrr 1422897717
dblexpo 27751946
dblmantissa 0
dbltor 13604287
div0r 0
divir 3278537
divrs 20390022
divru 1165687703
divsi 175
divsr 798
divur 2456238
int2n 111049756
int2u 25996632
int2um1 8807
invmod2BIL 61396734
invr 64289110
invr_basecase 64289110
mantissa_real 56104913
modii 3154822189
mul0r 481858
mulii 22012543913
mulir 1024516753
mulrr 4208029947
mulrrz_3 666706175
mulrrz_3end 789738315
mulrrz_end 3786920938
mulrrz_i 3957538460
mulrrz_int 54818641
mulsi 621484297
mulsr 132688621
mulss 201188896
mului 1167950031
mulur 970962766
mulur_2 757880576
muluu 4811691503
rtodbl 312570890
shifti 2325201868
sqri 1963756826
sqrr 602907983
sqrs 742871
sqru 648474006
sqrz_i 568882253
truedvmdii 143831410
truedvmdis 139243130
truedvmdsi 6202318
trunc2nr 62902970
usqrt 259454905
vals 2387107448

Generated by: LCOV version 2.0-1