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 30584-b9873745ba) Lines: 535 567 94.4 %
Date: 2025-12-21 09:21:02 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 186652
mul0r 482307
sqrs 731995
divur 2508492
divir 3502233
truedvmdsi 6202031
divrs 9871285
dbltor 13383931
dblexpo 25891747
int2u 26073095
mantissa_real 53750779
mulrrz_int 53801066
invmod2BIL 60828622
trunc2nr 62677458
invr_basecase 62850554
invr 62850844
addmulii_gen 90734185
int2n 106040561
mulsr 117489245
truedvmdis 131079002
truedvmdii 134162128
addmulii 168677130
mulss 201177746
usqrt 231448010
rtodbl 288689879
addmulii_lg3 472752315
sqrz_i 556302620
sqrr 589154781
mulsi 610667240
sqru 626921049
mulrrz_3 652662714
mulur_2 705266060
mulrrz_3end 773288464
mulur 927806406
mulir 986584327
divru 1083961597
mului 1110054263
affrr 1343666376
addmulii_inplace 1581326696
sqri 1901138523
shifti 2259904164
vals 2275488738
modii 3081374861
mulrrz_end 3557123164
mulrrz_i 3709989855
mulrr 3956844938
muluu 4565758067
mulii 20969880925

Generated by: LCOV version 1.16