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 30604-e5d817ee12) Lines: 535 567 94.4 %
Date: 2026-01-09 09:21:43 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 186651
mul0r 482294
sqrs 731003
divur 2508489
divir 3502235
truedvmdsi 6202031
divrs 9871348
dbltor 13384815
dblexpo 25894184
int2u 26082836
mulrrz_int 53801003
mantissa_real 54185984
invmod2BIL 60787921
trunc2nr 62679125
invr_basecase 62845292
invr 62845675
addmulii_gen 90725472
int2n 106477252
mulsr 117476830
truedvmdis 131090063
truedvmdii 134169793
addmulii 168688039
mulss 201177262
usqrt 231743041
rtodbl 288639750
addmulii_lg3 472314793
sqrz_i 556311103
sqrr 589183541
mulsi 612446854
sqru 626843737
mulrrz_3 652561791
mulur_2 705900328
mulrrz_3end 773135377
mulur 928528896
mulir 987773205
divru 1083659071
mului 1112029785
affrr 1343669903
addmulii_inplace 1578161435
sqri 1899851717
shifti 2261672727
vals 2277004469
modii 3079695635
mulrrz_end 3557378498
mulrrz_i 3709999734
mulrr 3957355766
muluu 4566922882
mulii 20969391212

Generated by: LCOV version 1.16