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

Generated by: LCOV version 1.16