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

Generated by: LCOV version 1.16