adacl_aunit 7.0.1 (#1619)

This commit is contained in:
Martin Krischik
2025-10-06 16:59:22 +02:00
committed by GitHub
parent cf06d80462
commit 592288c1dd
+109
View File
@@ -0,0 +1,109 @@
name = "adacl_aunit"
description = "Ada 2022 AUnit with readable asserts & paramerised test"
long-description = """A versatile Ada 2022 testing library, enhancing AUnit with readable assertions and parameterised tests.
## Features
### AUnit-Compatible Assertions
- Generic support for access, array, discrete, floating-point, fixed-point, decimal, vector types, and files.
- **Readable Error Messages**: Assertions provide detailed feedback.
Example for unbounded strings:
```ada
procedure Equal
(Actual : Ada.Strings.Unbounded.Unbounded_String;
Expected : String;
Name : String;
Source : String := GNAT.Source_Info.File;
Line : Natural := GNAT.Source_Info.Line)
is
use Ada.Strings.Unbounded;
begin
if not (Actual = Expected) then
Report_Assertion
(Message => "In string «" & Name & "» the " & Actual'Image & " is not equal to " & Expected'Image,
Source => Source,
Line => Line);
end if;
end Equal;
```
This yields clear, context-rich error messages, surpassing standard AUnit
output.
## Parameterised Tests
Run the same test with varied inputs and expected values, boosting coverage
efficiently.
Example from hp41cx_tools:
```ada
overriding procedure Register_Tests (T : in out Test_Case) is
pragma Debug (AdaCL.Trace.Entering (In_Parameter => T.Name.all'Image));
begin
T.Parameter.Register_Routine (T, Test_To_HP_Duration_01'Access, "WAKE_UP", "2024-12-01 08:00:00", [3, 9, 4, 2, 0, 2, 8, 8, 0, 0, 0], 3942028800.0);
T.Parameter.Register_Routine (T, Test_To_HP_Duration_01'Access, "^LBLTEST", "2025-07-22 12:00:00", [3, 9, 6, 2, 1, 7, 4, 4, 0, 0, 0], 3962174400.0);
T.Parameter.Register_Routine (T, Test_To_HP_Duration_01'Access, "TONE", "2025-11-12 09:12:34", [3, 9, 7, 1, 9, 2, 7, 5, 5, 4, 0], 3971927554.0);
T.Parameter.Register_Routine (T, Test_To_HP_Duration_01'Access, "FRACTION", "2025-11-12 09:12:34.5", [3, 9, 7, 1, 9, 2, 7, 5, 5, 4, 5], 3971927554.5);
T.Parameter.Register_Routine (T, Test_To_HP_Duration_01'Access, "REPEAT24", "24:00:00", [0, 0, 0, 0, 0, 8, 6, 4, 0, 0, 0], 0000086400.0);
T.Parameter.Register_Routine (T, Test_To_HP_Duration_01'Access, "REPEAT'First", "0000:00:01.0", [0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0], 0000000010.0);
T.Parameter.Register_Routine (T, Test_To_HP_Duration_01'Access, "REPEAT'Last", "9999:59:59.9", [0, 0, 3, 5, 9, 9, 9, 9, 9, 9, 9], 0035999999.9);
pragma Debug (AdaCL.Trace.Exiting);
return;
end Register_Tests;
```
Registering tests multiple times with different data enhances test coverage
without redundant code.
Source: [SourceForge](https://sourceforge.net/p/adacl/git/ci/master/tree/adacl_aunit/test/src/)
Documentation: [GNATdoc](https://adacl.sourceforge.net/gnatdoc/adacl_aunit_test/index.html)
"""
version = "7.0.1"
licenses = "GPL-3.0-or-later"
authors = ["Martin Krischik <krischik@users.sourceforge.net>"]
maintainers = ["Martin Krischik <krischik@users.sourceforge.net>"]
maintainers-logins = ["krischik"]
website = "https://sourceforge.net/projects/adacl_aunit/"
tags = ["library", "aunit", "assert", "ada2022"]
[build-switches]
"*".ada_version = "Ada2022"
"*".source_encoding = "UTF_8"
development.compile_checks = "Warnings"
development.contracts = "Yes"
development.debug_info = "Yes"
development.optimization = "Debug"
development.runtime_checks = "Overflow"
release.compile_checks = "Warnings"
release.contracts = "No"
release.debug_info = "No"
release.optimization = "Performance"
release.runtime_checks = "Default"
validation.compile_checks = "Warnings"
validation.contracts = "Yes"
validation.debug_info = "Yes"
validation.optimization = "Debug"
validation.runtime_checks = "Everything"
[[depends-on]]
adacl = "^7.0.0"
aunit = "25.0.0"
# [[pins]]
# adacl = { path = "../adacl" }
# vim: set textwidth=0 nowrap tabstop=8 shiftwidth=4 softtabstop=4 expandtab :
# vim: set filetype=toml fileencoding=utf-8 fileformat=unix foldmethod=diff :
# vim: set spell spelllang=en_gb :
[origin]
hashes = [
"sha256:ebfefd3e7f69834409b1f2215dcede0772feaad9f41c477c4fde55cf17eede26",
"sha512:db9a7cc4ffb7e773e074466fd65cd2520d9f9b6164fe5b016feaa6410e3a610363871297caf8bde90fa3cce9848daa0f44eec7c321cd5a5e02970bf9123241d5",
]
url = "https://sourceforge.net/projects/adacl/files/Alire/adacl_aunit-7.0.1.tgz"