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 - ifactor1.c (source / functions) Hit Total Coverage
Test: PARI/GP v2.18.1 lcov report (development 30786-ffec283a2b) Lines: 1882 2319 81.2 %
Date: 2026-04-07 09:25:56 Functions: 112 127 88.2 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
COPY 0
ECM_alloc 75
ECM_init 75
ECM_loop 129
FpE_add_i 11165508
INIT 51698
SHALLOWCOPY 0
STORE 765826
STOREi 27798
STOREu 737876
ZV_aff 35508
Z_ECM 0
Z_factor 10196523
Z_factor_limit 55360
Z_factor_primes 163138
Z_factor_until 3045
Z_has_prime_3mod4 61152
Z_has_prime_3mod4_i 61152
Z_issmooth 0
Z_issmooth_fact 175558
Z_oddprimedivisors_fast 141543
Z_oddprimedivisors_gcd 164271
Z_pollardbrent 0
Z_pval_inplace 762
Z_to_Up 14
Zn_ispower 756
Zp_ispower 798
absZ_factor 3896329
absZ_factor_limit 288152
absZ_factor_limit_strict 897936
aux_end 142979
check_res 3921128
core 710978
core_init_from_squarefree 327
coreu 64436
coreu_fact 0
coreu_init_from_squarefree 247
diviiexact_inplace 1838
dvdii_inplace 231
ecm_elladd 324077
ecm_elladd0 332229
ecm_elladd2 9966
elldouble 55433
ellfacteur 3286
ellmult 35508
factorint 10290
factoru 3798493
factoru_is_2357_power 1071
factoru_is_2357_power_special 6
factoru_primes 1086330
factoru_result 18544812
factoru_sign 19003441
get_rule 288305
ifac_GC 0
ifac_check 0
ifac_checkprime 11262
ifac_core 353
ifac_crack 5791
ifac_decomp 2600
ifac_defrag 14
ifac_delete 45761
ifac_divide 9791
ifac_factor_dbg 0
ifac_factoru 807
ifac_find 15213
ifac_insert_multiplet 3297
ifac_ispowerful 7
ifac_isprime 28058
ifac_main 14133
ifac_moebius 236
ifac_moebiusu 663
ifac_next 6477
ifac_print 0
ifac_read 760
ifac_realloc 0
ifac_resort 7
ifac_skip 320
ifac_sort_one 7
ifac_start 2523
ifac_start_hint 5930
ifac_whoiswho 5796
ifactor 10262214
ifactor_sign 15347518
is_357_power 2796809
is_kth_power 417979
is_pth_power 64313
ispowerful 1708
matsmalltrunc_append 154826407
matsmalltrunc_init 63223510
maxomegaoddu 5119
maxomegau 71839
moebius 56617
moebiusu 2480408
moebiusu_fact 54194
nextprime 130788
nextprime0 119154
one_iter 36741318
pollardbrent 3525
pollardbrent_i 838
precprime 56
radicalu 0
rho_dbg 0
snextpr 6162411
special_primes 36103
squfof 5093
squfof_ambig 2007
tridiv_bound 911541
tridiv_boundu 4715457
u_357_divides 16843148
u_forprime_next_fast 144833893
u_oddprimedivisors_gcd 942713
uis_357_power 2366983
uis_357_powermod 2417925
uis_357_powermod_32bit_1 13731
uis_357_powermod_32bit_2 837
uisprime_nosmall 8605
unextprime 1138221
unextprime_overflow 1000246
update_pow 908
uprecprime 38
vecfactoroddu 0
vecfactoroddu_i 5119
vecfactorsquarefreeu 7014
vecfactorsquarefreeu_coprime 32676
vecfactoru 0
vecfactoru_i 32072
vecsquarefreeu 49

Generated by: LCOV version 1.16