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) Hit Total Coverage
Test: PARI/GP v2.18.1 lcov report (development 30640-c2c58e18c5) Lines: 913 954 95.7 %
Date: 2026-01-27 08:51:18 Functions: 61 64 95.3 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
BD_deg1 0
Rg_is_QXk 0
ZXk_divexact 0
next2pow 14
LLL_cmbf 112
chk_factors 140
QXk_gcd 189
polcyclofactors 315
chk_factors_get 350
BD_odd 406
QX_factor 805
poliscycloprod 1029
LLL_check_progress 1477
myconcat 2310
BD 2359
invphi 16542
QX_gcd 18958
_gcd 19148
ZX_factor 25560
fact_from_DDF 26358
ZX_factor_i 26365
cmbf 40560
cmbf_precs 40560
combine_factors 40560
Beauzamy_bound 48176
Mignotte_bound 48176
factor_bound 48176
poliscyclo 56776
ZX_is_irred 81387
ZX_gcd_chinese 84207
ZX_gcd_filter 90344
root_bound 100832
ZX_DDF 115586
ZX_is_squarefree 137369
ZX_DDF_max 151194
shifteval 168245
ZX_squff 308634
ZXk_gcd 1686070
rec 1714462
DDF_roots 1800727
nfrootsQ 1800727
pick_prime 1951921
ZXkX_ZXk_divexact 2528117
ZXk_divexact_i 2529297
ZXkX_ZXk_divexact_s 2571356
ZXk_divides_i 2789715
ZX_radical 2978915
centeri2n 3214547
ZXkX_ZXk_divides_s 3264990
ZX_gcd_slice 3280585
ZX_gcd_worker 3280585
ZX_gcd_Flx 3292214
ZXk_content_shallow 3445416
dividesii 3481592
ZXk_center2n 4910922
ZXk_renormalize 4961365
ZXk_divides 6218618
ZX_divides 6467706
ZX_divides_i 6491060
ZXk_divexact_s 7584530
ZXk_gcd_i 8689753
ZXk_divides_s 10123525
ZX_gcd 10515554
ZX_gcd_all 14118981

Generated by: LCOV version 1.16