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 - ispower.c (source / functions) Coverage Total Hit
Test: PARI/GP v2.19.0 lcov report (development 31084-0f5a08ee7e) Lines: 94.7 % 677 641
Test Date: 2026-07-31 17:02:10 Functions: 94.6 % 37 35
Legend: Lines:     hit not hit

Function Name Sort by function name Hit count Sort by function hit count
Fp_ispower 707
Qp_ispower 1064
U2_issquare 4361
Up_issquare 7350
Z_isanypower 7195988
Z_isanypower_101 870412
Z_isanypower_aux 7195988
Z_ispow2 586612
Z_ispowerall 1562094
Z_issquareall 8091745
Zn_issquare 5558
Zp_issquare 111229
gisanypower 7000182
gissquare 0
gissquareall 0
ispolygonal 1386
ispower 8558762
isprimepower 840147
isprimepower_i 842183
ispseudoprimepower 2036
issquare 229267
issquareall 433589
logint0 26886
logintall 943049
polispower 1008
polissquareall 3780
polmodispower 56
rfracispower 56
split_exponent 507427
sqrtint 92399
sqrtint0 119
squaremod 15862693
uisnilpotent 97076
uisprimepower 546580
uissquare 275002
uissquareall 12054475
ulogintall 841294

Generated by: LCOV version 2.0-1