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 30364-8108102770) Lines: 535 567 94.4 %
Date: 2025-06-30 09:21: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 187461
mul0r 482302
sqrs 1514417
divur 2493713
divir 3494603
truedvmdsi 6202031
divrs 9961924
dbltor 13374495
int2u 25996868
dblexpo 26510928
mantissa_real 53502362
mulrrz_int 55651436
invmod2BIL 60593133
trunc2nr 62677222
invr_basecase 63121319
invr 63122372
addmulii_gen 90741001
int2n 106752855
mulsr 118058996
truedvmdis 130841861
truedvmdii 133926498
addmulii 168621940
mulss 201148667
usqrt 230090425
rtodbl 289984209
addmulii_lg3 472218103
sqrz_i 560418615
sqrr 593306493
mulsi 604465269
sqru 616607051
mulrrz_3 653986149
mulur_2 703976381
mulrrz_3end 774534299
mulur 922349722
mului 936808280
mulir 980978946
divru 1112595287
affrr 1378699086
addmulii_inplace 1575334041
sqri 1900205096
vals 2249605549
shifti 2257186529
modii 3077059154
mulrrz_end 3580880303
mulrrz_i 3730723296
mulrr 3976829309
muluu 4570275307
mulii 21091876066

Generated by: LCOV version 1.16