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-10-15 17:03:23 Functions: 96.2 % 52 50
Legend: Lines:     hit not hit

Function Name Sort by function name Hit count Sort by function hit count
addmulii 191227995
addmulii_gen 99946279
addmulii_inplace 1633139799
addmulii_lg3 497024807
affrr 1422909769
dblexpo 27752069
dblmantissa 0
dbltor 13604270
div0r 0
divir 3278537
divrs 20390002
divru 1165701524
divsi 175
divsr 798
divur 2456242
int2n 111057495
int2u 25996789
int2um1 8807
invmod2BIL 61397582
invr 64291150
invr_basecase 64291150
mantissa_real 56115968
modii 3155179076
mul0r 481866
mulii 22013734300
mulir 1024578870
mulrr 4206423333
mulrrz_3 666732060
mulrrz_3end 789765662
mulrrz_end 3787051078
mulrrz_i 3957681909
mulrrz_int 54818641
mulsi 621568867
mulsr 132690983
mulss 201188859
mului 1168003607
mulur 971024337
mulur_2 757929991
muluu 4812422605
rtodbl 312608704
shifti 2325383213
sqri 1964069945
sqrr 602908336
sqrs 742871
sqru 648492027
sqrz_i 568896291
truedvmdii 143876983
truedvmdis 139282415
truedvmdsi 6202318
trunc2nr 62900923
usqrt 258537213
vals 2386852221

Generated by: LCOV version 2.0-1