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
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 271254
convi 323868
Zf_sqr 456960
convi_dac 751632
setloop 2248464
sqrtispec1_sh 2714022
sqrtremi 3773001
floorr 5424084
truncr 6223995
Zf_mul 15385728
muliifft_dis 15757125
remi2n 20444030
diviuexact 22493427
diviuexact_i 29919846
muliifft_dit 31058994
incpos 34965228
incloop 35267727
red_montgomery 36218139
mantissa2nr 49675403
divis_rem 66045348
sqrtr_abs 94950981
xmpn_zero 94950981
sqrtispec2 95738151
p_sqrtu2 96009405
p_sqrtu1 98723427
divri 121880439
divrr 141583956
Zf_add 188282304
Zf_mulsqrt2 188282304
Zf_sub 191720967
Zf_shift 207026949
equaliispec 229626048
absdiviu_rem 240933291
sqrtispec 338408379
affir 338591274
diviiexact 392035941
Zf_red_destroy 400764429
roundr_up_ip 465890690
catii 485340456
adduispec_offset 492592473
addshiftw 728132511
int_normalize 872983545
sqrispec_basecase 943518000
sqrispec 953530260
xmpn_copy 1108174221
shiftispec 1304955345
umodiu 1437163263
subiuspec 1623092522
dvmdii 1701372747
adduispec 2427475568
subiispec 3521560173
cmpiispec 4267003460
addiispec 4697367249
muluispec 4944794829
muliispec_basecase 5263678437
muliispec 5498271075

Generated by: LCOV version 2.0-1