Skip to content

Setup initial unit tests#8

Merged
damaki merged 14 commits intomainfrom
topic/setup-unit-tests
Feb 28, 2026
Merged

Setup initial unit tests#8
damaki merged 14 commits intomainfrom
topic/setup-unit-tests

Conversation

@damaki
Copy link
Copy Markdown
Owner

@damaki damaki commented Feb 28, 2026

This sets up some initial unit tests.

The tests can optionally be run with code coverage using GNATcoverage, but it requires a recent version of GNATcoverage (I tested it against GNAT DAS 26.1).

The testsuite doesn't reach 100% coverage yet, since this PR just lays the initial groundwork for the tests.

While SPARK requires these pragmas for proof, it's not necessary to
declare them on these generic packages; they can be deferred to the
generic instantiation (which is the user's responsibility).
Having them declared in LibSAP is overly restrictive as the user
may want a different profile (e.g. Ravenscar), and also restricts
their use in non-SPARK programs, e.g. using the full Ada runtime.

Therefore, it's better to remove them from LibSAP and let the user
decide if they need them.
This requires a recent version of GNATcoverage that has support for
the Ada2022 language features used by LibSAP. This script was tested
with GNATcoverage 26.1.
The suite contains just one test for now.
This makes it possible to fully cover all decisions in Increment_Wrapping
during testing while keeping the workaround for the compiler warning.
These functions are used for specification only; they are not executed
at run-time (unless ghost assertions are enabled).
@damaki damaki self-assigned this Feb 28, 2026
@damaki damaki added the enhancement New feature or request label Feb 28, 2026
@damaki damaki force-pushed the topic/setup-unit-tests branch from 633176f to e58f3bf Compare February 28, 2026 17:11
@damaki damaki merged commit 9250a3d into main Feb 28, 2026
8 checks passed
@damaki damaki deleted the topic/setup-unit-tests branch February 28, 2026 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant