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 30816-9c15a02229) Lines: 535 567 94.4 %
Date: 2026-04-15 09:25:30 Functions: 51 52 98.1 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
addmulii 168765266
addmulii_gen 90689772
addmulii_inplace 1617939093
addmulii_lg3 475530066
affrr 1378673662
dblexpo 27268398
dblmantissa 0
dbltor 13463867
div0r 186544
divir 3517872
divrs 10000421
divru 1117474220
divsi 175
divsr 798
divur 2525088
int2n 108711987
int2u 25350412
int2um1 8831
invmod2BIL 60812208
invr 65149915
invr_basecase 65148881
mantissa_real 54200550
modii 3125022257
mul0r 481890
mulii 21157957916
mulir 994405937
mulrr 4039757115
mulrrz_3 658581330
mulrrz_3end 779489457
mulrrz_end 3639981580
mulrrz_i 3792887155
mulrrz_int 53799215
mulsi 617841990
mulsr 120385014
mulss 201178785
mului 1112365410
mulur 944902684
mulur_2 722386917
muluu 4652168317
rtodbl 295543692
shifti 2287455309
sqri 2078528661
sqrr 595545117
sqrs 733358
sqru 639713969
sqrz_i 562043250
truedvmdii 141918474
truedvmdis 138828267
truedvmdsi 6202318
trunc2nr 62832059
usqrt 250681692
vals 2318223615

Generated by: LCOV version 1.16