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 31080-f9bc4fce97) Lines: 96.6 % 1153 1114
Test Date: 2026-07-30 17:02:59 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 240933291
addiispec 4697367249
addshiftw 728132511
adduispec 2427475568
adduispec_offset 492592473
addumului 0
affir 338591274
catii 485340456
cmpiispec 4267003460
convi 323868
convi_dac 751632
diviiexact 392035941
divis 245295
divis_rem 66045348
diviuexact 22493427
diviuexact_i 29919846
diviuuexact 150054
divri 121880439
divrr 141583956
dvmdii 1701372747
equaliispec 229626048
floorr 5424084
incloop 35267727
incneg 50013
incpos 34965228
int_normalize 872983545
mantissa2nr 49675403
muliifft_dis 15757125
muliifft_dit 31058994
muliifft_spliti 169422
muliifft_unspliti 85563
muliispec 5498271075
muliispec_basecase 5263678437
muliispec_fft 83859
mulliifft_params 85563
muluispec 4944794829
muluui 166722
p_sqrtu1 98723427
p_sqrtu2 96009405
pari_kernel_close 795
pari_kernel_init 795
pari_kernel_version 0
red_montgomery 36218139
remi2n 20444030
resetloop 130695
roundr_up_ip 465890690
setloop 2248464
shiftispec 1304955345
sqrispec 953530260
sqrispec_basecase 943518000
sqrispec_fft 1704
sqrtispec 338408379
sqrtispec1_sh 2714022
sqrtispec2 95738151
sqrtispec2_sh 271254
sqrtr_abs 94950981
sqrtremi 3773001
subiispec 3521560173
subiuspec 1623092522
truncr 6223995
umodiu 1437163263
xmpn_copy 1108174221
xmpn_zero 94950981

Generated by: LCOV version 2.0-1