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-18 17:02:30 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 481860
sqrs 742871
divur 2456243
divir 3278537
truedvmdsi 6202318
dbltor 13604376
divrs 20390063
int2u 25996841
dblexpo 27752009
mulrrz_int 54818641
mantissa_real 56109744
invmod2BIL 61396748
trunc2nr 62904969
invr 64289796
invr_basecase 64289796
addmulii_gen 99935962
int2n 111055597
mulsr 132690516
truedvmdis 139235028
truedvmdii 143827697
addmulii 191199378
mulss 201188893
usqrt 258606513
rtodbl 312596149
addmulii_lg3 496963624
sqrz_i 568885824
sqrr 602897491
mulsi 621503204
sqru 648469856
mulrrz_3 666739026
mulur_2 757904667
mulrrz_3end 789775256
mulur 970991207
mulir 1024546039
divru 1165691316
mului 1168089418
affrr 1422902287
addmulii_inplace 1633027384
sqri 1964354976
shifti 2325392906
vals 2386871210
modii 3155519016
mulrrz_end 3786895221
mulrrz_i 3957546113
mulrr 4206326640
muluu 4811787605
mulii 22012715219

Generated by: LCOV version 2.0-1