Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions .github/workflows/ada.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: Alire Build

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

Expand All @@ -17,6 +16,14 @@ jobs:

- name: Set up Alire
uses: alire-project/setup-alire@v4
- name: Build

- name: Build library
run: alr build

- name: Build tests
run: alr build
working-directory: tests

- name: Run tests
run: ./bin/test_runner
working-directory: tests
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ All notable changes to this project will be documented in this file. The format

## [Unreleased]

### Changed

- Instead of a homegrown test suite, we now use AUnit.

## [0.2.0] - 2025-12-29

### Changed
Expand Down
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,16 @@ Requires Ada 2022 compiler (FSF GNAT 13+).

```bash
alr build # Build library
alr exec -- ./bin/test_runner # Run tests (after building tests)
```

## Running Tests

Tests use [AUnit](https://github.com/AdaCore/aunit) and live in a separate crate:

```bash
cd tests
alr build
./bin/test_runner
```

## License
Expand Down
16 changes: 16 additions & 0 deletions tests/alire.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name = "tinyaml_tests"
description = "Tests for TinyAML library"
version = "0.2.0"

authors = ["Jochen Lillich"]
maintainers = ["Jochen Lillich <hello@geewiz.dev>"]
maintainers-logins = ["geewiz"]

[[depends-on]]
aunit = "^26.0.0"

[[depends-on]]
tinyaml = "*"

[[pins]]
tinyaml = { path = ".." }
116 changes: 116 additions & 0 deletions tests/alire/alire.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
# THIS FILE IS GENERATED. DO NOT EDIT.

[solution]
[solution.context]
solved = true
[[solution.state]]
crate = "aunit"
fulfilment = "solved"
pinned = false
transitivity = "direct"
versions = "^26.0.0"
[solution.state.release]
authors = [
"AdaCore",
]
description = "Ada unit test framework"
licenses = "GPL-3.0-or-later WITH GCC-exception-3.1"
maintainers = [
"chouteau@adacore.com",
"sagaert@adacore.com",
]
maintainers-logins = [
"Fabien-Chouteau",
"AldanTanneo",
]
name = "aunit"
project-files = [
"lib/gnat/aunit.gpr",
]
tags = [
"unit",
"test",
"unit-test",
]
version = "26.0.0"
[solution.state.release.configuration]
auto_gpr_with = true
disabled = true
generate_ada = true
generate_c = true
generate_gpr = true
output_dir = "config"
[solution.state.release.gpr-externals]
AUNIT_BUILD_MODE = [
"Devel",
"Install",
]
AUNIT_RUNTIME = [
"full",
"zfp",
"zfp-cross",
"ravenscar",
"ravenscar-cert",
"cert",
]
[solution.state.release.origin]
hashes = [
"sha512:b882e96a4b2cbc2d0d3838e14f2c7b6e576d6d7ccf88fe3562b1fbca61a2ebfd4e8b3379dd5c3fb3140949cda69526c8696fe3b7a6c6748fe93f116213276b39",
]
url = "https://github.com/AdaCore/aunit/archive/refs/tags/v26.0.0.zip"
[[solution.state]]
crate = "gnat"
fulfilment = "solved"
pinned = false
transitivity = "indirect"
versions = ">=13"
[solution.state.release]
auto-gpr-with = false
description = "The GNAT Ada compiler - Native"
licenses = "GPL-3.0-or-later AND GPL-3.0-or-later WITH GCC-exception-3.1"
maintainers = [
"Fabien Chouteau <chouteau@adacore.com>",
"César Sagaert <sagaert@adacore.com>",
]
maintainers-logins = [
"Fabien-Chouteau",
"AldanTanneo",
]
name = "gnat_native"
provides = [
"gnat=15.2.1",
]
version = "15.2.1"
website = "https://github.com/alire-project/GNAT-FSF-builds"
[solution.state.release.configuration]
auto_gpr_with = true
disabled = true
generate_ada = true
generate_c = true
generate_gpr = true
output_dir = "config"
[solution.state.release.environment]
[solution.state.release.environment.LD_LIBRARY_PATH]
prepend = "${CRATE_ROOT}/lib64"
[solution.state.release.environment.LD_RUN_PATH]
prepend = "${CRATE_ROOT}/lib64"
[solution.state.release.environment.LIBRARY_PATH]
prepend = "${CRATE_ROOT}/lib64"
[solution.state.release.environment.PATH]
prepend = "${CRATE_ROOT}/bin"
[solution.state.release.origin]
binary = true
hashes = [
"sha256:4640d4b369833947ab1a156753f4db0ecd44b0f14410b5b2bc2a14df496604bb",
]
url = "https://github.com/alire-project/GNAT-FSF-builds/releases/download/gnat-15.2.0-1/gnat-x86_64-linux-15.2.0-1.tar.gz"
[[solution.state]]
crate = "tinyaml"
fulfilment = "linked"
pinned = false
transitivity = "direct"
versions = "*"
[solution.state.link]
lockfiled = true
path = ".."

6 changes: 6 additions & 0 deletions tests/alire/build_hash_inputs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependency:aunit=26.0.0=78c67a8b011e08e5500962fc633efb7809a9c7391b64fc383bbaebb1096eadc4
dependency:tinyaml=0.2.0=35dcaab96834c0712229aeea970e24669049cca0f53bab324e197c0225b8e6db
external:LIBRARY_TYPE=default
external:TINYAML_TESTS_LIBRARY_TYPE=default
profile:tinyaml_tests=DEVELOPMENT
switches:tinyaml_tests=-Og,-fdata-sections,-ffunction-sections,-g,-gnatVa,-gnatW8,-gnatw.X,-gnatwa,-gnaty-d,-gnaty3,-gnatyA,-gnatyB,-gnatyI,-gnatyO,-gnatyS,-gnatya,-gnatyb,-gnatyc,-gnatye,-gnatyf,-gnatyh,-gnatyi,-gnatyk,-gnatyl,-gnatym,-gnatyn,-gnatyp,-gnatyr,-gnatyt,-gnatyu,-gnatyx
Empty file.
2 changes: 2 additions & 0 deletions tests/alire/settings.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
last_build_profile = "aunit=RELEASE,gnat_native=RELEASE,tinyaml=RELEASE,tinyaml_tests=DEVELOPMENT"

Binary file added tests/bin/test_runner
Binary file not shown.
20 changes: 20 additions & 0 deletions tests/config/tinyaml_tests_config.ads
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
-- Configuration for tinyaml_tests generated by Alire
pragma Restrictions (No_Elaboration_Code);
pragma Style_Checks (Off);

package Tinyaml_Tests_Config is
pragma Pure;

Crate_Version : constant String := "0.2.0";
Crate_Name : constant String := "tinyaml_tests";

Alire_Host_OS : constant String := "linux";

Alire_Host_Arch : constant String := "x86_64";

Alire_Host_Distro : constant String := "ubuntu";

type Build_Profile_Kind is (release, validation, development);
Build_Profile : constant Build_Profile_Kind := development;

end Tinyaml_Tests_Config;
52 changes: 52 additions & 0 deletions tests/config/tinyaml_tests_config.gpr
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
-- Configuration for tinyaml_tests generated by Alire
with "aunit.gpr";
with "tinyaml.gpr";
abstract project Tinyaml_Tests_Config is
Crate_Version := "0.2.0";
Crate_Name := "tinyaml_tests";

Alire_Host_OS := "linux";

Alire_Host_Arch := "x86_64";

Alire_Host_Distro := "ubuntu";
Ada_Compiler_Switches := External_As_List ("ADAFLAGS", " ");
Ada_Compiler_Switches := Ada_Compiler_Switches &
(
"-Og" -- Optimize for debug
,"-ffunction-sections" -- Separate ELF section for each function
,"-fdata-sections" -- Separate ELF section for each variable
,"-g" -- Generate debug info
,"-gnatwa" -- Enable all warnings
,"-gnatw.X" -- Disable warnings for No_Exception_Propagation
,"-gnatVa" -- All validity checks
,"-gnaty3" -- Specify indentation level of 3
,"-gnatya" -- Check attribute casing
,"-gnatyA" -- Use of array index numbers in array attributes
,"-gnatyB" -- Check Boolean operators
,"-gnatyb" -- Blanks not allowed at statement end
,"-gnatyc" -- Check comments
,"-gnaty-d" -- Disable check no DOS line terminators present
,"-gnatye" -- Check end/exit labels
,"-gnatyf" -- No form feeds or vertical tabs
,"-gnatyh" -- No horizontal tabs
,"-gnatyi" -- Check if-then layout
,"-gnatyI" -- check mode IN keywords
,"-gnatyk" -- Check keyword casing
,"-gnatyl" -- Check layout
,"-gnatym" -- Check maximum line length
,"-gnatyn" -- Check casing of entities in Standard
,"-gnatyO" -- Check that overriding subprograms are explicitly marked as such
,"-gnatyp" -- Check pragma casing
,"-gnatyr" -- Check identifier references casing
,"-gnatyS" -- Check no statements after THEN/ELSE
,"-gnatyt" -- Check token spacing
,"-gnatyu" -- Check unnecessary blank lines
,"-gnatyx" -- Check extra parentheses
,"-gnatW8" -- UTF-8 encoding for wide characters
);

type Build_Profile_Kind is ("release", "validation", "development");
Build_Profile : Build_Profile_Kind := "development";

end Tinyaml_Tests_Config;
20 changes: 20 additions & 0 deletions tests/config/tinyaml_tests_config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/* Configuration for tinyaml_tests generated by Alire */
#ifndef TINYAML_TESTS_CONFIG_H
#define TINYAML_TESTS_CONFIG_H

#define CRATE_VERSION "0.2.0"
#define CRATE_NAME "tinyaml_tests"

#define ALIRE_HOST_OS "linux"

#define ALIRE_HOST_ARCH "x86_64"

#define ALIRE_HOST_DISTRO "ubuntu"

#define BUILD_PROFILE_RELEASE 1
#define BUILD_PROFILE_VALIDATION 2
#define BUILD_PROFILE_DEVELOPMENT 3

#define BUILD_PROFILE 3

#endif
Loading