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) Hit Total Coverage
Test: PARI/GP v2.18.1 lcov report (development 30734-f1f26dedcb) Lines: 630 666 94.6 %
Date: 2026-03-04 09:24:31 Functions: 34 36 94.4 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
Fp_ispower 651
Qp_ispower 1043
U2_issquare 2541
Up_issquare 5229
Z_isanypower 7195990
Z_isanypower_101 870412
Z_isanypower_aux 7195990
Z_ispow2 586883
Z_ispowerall 1561730
Z_issquareall 6726651
Zn_issquare 2877
Zp_issquare 111180
gisanypower 7000182
gissquare 0
gissquareall 0
ispolygonal 1386
ispower 8558377
isprimepower 840147
isprimepower_i 842180
ispseudoprimepower 2033
issquare 229266
issquareall 252288
logint0 26808
logintall 938770
polispower 1008
polissquareall 3780
polmodispower 56
rfracispower 56
split_exponent 507427
sqrtint 89079
sqrtint0 119
squaremod 14501040
uisprimepower 643417
uissquare 274922
uissquareall 10869110
ulogintall 837411

Generated by: LCOV version 1.16