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 30480-572da319a6) Lines: 535 567 94.4 %
Date: 2025-08-22 09:24:07 Functions: 51 52 98.1 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
addmulii 168639338
addmulii_gen 90721985
addmulii_inplace 1581235586
addmulii_lg3 472699840
affrr 1379071256
dblexpo 26464026
dblmantissa 0
dbltor 13386633
div0r 187459
divir 3501375
divrs 9865289
divru 1112914779
divsi 175
divsr 798
divur 2506940
int2n 105907995
int2u 26154346
int2um1 8831
invmod2BIL 60744265
invr 63096758
invr_basecase 63096568
mantissa_real 53598408
modii 3081176932
mul0r 482280
mulii 20970738509
mulir 987337890
mulrr 3995796693
mulrrz_3 653959565
mulrrz_3end 774401611
mulrrz_end 3600019801
mulrrz_i 3747412221
mulrrz_int 55660756
mulsi 609232720
mulsr 118133952
mulss 201179091
mului 1105488752
mulur 928489034
mulur_2 706515914
muluu 4562763404
rtodbl 289715301
shifti 2269537262
sqri 1911699584
sqrr 594034355
sqrs 731539
sqru 627151869
sqrz_i 561069910
truedvmdii 133950794
truedvmdis 130869728
truedvmdsi 6202031
trunc2nr 62690754
usqrt 231651784
vals 2266368681

Generated by: LCOV version 1.16