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 30674-be81ecfdd4) Lines: 535 567 94.4 %
Date: 2026-02-09 09:23:39 Functions: 51 52 98.1 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
addmulii 168679970
addmulii_gen 90740074
addmulii_inplace 1578218282
addmulii_lg3 472333883
affrr 1344311247
dblexpo 25895669
dblmantissa 0
dbltor 13385781
div0r 186649
divir 3502232
divrs 9871515
divru 1084330925
divsi 175
divsr 798
divur 2508508
int2n 106490172
int2u 26083539
int2um1 8831
invmod2BIL 60786019
invr 62856485
invr_basecase 62856263
mantissa_real 54189960
modii 3083538431
mul0r 482289
mulii 20958069791
mulir 989017883
mulrr 3958989343
mulrrz_3 652796810
mulrrz_3end 773468479
mulrrz_end 3557606798
mulrrz_i 3711142693
mulrrz_int 53801043
mulsi 615536401
mulsr 117502179
mulss 201179868
mului 1114245904
mulur 929562429
mulur_2 706832324
muluu 4566546680
rtodbl 288678947
shifti 2262628775
sqri 1901852862
sqrr 589258755
sqrs 733599
sqru 627345525
sqrz_i 556410339
truedvmdii 134189608
truedvmdis 131108668
truedvmdsi 6202031
trunc2nr 62690299
usqrt 234400290
vals 2280290841

Generated by: LCOV version 1.16