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-08-15 17:02:54 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 2456241
divir 3278537
truedvmdsi 6202318
dbltor 13604312
divrs 20390064
int2u 25996442
dblexpo 27751995
mulrrz_int 54818641
mantissa_real 56100732
invmod2BIL 61396747
trunc2nr 62903974
invr 64289342
invr_basecase 64289342
addmulii_gen 99908920
int2n 111047343
mulsr 132686652
truedvmdis 139241389
truedvmdii 143827470
addmulii 191161913
mulss 201188879
usqrt 258627582
rtodbl 312566389
addmulii_lg3 496926429
sqrz_i 568881113
sqrr 602906758
mulsi 621479854
sqru 648499301
mulrrz_3 666746333
mulur_2 757877803
mulrrz_3end 789782646
mulur 970955529
mulir 1024507837
divru 1165687088
mului 1167949688
affrr 1422901358
addmulii_inplace 1632938230
sqri 1963769350
shifti 2325298894
vals 2386786913
modii 3154992904
mulrrz_end 3786792312
mulrrz_i 3957455305
mulrr 4208069571
muluu 4811731306
mulii 22012268687

Generated by: LCOV version 2.0-1