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.18.1 lcov report (development 31041-bd73e9fcdd) Lines: 94.7 % 677 641
Test Date: 2026-07-22 22:45:42 Functions: 94.6 % 37 35
Legend: Lines:     hit not hit

Function Name Sort by function name Hit count Sort by function hit count
gissquare 0
gissquareall 0
polmodispower 56
rfracispower 56
sqrtint0 119
Fp_ispower 707
polispower 1008
Qp_ispower 1064
ispolygonal 1386
ispseudoprimepower 2063
polissquareall 3780
U2_issquare 4361
Zn_issquare 5558
Up_issquare 7350
logint0 26882
sqrtint 92399
uisnilpotent 97076
Zp_issquare 111229
issquare 229267
uissquare 275005
issquareall 433589
split_exponent 507427
uisprimepower 546580
Z_ispow2 586618
isprimepower 840147
ulogintall 841273
isprimepower_i 842210
Z_isanypower_101 870412
logintall 942996
Z_ispowerall 1562094
gisanypower 7000182
Z_isanypower 7195986
Z_isanypower_aux 7195986
Z_issquareall 8088521
ispower 8558762
uissquareall 12051217
squaremod 15859555

Generated by: LCOV version 2.0-1