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.c (source / functions) Hit Total Coverage
Test: PARI/GP v2.18.1 lcov report (development 30480-572da319a6) Lines: 1115 1153 96.7 %
Date: 2025-08-25 09:24:04 Functions: 69 70 98.6 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
Zf_add 187658496
Zf_mul 15338496
Zf_mulsqrt2 187658496
Zf_red_destroy 399271821
Zf_shift 206264025
Zf_sqr 448896
Zf_sub 191070960
absdiviu_rem 233503437
addiispec 4590935595
addshiftw 708040275
adduispec 2399735562
adduispec_offset 491224647
addumului 0
affir 323161080
catii 475607610
cmpiispec 4131994191
convi 317605
convi_dac 737271
diviiexact 396797913
divis 240030
divis_rem 65816856
diviuexact 22434063
diviuexact_i 29602416
diviuuexact 149898
divri 114245811
divrr 130340583
dvmdii 1686396945
equaliispec 200367168
floorr 5348343
incloop 35265993
incneg 50013
incpos 34963494
int_normalize 857661492
mantissa2nr 49147554
muliifft_dis 15702102
muliifft_dit 30956967
muliifft_spliti 168921
muliifft_unspliti 85290
muliispec 5395636752
muliispec_basecase 5168622201
muliispec_fft 83631
mulliifft_params 85290
muluispec 4850622864
muluui 166566
p_sqrtu1 95743683
p_sqrtu2 93010317
pari_kernel_close 786
pari_kernel_init 788
pari_kernel_version 2
red_montgomery 40617075
remi2n 20034210
resetloop 130656
roundr_up_ip 449031805
setloop 2248389
shiftispec 1289482338
sqrispec 951596058
sqrispec_basecase 941656710
sqrispec_fft 1659
sqrtispec 330542979
sqrtispec1_sh 2733366
sqrtispec2 92739174
sqrtispec2_sh 271143
sqrtr_abs 91951701
sqrtremi 3792537
subiispec 3401416104
subiuspec 1597467930
truncr 2698983
umodiu 1431816489
xmpn_copy 1084354125
xmpn_zero 91951701

Generated by: LCOV version 1.16