https://github.com/tomekw/testy
A test framework in Ada
https://github.com/tomekw/testy
ada tada testing-framework unit-testing
Last synced: 2 months ago
JSON representation
A test framework in Ada
- Host: GitHub
- URL: https://github.com/tomekw/testy
- Owner: tomekw
- License: eupl-1.2
- Created: 2026-03-02T19:42:20.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2026-03-12T10:23:59.000Z (3 months ago)
- Last Synced: 2026-03-12T17:10:04.230Z (3 months ago)
- Topics: ada, tada, testing-framework, unit-testing
- Language: Ada
- Homepage:
- Size: 18.6 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ada - testy - Ada testing framework, part of [Tada](https://github.com/tomekw/tada). (Frameworks / Unit Test, Testing)
README
# Testy [](https://github.com/tomekw/testy/actions/workflows/test.yml)
A testing library in Ada. Part of [Tada](https://github.com/tomekw/tada).
## Status
This is alpha software. I'm actively working it. YMMV.
Tested on Linux x86_64, MacOS ARM and Windows x86_64.
## Usage
``` ada
-- tests/foo_tests.ads
with Testy.Tests;
package Foo_Tests is
use Testy.Tests;
procedure Foo_Starts_With_F (T : in out Test_Context);
procedure Foo_Raises (T : in out Test_Context);
end Foo_Tests;
```
``` ada
-- tests/foo_tests.adb
package body Foo_Tests is
function First_Letter (Foo : String) return Character is
begin
return Foo (Foo'First);
end First_Letter;
procedure Foo_Starts_With_F (T : in out Test_Context) is
Result : constant Character := First_Letter ("Foo");
begin
T.Expect (Result = 'F', "expected 'F', got '" & Result & "'");
end Foo_Starts_With_F;
procedure Foo is
begin
raise Constraint_Error with "Foo raised";
end Foo;
procedure Foo_Raises (T : in out Test_Context) is
begin
T.Expect_Raises (Foo'Access);
T.Expect_Raises (Foo'Access, Constraint_Error'Identity);
T.Expect_Raises (Foo'Access, Constraint_Error'Identity, "Foo raised");
end Foo_Raises;
end Foo_Tests;
```
``` ada
-- tests/tests_main.adb
with Testy.Runners;
with Testy.Reporters.Text;
with Foo_Tests;
procedure Tests_Main is
use Testy;
Test_Runner : Runners.Runner := Runners.Create;
Test_Reporter : Reporters.Text.Text_Reporter;
begin
Test_Runner.Add ("Foo starts with F", Foo_Tests.Foo_Starts_With_F'Access);
Test_Runner.Add ("Foo raises", Foo_Tests.Foo_Raises'Access);
Test_Runner.Run (Test_Reporter);
end Tests_Main;
```
``` shell
$ tada test
Running 2 tests...
[PASS]: Foo starts with F
[PASS]: Foo raises
Results: 2 passed, 0 failed, 0 errors, 2 total.
```
## Disclaimer
This codebase is written by hand. Claude Code is used for Socratic design exploration and code review.
## License
[EUPL](LICENSE)