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 - subfield.c (source / functions) Hit Total Coverage
Test: PARI/GP v2.18.1 lcov report (development 30640-c2c58e18c5) Lines: 927 946 98.0 %
Date: 2026-01-27 08:51:18 Functions: 51 51 100.0 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
setvarn2 35
quadsubfieldcm 140
nfsubfieldsmax 154
galoissubfieldcm 210
nfsubfields_fa 259
rootsuptoconj 280
try_imag 280
RgV_negtranslate 283
RgV_translate 283
maxgen_subfields 287
subfields_get_ero 287
nfsubfields 329
subfields_get_fa 595
subfieldsall 595
cmsubfield_get_roots 1092
nfsubfieldscm 1155
heap_push 1232
heap_pop 1421
_subfield 1463
subfields_cleanup 1568
heap_climb 1764
subfield_generator 1876
heap_descend 2569
twoembequation 2583
try_subfield_generator 3318
fix_var 4845
get_bezout 5201
init_primedata 5201
init_traces 5201
subfields_poldata 5201
choose_prime 5215
subfields_of_given_degree 5544
bound_for_coeff 5827
compute_data 5827
chinese_retrieve_pol 5937
embedding 5937
print_block_system 6348
calc_block 6686
nfsubfields0 7088
append 7707
poltrace 8136
ok_coeffs 11105
polsimplify 11105
im_block_by_perm 17109
field_is_contained 19474
test_block 22492
subfield 22775
RgXY_to_RgC 37961
cycle_power_to_perm 42407
trace 42442
perm_mul_i 215696

Generated by: LCOV version 1.16