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 30838-aa3635ec72) Lines: 1115 1153 96.7 %
Date: 2026-04-28 09:25:50 Functions: 69 70 98.6 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
Zf_add 188555904
Zf_mul 15406080
Zf_mulsqrt2 188555904
Zf_red_destroy 401280648
Zf_shift 207298173
Zf_sqr 456960
Zf_sub 191999844
absdiviu_rem 234877527
addiispec 4592749134
addshiftw 715855755
adduispec 2393381163
adduispec_offset 492056895
addumului 0
affir 324822609
catii 484811838
cmpiispec 4130376960
convi 319446
convi_dac 739083
diviiexact 389352477
divis 245313
divis_rem 65910132
diviuexact 22347861
diviuexact_i 29646531
diviuuexact 150129
divri 115010592
divrr 136166829
dvmdii 1689198552
equaliispec 227977413
floorr 5201928
incloop 35267391
incneg 50013
incpos 34964892
int_normalize 868875765
mantissa2nr 49458891
muliifft_dis 15777426
muliifft_dit 31099596
muliifft_spliti 169524
muliifft_unspliti 85614
muliispec 5383507380
muliispec_basecase 5154918015
muliispec_fft 83910
mulliifft_params 85614
muluispec 4840503396
muluui 166797
p_sqrtu1 98625567
p_sqrtu2 95913930
pari_kernel_close 795
pari_kernel_init 797
pari_kernel_version 2
red_montgomery 36219024
remi2n 20286087
resetloop 130656
roundr_up_ip 449787568
setloop 2248404
shiftispec 1291365600
sqrispec 1005452730
sqrispec_basecase 995461779
sqrispec_fft 1704
sqrtispec 338048487
sqrtispec1_sh 2711637
sqrtispec2 95642568
sqrtispec2_sh 271362
sqrtr_abs 94856505
sqrtremi 3769617
subiispec 3407602401
subiuspec 1595374638
truncr 2544993
umodiu 1430412456
xmpn_copy 1106973156
xmpn_zero 94856505

Generated by: LCOV version 1.16