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 - basemath - arith2.c (source / functions) Hit Total Coverage
Test: PARI/GP v2.18.1 lcov report (development 30712-26d8f09ef9) Lines: 524 558 93.9 %
Date: 2026-02-26 09:24:10 Functions: 71 76 93.4 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
core2fa 0
core2partial 0
corefa 0
corepartial 0
fuse_Z_factor 0
is_nf_extfactor 14
coredisc0 56
corediscs 56
boundfact 84
coredisc2 84
divisorsu_fact_factored 357
check_arith_pos 630
numdiv_aux 760
divisors0 784
numdivu 815
omegau 815
bigomegau 835
sumdiv_aux 1474
sumdivk_aux 1506
fa_clean_u 1540
bigomega 1589
numdiv 1589
omega 1589
cmpu1 1750
Z_issquarefree 2214
Z_issquarefree_fact 2814
uissquarefree_fact 2940
sumdiv 3017
core0 3101
set_fact 3647
issquarefree 6392
coredisc2u_fact 7249
factor_pn_1 7490
factor_pn_1_limit 7490
sumdivk 7987
coredisc 8533
_mod4 8617
usumdivk_fact 9792
divisors_factored 12453
is_Z_factornon0 14461
factorlim 16471
cmpi1 16646
euler_sumdiv 18679
Z_lsmoothen 19460
RgV_is_ZVnon0 22867
fa_clean 24171
divisorsu_moebius 26103
clean_Z_factor 26473
usumdiv_fact 43641
core2 54578
core2_i 54662
arith_n 58953
u_euler_sumdiv 71628
Z_smoothen 82179
factoru_pow 141543
eulerphi 150920
divisorsu 162751
coredisc2_fact 181595
eulerphiu 223976
is_nf_factor 273766
RgV_is_prV 323999
divisors 353807
set_fact_check 362655
divisors_init 366309
ndiv 366596
eulerphiu_fact 635589
RgV_is_ZV0 707764
is_Z_factor 707767
uissquarefree 2466195
check_arith_non0 2631137
check_arith_all 2900113
is_Z_factorpos 7783466
is_Z_factor_i 8505690
RgV_is_ZVpos 16355065
divisorsu_fact 39556499
numdivu_fact 39658223

Generated by: LCOV version 1.16