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) Coverage Total Hit
Test: PARI/GP v2.19.0 lcov report (development 31092-e6893b0017) Lines: 96.6 % 1153 1114
Test Date: 2026-08-11 17:02:43 Functions: 97.1 % 70 68
Legend: Lines:     hit not hit

Function Name Sort by function name Hit count Sort by function hit count
addumului 0
pari_kernel_version 0
pari_kernel_close 795
pari_kernel_init 795
sqrispec_fft 1704
incneg 50013
muliispec_fft 83859
muliifft_unspliti 85563
mulliifft_params 85563
resetloop 130695
diviuuexact 150054
muluui 166722
muliifft_spliti 169422
divis 245295
sqrtispec2_sh 271221
convi 323871
Zf_sqr 456960
convi_dac 746496
truncr 1895112
setloop 2248464
sqrtispec1_sh 2714022
sqrtremi 3773061
floorr 4818474
Zf_mul 15385728
muliifft_dis 15757125
remi2n 20446472
diviuexact 22485198
diviuexact_i 29892846
muliifft_dit 31058994
incpos 34965228
incloop 35267727
red_montgomery 36218139
mantissa2nr 50281082
divis_rem 66070935
sqrtr_abs 94950987
xmpn_zero 94950987
sqrtispec2 95738250
p_sqrtu2 96009471
p_sqrtu1 98723493
divri 121880448
divrr 137127270
Zf_add 188282304
Zf_mulsqrt2 188282304
Zf_sub 191720967
Zf_shift 207026949
equaliispec 229626048
absdiviu_rem 242057289
affir 333051711
sqrtispec 338408637
diviiexact 391990968
Zf_red_destroy 400764429
roundr_up_ip 465752063
catii 485340774
adduispec_offset 492592473
addshiftw 728163195
int_normalize 872983863
sqrispec_basecase 943516683
sqrispec 953528937
xmpn_copy 1108174959
shiftispec 1304030820
umodiu 1437168000
subiuspec 1623539522
dvmdii 1706413434
adduispec 2427626756
subiispec 3522888060
cmpiispec 4273981073
addiispec 4697476479
muluispec 4951968729
muliispec_basecase 5266422624
muliispec 5501031261

Generated by: LCOV version 2.0-1