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 - bb_group.c (source / functions) Coverage Total Hit
Test: PARI/GP v2.18.1 lcov report (development 31053-95e3b72995) Lines: 94.4 % 586 553
Test Date: 2026-07-24 17:03:07 Functions: 100.0 % 37 37
Legend: Lines:     hit not hit

Function Name Sort by function name Hit count Sort by function hit count
d2_multiple 146671
gen_PH_log 5022002
gen_Pollard_log 49
gen_Shanks 768407
gen_Shanks_init 763031
gen_Shanks_log 1548880
gen_Shanks_sqrtl 88753
gen_Shanks_sqrtn 91467
gen_ellgens 2716
gen_ellgroup 146832
gen_factored_order 5488
gen_gener 15883
gen_lgener 124376
gen_order 4418687
gen_plog 6088391
gen_pow 12042851
gen_pow_fold 534897
gen_pow_fold_i 687600
gen_pow_i 39710798
gen_pow_init 147
gen_pow_table 53331
gen_powers 28567277
gen_powu 215971
gen_powu_fold 215440
gen_powu_fold_i 1273477
gen_powu_i 111550478
gen_product 62396028
gen_select_order 973
get_arith_Z 1425290
get_arith_ZZM 11845385
int_block 8045715
iter_rho 67659126
leftright_binary_powu 99058037
producttree_scheme 59885716
rec_order 13153402
sliding_window_pow 221089
sliding_window_powu 9354700

Generated by: LCOV version 2.0-1