Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

first draft of alire test runner #1850

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

AldanTanneo
Copy link
Contributor

@AldanTanneo AldanTanneo commented Feb 14, 2025

This is a demo implementation of what a minimal Alire test runner could look like, following the proposed design in #1831.

For now, it only takes two arguments: a -j[obs=]N arg that specifies how many tests should be run in parallel (defaults to 0, aka how many cores your machine has) and --dir=<dir>, specifying which sub-directory holds your tests (defaults to tests).

To test it:

Have a repository with a tests folder containing a binary crate. In the GPR file, replace the Main setting with

for Main use [Crate_Name]_List_Config.Test_Files;

and at the top, add

with "config/[crate name]_list_config.gpr";

Each .adb file in src/ should contain a single main procedure. You can add extra source directories (like common...), they will not be considered test folders, and you can put extra test code in there, to be used from the actual test procedures.

A test fails when its exit code is not zero (for instance, from an unhandled exception).

Finally, simply run alr test2 with the alr from this branch.

@mosteo
Copy link
Member

mosteo commented Feb 19, 2025

Thanks for providing this prototype, César. I'll play with it in the coming days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants