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 30773-2078653b96) Lines: 535 567 94.4 %
Date: 2026-04-01 09:27:34 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 186608
mul0r 482293
sqrs 733151
divur 2524355
divir 3517211
truedvmdsi 6202031
divrs 9999020
dbltor 13463218
int2u 25349630
dblexpo 27267419
mulrrz_int 53799215
mantissa_real 54196082
invmod2BIL 60820375
trunc2nr 62832733
invr_basecase 65135214
invr 65135615
addmulii_gen 90682348
int2n 108505446
mulsr 120380014
truedvmdis 138828794
truedvmdii 141911962
addmulii 168737252
mulss 201178452
usqrt 251675408
rtodbl 295564170
addmulii_lg3 475502811
sqrz_i 561864446
sqrr 595426898
mulsi 617813345
sqru 640063196
mulrrz_3 658420647
mulur_2 722794923
mulrrz_3end 779191728
mulur 945228702
mulir 994863191
mului 1112123132
divru 1117515342
affrr 1378675267
addmulii_inplace 1617753120
sqri 2077042901
shifti 2286349711
vals 2316333271
modii 3123649393
mulrrz_end 3638846332
mulrrz_i 3790339339
mulrr 4039719588
muluu 4650682135
mulii 21154908128

Generated by: LCOV version 1.16