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

Generated by: LCOV version 2.0-1