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 - QX_factor.c (source / functions) Coverage Total Hit
Test: PARI/GP v2.18.1 lcov report (development 31053-95e3b72995) Lines: 95.9 % 952 913
Test Date: 2026-07-24 17:03:07 Functions: 95.3 % 64 61
Legend: Lines:     hit not hit

Function Name Sort by function name Hit count Sort by function hit count
BD_deg1 0
Rg_is_QXk 0
ZXk_divexact 0
next2pow 14
chk_factors 140
LLL_cmbf 161
QXk_gcd 189
polcyclofactors 322
chk_factors_get 350
BD_odd 420
QX_factor 805
poliscycloprod 1029
LLL_check_progress 1736
myconcat 2317
BD 2366
QX_gcd 19367
_gcd 19556
invphi 19657
ZX_factor 38764
fact_from_DDF 39562
ZX_factor_i 39569
cmbf 51744
cmbf_precs 51744
combine_factors 51744
Beauzamy_bound 62435
Mignotte_bound 62435
factor_bound 62435
poliscyclo 99218
ZX_is_irred 103076
root_bound 112947
ZX_gcd_chinese 116603
ZX_gcd_filter 122808
ZX_DDF 155291
shifteval 186409
ZX_is_squarefree 199469
ZX_DDF_max 210269
ZX_squff 322314
ZXk_gcd 1686049
rec 1714007
DDF_roots 1878452
nfrootsQ 1878452
pick_prime 2088721
ZXkX_ZXk_divexact 2527823
ZXk_divexact_i 2529108
ZXkX_ZXk_divexact_s 2570537
ZXk_divides_i 2789701
ZX_radical 3170438
centeri2n 3214092
ZXkX_ZXk_divides_s 3262477
ZX_gcd_slice 3356783
ZX_gcd_worker 3356783
ZX_gcd_Flx 3368484
ZXk_content_shallow 3444534
dividesii 3479688
ZXk_center2n 4909872
ZXk_renormalize 4958257
ZXk_divides 6217701
ZX_divides 6557256
ZX_divides_i 6587889
ZXk_divexact_s 7582948
ZXk_gcd_i 8688143
ZXk_divides_s 10118541
ZX_gcd 10623724
ZX_gcd_all 14446680

Generated by: LCOV version 2.0-1