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 31041-bd73e9fcdd) Lines: 95.9 % 952 913
Test Date: 2026-07-22 22:45:42 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 147
QXk_gcd 189
polcyclofactors 322
chk_factors_get 350
BD_odd 420
QX_factor 805
poliscycloprod 1029
LLL_check_progress 1694
myconcat 2317
BD 2366
QX_gcd 19369
_gcd 19558
invphi 19655
ZX_factor 38757
fact_from_DDF 39555
ZX_factor_i 39562
cmbf 51730
cmbf_precs 51730
combine_factors 51730
Beauzamy_bound 62421
Mignotte_bound 62421
factor_bound 62421
poliscyclo 99213
ZX_is_irred 103069
root_bound 112919
ZX_gcd_chinese 116603
ZX_gcd_filter 122808
ZX_DDF 155281
shifteval 186379
ZX_is_squarefree 199443
ZX_DDF_max 210246
ZX_squff 322307
ZXk_gcd 1686049
rec 1714007
DDF_roots 1878324
nfrootsQ 1878328
pick_prime 2088568
ZXkX_ZXk_divexact 2527823
ZXk_divexact_i 2529108
ZXkX_ZXk_divexact_s 2570537
ZXk_divides_i 2789701
ZX_radical 3170174
centeri2n 3214092
ZXkX_ZXk_divides_s 3262477
ZX_gcd_slice 3356783
ZX_gcd_worker 3356783
ZX_gcd_Flx 3368485
ZXk_content_shallow 3444534
dividesii 3479688
ZXk_center2n 4909872
ZXk_renormalize 4958257
ZXk_divides 6217701
ZX_divides 6557258
ZX_divides_i 6587891
ZXk_divexact_s 7582948
ZXk_gcd_i 8688143
ZXk_divides_s 10118541
ZX_gcd 10623691
ZX_gcd_all 14446251

Generated by: LCOV version 2.0-1