-
-
Notifications
You must be signed in to change notification settings - Fork 61
Make alr test search for a test runner in parent dirs
#2076
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -53,6 +53,37 @@ package body Alr.Commands.Test is | |||||||||||||||||||||||||
| end if; | ||||||||||||||||||||||||||
| end Execute_Legacy; | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| -------------------------- | ||||||||||||||||||||||||||
| -- Find_Root_With_Tests -- | ||||||||||||||||||||||||||
| -------------------------- | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| function Find_Root_With_Tests | ||||||||||||||||||||||||||
| (Cmd : in out Command) return Alire.Roots.Optional.Root | ||||||||||||||||||||||||||
| is | ||||||||||||||||||||||||||
| use Alire; | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| Res : Roots.Optional.Root := Cmd.Optional_Root; | ||||||||||||||||||||||||||
| begin | ||||||||||||||||||||||||||
| while Res.Is_Valid | ||||||||||||||||||||||||||
| and then | ||||||||||||||||||||||||||
| Res.Value.Release.On_Platform_Properties | ||||||||||||||||||||||||||
| (Res.Value.Environment, Properties.Tests.Settings'Tag) | ||||||||||||||||||||||||||
| .Is_Empty | ||||||||||||||||||||||||||
| loop | ||||||||||||||||||||||||||
| Res := Roots.Optional.Search_Root (Dirs.Parent (Res.Value.Path)); | ||||||||||||||||||||||||||
| end loop; | ||||||||||||||||||||||||||
| return Res; | ||||||||||||||||||||||||||
| exception | ||||||||||||||||||||||||||
| when E : Dirs.Adirs.Use_Error => | ||||||||||||||||||||||||||
| pragma Unreferenced (E); | ||||||||||||||||||||||||||
| -- return failure if there is no parent directory left to search | ||||||||||||||||||||||||||
| return | ||||||||||||||||||||||||||
| Roots.Optional.Outcome_Failure | ||||||||||||||||||||||||||
| (Res.Value.Path & " has no parent directory", | ||||||||||||||||||||||||||
|
Comment on lines
+79
to
+82
|
||||||||||||||||||||||||||
| -- return failure if there is no parent directory left to search | |
| return | |
| Roots.Optional.Outcome_Failure | |
| (Res.Value.Path & " has no parent directory", | |
| -- Return failure if an operating system error prevents further | |
| -- directory manipulation while searching for a test root. | |
| return | |
| Roots.Optional.Outcome_Failure | |
| ("failed to search parent directories of '" | |
| & Res.Value.Path | |
| & "' due to an operating system error (directory operations " | |
| & "not supported)", |
Copilot
AI
Feb 5, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This user-facing change (alr test searching parent directories for test runners, and the new --legacy flag) should be documented in doc/user-changes.md according to the pull request checklist. The PR description indicates this is a significant behavioral change that users should be aware of.
Copilot
AI
Feb 5, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The help text marks the flag itself as deprecated with error coloring, but it's the legacy test actions that are deprecated, not the --legacy flag itself. The flag is newly introduced to allow opting into the deprecated legacy behavior and to prevent parent directory search. Consider rephrasing to make this clearer, such as: "Force executing legacy test actions (prevents parent directory search)"
| CLIC.TTY.Error ("Deprecated") | |
| & ". Force executing the legacy test actions", | |
| "Force executing legacy test actions (prevents parent directory" | |
| & " search)", |
Uh oh!
There was an error while loading. Please reload this page.