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 30711-c92306d4b4) Lines: 535 567 94.4 %
Date: 2026-02-25 09:24:21 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 186655
mul0r 482295
sqrs 734649
divur 2508513
divir 3502240
truedvmdsi 6202031
divrs 9871406
dbltor 13437791
int2u 25347742
dblexpo 25896125
mulrrz_int 53801019
mantissa_real 54193118
invmod2BIL 60803515
trunc2nr 62685436
invr_basecase 62866717
invr 62866966
addmulii_gen 90751292
int2n 106488890
mulsr 117499662
truedvmdis 138795799
truedvmdii 141883308
addmulii 168707029
mulss 201181371
usqrt 252433918
rtodbl 288810797
addmulii_lg3 475424795
sqrz_i 556507225
sqrr 589283518
mulsi 617597316
sqru 635590182
mulrrz_3 652900715
mulur_2 716533664
mulrrz_3end 773587900
mulur 939323250
mulir 989173823
divru 1093958708
mului 1116755238
affrr 1344599066
addmulii_inplace 1618022539
sqri 1934883395
shifti 2277457325
vals 2313643551
modii 3091431101
mulrrz_end 3558030275
mulrrz_i 3712468674
mulrr 3959864855
muluu 4656822051
mulii 21099003226

Generated by: LCOV version 1.16