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

Generated by: LCOV version 1.16