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) Hit Total Coverage
Test: PARI/GP v2.18.1 lcov report (development 30735-65f72320ad) Lines: 535 567 94.4 %
Date: 2026-03-10 09:24:00 Functions: 51 52 98.1 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
dblmantissa 0
divsi 175
divsr 798
int2um1 8831
div0r 186611
mul0r 482264
sqrs 734799
divur 2508889
divir 3502442
truedvmdsi 6202031
divrs 9872758
dbltor 13443894
int2u 25348096
dblexpo 25896262
mulrrz_int 53799215
mantissa_real 54193414
invmod2BIL 60801836
trunc2nr 62723865
invr_basecase 62821684
invr 62822325
addmulii_gen 90645397
int2n 106469197
mulsr 117522767
truedvmdis 138746172
truedvmdii 141833474
addmulii 168734340
mulss 201181184
usqrt 253166274
rtodbl 288814643
addmulii_lg3 475510189
sqrz_i 556513468
sqrr 589352716
mulsi 617452781
sqru 635648301
mulrrz_3 652972621
mulur_2 716168985
mulrrz_3end 773693127
mulur 938882543
mulir 988732182
divru 1093689088
mului 1116168085
affrr 1344282170
addmulii_inplace 1617896966
sqri 2061429872
shifti 2278379692
vals 2313526550
modii 3090533251
mulrrz_end 3557655789
mulrrz_i 3712226153
mulrr 3959510111
muluu 4651578168
mulii 21134718410

Generated by: LCOV version 1.16