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

Generated by: LCOV version 1.16