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 30548-ec77dc363d) Lines: 535 567 94.4 %
Date: 2025-11-15 09:22:38 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 187461
mul0r 482284
sqrs 731714
divur 2509296
divir 3503625
truedvmdsi 6202031
divrs 9871070
dbltor 13388900
dblexpo 25888453
int2u 26155636
mantissa_real 53608111
mulrrz_int 53800594
invmod2BIL 60744897
trunc2nr 62692975
invr_basecase 62822240
invr 62822754
addmulii_gen 90702575
int2n 105933810
mulsr 117495203
truedvmdis 130839775
truedvmdii 133919336
addmulii 168639353
mulss 201178104
usqrt 231886642
rtodbl 288889765
addmulii_lg3 472684429
sqrz_i 555580977
sqrr 588459318
mulsi 609199578
sqru 626933589
mulrrz_3 652592324
mulur_2 704495574
mulrrz_3end 773206388
mulur 927004103
mulir 985768929
divru 1083488544
mului 1108541178
affrr 1343092197
addmulii_inplace 1581217358
sqri 1911703356
vals 2267620061
shifti 2269158837
modii 3083395483
mulrrz_end 3555463718
mulrrz_i 3709130102
mulrr 3957786614
muluu 4562413676
mulii 20971540405

Generated by: LCOV version 1.16