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 30318-7d854b8994) Lines: 1115 1153 96.7 %
Date: 2025-06-06 09:19:58 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 399271983
Zf_shift 206264028
Zf_sqr 448896
Zf_sub 191070978
absdiviu_rem 278887566
addiispec 4577516769
addshiftw 705719532
adduispec 2391500283
adduispec_offset 491942892
addumului 0
affir 320922615
catii 471188562
cmpiispec 4099732326
convi 317058
convi_dac 736386
diviiexact 390960147
divis 721926
divis_rem 65071677
diviuexact 28476723
diviuexact_i 29515005
diviuuexact 149898
divri 114000993
divrr 129587907
dvmdii 1673460051
equaliispec 198578778
floorr 5246127
incloop 35257065
incneg 50013
incpos 34954581
int_normalize 854073741
mantissa2nr 48737058
muliifft_dis 15702102
muliifft_dit 30956967
muliifft_spliti 168921
muliifft_unspliti 85290
muliispec 5458183938
muliispec_basecase 5231224935
muliispec_fft 83631
mulliifft_params 85290
muluispec 4838397663
muluui 166566
p_sqrtu1 94999917
p_sqrtu2 92297643
pari_kernel_close 786
pari_kernel_init 788
pari_kernel_version 2
red_montgomery 37062864
remi2n 19718364
resetloop 130656
roundr_up_ip 446525884
setloop 2247126
shiftispec 1277282424
sqrispec 939844401
sqrispec_basecase 929905326
sqrispec_fft 1659
sqrtispec 327617106
sqrtispec1_sh 2702274
sqrtispec2 92022825
sqrtispec2_sh 274818
sqrtr_abs 91236660
sqrtremi 3763812
subiispec 3383533662
subiuspec 1587427368
truncr 2621877
umodiu 1408065660
xmpn_copy 1074445551
xmpn_zero 91236660

Generated by: LCOV version 1.16