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 30672-116f3d5b0e) Lines: 535 567 94.4 %
Date: 2026-02-06 09:23:51 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 186654
mul0r 482285
sqrs 733069
divur 2508519
divir 3502232
truedvmdsi 6202031
divrs 9871398
dbltor 13385870
dblexpo 25896789
int2u 26083705
mulrrz_int 53801019
mantissa_real 54187318
invmod2BIL 60786033
trunc2nr 62685983
invr_basecase 62833686
invr 62834312
addmulii_gen 90709516
int2n 106487245
mulsr 117500280
truedvmdis 131085951
truedvmdii 134164718
addmulii 168698515
mulss 201179592
usqrt 234088081
rtodbl 288679928
addmulii_lg3 472357717
sqrz_i 556413936
sqrr 589279230
mulsi 615502086
sqru 627369197
mulrrz_3 652686531
mulur_2 706869942
mulrrz_3end 773311791
mulur 929658322
mulir 988984558
divru 1084363139
mului 1114104688
affrr 1344371559
addmulii_inplace 1578203249
sqri 1901758824
shifti 2262794417
vals 2280611998
modii 3083791321
mulrrz_end 3557567526
mulrrz_i 3710834667
mulrr 3960598077
muluu 4570774313
mulii 20964073014

Generated by: LCOV version 1.16