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 30550-07450a7a86) Lines: 535 567 94.4 %
Date: 2025-11-19 09:22:25 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 187451
mul0r 482280
sqrs 731031
divur 2509312
divir 3503621
truedvmdsi 6202031
divrs 9871066
dbltor 13389125
dblexpo 25890028
int2u 26156340
mantissa_real 53605842
mulrrz_int 53800761
invmod2BIL 60743990
trunc2nr 62692873
invr_basecase 62815489
invr 62815751
addmulii_gen 90698329
int2n 105933149
mulsr 117490107
truedvmdis 130847030
truedvmdii 133926611
addmulii 168631280
mulss 201177892
usqrt 231615708
rtodbl 288882061
addmulii_lg3 472660168
sqrz_i 555594109
sqrr 588487091
mulsi 609183006
sqru 626942259
mulrrz_3 652508098
mulur_2 704351412
mulrrz_3end 773092947
mulur 926876493
mulir 985579644
divru 1083535062
mului 1106297725
affrr 1343031279
addmulii_inplace 1581079808
sqri 1911712940
vals 2267337422
shifti 2268957704
modii 3081960445
mulrrz_end 3555361410
mulrrz_i 3708734536
mulrr 3957312745
muluu 4561861571
mulii 20968298969

Generated by: LCOV version 1.16