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-11-14 17:03: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 191217160
addmulii_gen 99947884
addmulii_inplace 1633054843
addmulii_lg3 496983344
affrr 1422917036
dblexpo 27752028
dblmantissa 0
dbltor 13604405
div0r 0
divir 3278537
divrs 20390052
divru 1165692979
divsi 175
divsr 798
divur 2456242
int2n 111054553
int2u 25996519
int2um1 8807
invmod2BIL 61396721
invr 64289884
invr_basecase 64289884
mantissa_real 56113511
modii 3154844337
mul0r 481860
mulii 22012987654
mulir 1024555833
mulrr 4206240030
mulrrz_3 666716256
mulrrz_3end 789749016
mulrrz_end 3787021516
mulrrz_i 3957642113
mulrrz_int 54818665
mulsi 621548462
mulsr 132688641
mulss 201188849
mului 1168020638
mulur 971000442
mulur_2 757909679
muluu 4811917472
rtodbl 312597251
shifti 2325280370
sqri 1964122850
sqrr 602900057
sqrs 742871
sqru 648479258
sqrz_i 568889875
truedvmdii 143877409
truedvmdis 139283451
truedvmdsi 6202318
trunc2nr 62904475
usqrt 258178894
vals 2386747070

Generated by: LCOV version 2.0-1