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 30610-dfc8ed42cd) Lines: 535 567 94.4 %
Date: 2026-01-14 09:22:13 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 186655
mul0r 482292
sqrs 730852
divur 2508484
divir 3502241
truedvmdsi 6202031
divrs 9871282
dbltor 13384703
dblexpo 25892113
int2u 26083083
mulrrz_int 53801027
mantissa_real 54187470
invmod2BIL 60787953
trunc2nr 62677360
invr_basecase 62833121
invr 62833447
addmulii_gen 90708432
int2n 106480437
mulsr 117483007
truedvmdis 131070508
truedvmdii 134152940
addmulii 168686439
mulss 201177570
usqrt 231859796
rtodbl 288617289
addmulii_lg3 472297269
sqrz_i 556250764
sqrr 589188820
mulsi 612413286
sqru 626809149
mulrrz_3 652486373
mulur_2 705964181
mulrrz_3end 773025767
mulur 928588671
mulir 987950855
divru 1083767525
mului 1112278075
affrr 1343640031
addmulii_inplace 1578017955
sqri 1900078075
shifti 2261634655
vals 2276765024
modii 3080537167
mulrrz_end 3557518041
mulrrz_i 3709779380
mulrr 3959124439
muluu 4565024385
mulii 20966019792

Generated by: LCOV version 1.16