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) Coverage Total Hit
Test: PARI/GP v2.18.1 lcov report (development 31042-0fbe168e69) Lines: 93.9 % 558 524
Test Date: 2026-07-23 17:04:59 Functions: 93.4 % 76 71
Legend: Lines:     hit not hit

Function Name Sort by function name Hit count Sort by function hit count
RgV_is_ZV0 707973
RgV_is_ZVnon0 22868
RgV_is_ZVpos 16423716
RgV_is_prV 324002
Z_issquarefree 2214
Z_issquarefree_fact 2814
Z_lsmoothen 19467
Z_smoothen 82270
_mod4 8799
arith_n 62173
bigomega 1589
bigomegau 842
boundfact 84
check_arith_all 2903762
check_arith_non0 2743652
check_arith_pos 630
clean_Z_factor 26474
cmpi1 16646
cmpu1 1750
core0 3101
core2 57798
core2_i 57882
core2fa 0
core2partial 0
coredisc 8715
coredisc0 56
coredisc2 84
coredisc2_fact 181603
coredisc2u_fact 7273
corediscs 56
corefa 0
corepartial 0
divisors 354080
divisors0 784
divisors_factored 12453
divisors_init 366582
divisorsu 162819
divisorsu_fact 45858806
divisorsu_fact_factored 357
divisorsu_moebius 25109
euler_sumdiv 18679
eulerphi 150920
eulerphiu 224032
eulerphiu_fact 635694
fa_clean 24171
fa_clean_u 1540
factor_pn_1 7490
factor_pn_1_limit 7490
factorlim 16471
factoru_pow 141632
fuse_Z_factor 0
is_Z_factor 707973
is_Z_factor_i 8540109
is_Z_factornon0 14462
is_Z_factorpos 7817674
is_nf_extfactor 14
is_nf_factor 273812
issquarefree 6392
ndiv 366869
numdiv 1589
numdiv_aux 760
numdivu 815
numdivu_fact 45862505
omega 1589
omegau 815
set_fact 3885
set_fact_check 362690
sumdiv 3017
sumdiv_aux 1474
sumdivk 7987
sumdivk_aux 1506
u_euler_sumdiv 71628
uissquarefree 2530305
uissquarefree_fact 2989
usumdiv_fact 43641
usumdivk_fact 9792

Generated by: LCOV version 2.0-1