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-01 17:01:49 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 481871
sqrs 742871
divur 2456242
divir 3278537
truedvmdsi 6202318
dbltor 13604262
divrs 20389987
int2u 25997219
dblexpo 27751990
mulrrz_int 54818641
mantissa_real 56112433
invmod2BIL 61396745
trunc2nr 62901090
invr 64288983
invr_basecase 64288983
addmulii_gen 99946497
int2n 111056497
mulsr 132689146
truedvmdis 139262868
truedvmdii 143856850
addmulii 191223578
mulss 201188997
usqrt 258492373
rtodbl 312598252
addmulii_lg3 497000192
sqrz_i 568882996
sqrr 602894700
mulsi 621541694
sqru 648482844
mulrrz_3 666678558
mulur_2 757909050
mulrrz_3end 789707391
mulur 971001284
mulir 1024555598
divru 1165694584
mului 1167972789
affrr 1422899216
addmulii_inplace 1633073708
sqri 1963792446
shifti 2325327898
vals 2386818007
modii 3155153237
mulrrz_end 3787018436
mulrrz_i 3957604291
mulrr 4206319002
muluu 4812177210
mulii 22013176312

Generated by: LCOV version 2.0-1