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

Generated by: LCOV version 1.16