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 30571-c0dfe82732) Lines: 535 567 94.4 %
Date: 2025-12-11 09:22:11 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 187466
mul0r 482320
sqrs 731336
divur 2509417
divir 3503676
truedvmdsi 6202031
divrs 9872194
dbltor 13389755
dblexpo 25894274
int2u 26159328
mantissa_real 53765192
mulrrz_int 53801120
invmod2BIL 60843941
trunc2nr 62691993
invr_basecase 62867319
invr 62868351
addmulii_gen 90753923
int2n 106079479
mulsr 117501261
truedvmdis 131108847
truedvmdii 134195651
addmulii 168708259
mulss 201178054
usqrt 231411745
rtodbl 288953853
addmulii_lg3 472852770
sqrz_i 556331981
sqrr 589193005
mulsi 610716608
sqru 627029059
mulrrz_3 652634659
mulur_2 705582031
mulrrz_3end 773317319
mulur 928249454
mulir 986978146
divru 1083888737
mului 1108411394
affrr 1343565854
addmulii_inplace 1581535089
sqri 1912019471
vals 2268198989
shifti 2269883246
modii 3083805517
mulrrz_end 3557206154
mulrrz_i 3710450026
mulrr 3956736263
muluu 4568380253
mulii 20988639314

Generated by: LCOV version 1.16