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 30702-bddb8d6928) Lines: 927 946 98.0 %
Date: 2026-02-23 02:23:56 Functions: 51 51 100.0 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
setvarn2 30
nfsubfieldsmax 110
quadsubfieldcm 112
galoissubfieldcm 166
nfsubfields_fa 185
rootsuptoconj 200
maxgen_subfields 205
subfields_get_ero 205
try_imag 224
nfsubfields 282
subfields_get_fa 435
subfieldsall 473
RgV_negtranslate 631
RgV_translate 631
cmsubfield_get_roots 870
heap_push 880
nfsubfieldscm 915
heap_pop 1015
_subfield 1164
subfields_cleanup 1210
heap_climb 1260
subfield_generator 1345
heap_descend 1835
twoembequation 1855
try_subfield_generator 2375
field_is_contained 13910
im_block_by_perm 17297
fix_var 25524
get_bezout 26397
init_primedata 26397
init_traces 26397
subfields_poldata 26397
choose_prime 26407
subfields_of_given_degree 26643
RgXY_to_RgC 27183
bound_for_coeff 27274
compute_data 27274
chinese_retrieve_pol 27760
embedding 27760
nfsubfields0 27970
print_block_system 28080
calc_block 28358
append 29974
poltrace 31142
ok_coeffs 33874
polsimplify 33874
cycle_power_to_perm 35399
test_block 43819
subfield 44450
trace 147404
perm_mul_i 167352

Generated by: LCOV version 1.16