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-12 17:02:34 Functions: 97.1 % 70 68
Legend: Lines:     hit not hit

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

Generated by: LCOV version 2.0-1