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

Generated by: LCOV version 1.16