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 30735-65f72320ad) Lines: 535 567 94.4 %
Date: 2026-03-14 09:23:49 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 186614
mul0r 482300
sqrs 733541
divur 2508895
divir 3502452
truedvmdsi 6202031
divrs 9872718
dbltor 13444152
int2u 25348396
dblexpo 25896608
mulrrz_int 53799215
mantissa_real 54189541
invmod2BIL 60801851
trunc2nr 62725701
invr_basecase 62812873
invr 62812919
addmulii_gen 90640648
int2n 106469666
mulsr 117524896
truedvmdis 138739818
truedvmdii 141823117
addmulii 168737633
mulss 201180157
usqrt 253163562
rtodbl 288772465
addmulii_lg3 475497341
sqrz_i 556515877
sqrr 589324075
mulsi 617446966
sqru 635653879
mulrrz_3 652980555
mulur_2 715959102
mulrrz_3end 773732265
mulur 938724753
mulir 988560290
divru 1093662811
mului 1115010732
affrr 1344368256
addmulii_inplace 1617879406
sqri 2061309957
shifti 2278611148
vals 2313544007
modii 3090023102
mulrrz_end 3557287026
mulrrz_i 3712347924
mulrr 3959299539
muluu 4653084616
mulii 21135361039

Generated by: LCOV version 1.16