-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Libadalang.Helpers.App: new formal to control GPR "missing dirs" warns
In addition to adding this new formal, also use it to disable warnings in lal_dda.adb, nameres.adb and navigate.adb.
- Loading branch information
Showing
25 changed files
with
200 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
testsuite/tests/ada_api/app/gpr_missing_dirs/gpr1-no-warn/main.adb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
-- Check that App does not report GPR missing directories when asked not to | ||
|
||
with Ada.Text_IO; use Ada.Text_IO; | ||
|
||
with Libadalang.Analysis; use Libadalang.Analysis; | ||
with Libadalang.Helpers; use Libadalang.Helpers; | ||
|
||
procedure Main is | ||
procedure Process_Unit (Context : App_Job_Context; Unit : Analysis_Unit); | ||
|
||
package App is new Libadalang.Helpers.App | ||
(Name => "example", | ||
Description => "Example app", | ||
Process_Unit => Process_Unit, | ||
GPR_Absent_Dir_Warning => False); | ||
|
||
------------------ | ||
-- Process_Unit -- | ||
------------------ | ||
|
||
procedure Process_Unit (Context : App_Job_Context; Unit : Analysis_Unit) is | ||
pragma Unreferenced (Context); | ||
begin | ||
Put_Line (Unit.Root.Image); | ||
end Process_Unit; | ||
|
||
begin | ||
App.Run; | ||
end Main; |
2 changes: 2 additions & 0 deletions
2
testsuite/tests/ada_api/app/gpr_missing_dirs/gpr1-no-warn/p.ads
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
package P is | ||
end P; |
4 changes: 4 additions & 0 deletions
4
testsuite/tests/ada_api/app/gpr_missing_dirs/gpr1-no-warn/p.gpr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
project P is | ||
for Source_Files use ("p.ads"); | ||
for Object_Dir use "obj-p"; | ||
end P; |
1 change: 1 addition & 0 deletions
1
testsuite/tests/ada_api/app/gpr_missing_dirs/gpr1-no-warn/test.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<CompilationUnit p.ads:1:1-2:7> |
3 changes: 3 additions & 0 deletions
3
testsuite/tests/ada_api/app/gpr_missing_dirs/gpr1-no-warn/test.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
driver: ada-api | ||
main: main.adb | ||
argv: [-Pp.gpr] |
28 changes: 28 additions & 0 deletions
28
testsuite/tests/ada_api/app/gpr_missing_dirs/gpr1-warn/main.adb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
-- Check that App reports GPR missing directories by default | ||
|
||
with Ada.Text_IO; use Ada.Text_IO; | ||
|
||
with Libadalang.Analysis; use Libadalang.Analysis; | ||
with Libadalang.Helpers; use Libadalang.Helpers; | ||
|
||
procedure Main is | ||
procedure Process_Unit (Context : App_Job_Context; Unit : Analysis_Unit); | ||
|
||
package App is new Libadalang.Helpers.App | ||
(Name => "example", | ||
Description => "Example app", | ||
Process_Unit => Process_Unit); | ||
|
||
------------------ | ||
-- Process_Unit -- | ||
------------------ | ||
|
||
procedure Process_Unit (Context : App_Job_Context; Unit : Analysis_Unit) is | ||
pragma Unreferenced (Context); | ||
begin | ||
Put_Line (Unit.Root.Image); | ||
end Process_Unit; | ||
|
||
begin | ||
App.Run; | ||
end Main; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
package P is | ||
end P; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
project P is | ||
for Source_Files use ("p.ads"); | ||
for Object_Dir use "obj-p"; | ||
end P; |
2 changes: 2 additions & 0 deletions
2
testsuite/tests/ada_api/app/gpr_missing_dirs/gpr1-warn/test.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
p.gpr:3:23: warning: object directory "obj-p" not found | ||
<CompilationUnit p.ads:1:1-2:7> |
3 changes: 3 additions & 0 deletions
3
testsuite/tests/ada_api/app/gpr_missing_dirs/gpr1-warn/test.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
driver: ada-api | ||
main: main.adb | ||
argv: [-Pp.gpr] |
29 changes: 29 additions & 0 deletions
29
testsuite/tests/ada_api/app/gpr_missing_dirs/gpr2-no-warn/main.adb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
-- Check that App does not report GPR missing directories when asked not to | ||
|
||
with Ada.Text_IO; use Ada.Text_IO; | ||
|
||
with Libadalang.Analysis; use Libadalang.Analysis; | ||
with Libadalang.Helpers; use Libadalang.Helpers; | ||
|
||
procedure Main is | ||
procedure Process_Unit (Context : App_Job_Context; Unit : Analysis_Unit); | ||
|
||
package App is new Libadalang.Helpers.App | ||
(Name => "example", | ||
Description => "Example app", | ||
Process_Unit => Process_Unit, | ||
GPR_Absent_Dir_Warning => False); | ||
|
||
------------------ | ||
-- Process_Unit -- | ||
------------------ | ||
|
||
procedure Process_Unit (Context : App_Job_Context; Unit : Analysis_Unit) is | ||
pragma Unreferenced (Context); | ||
begin | ||
Put_Line (Unit.Root.Image); | ||
end Process_Unit; | ||
|
||
begin | ||
App.Run; | ||
end Main; |
2 changes: 2 additions & 0 deletions
2
testsuite/tests/ada_api/app/gpr_missing_dirs/gpr2-no-warn/p.ads
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
package P is | ||
end P; |
4 changes: 4 additions & 0 deletions
4
testsuite/tests/ada_api/app/gpr_missing_dirs/gpr2-no-warn/p.gpr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
project P is | ||
for Source_Files use ("p.ads"); | ||
for Object_Dir use "obj-p"; | ||
end P; |
1 change: 1 addition & 0 deletions
1
testsuite/tests/ada_api/app/gpr_missing_dirs/gpr2-no-warn/test.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<CompilationUnit p.ads:1:1-2:7> |
3 changes: 3 additions & 0 deletions
3
testsuite/tests/ada_api/app/gpr_missing_dirs/gpr2-no-warn/test.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
driver: ada-api | ||
main: main.adb | ||
argv: [-Pp.gpr, --gpr2] |
28 changes: 28 additions & 0 deletions
28
testsuite/tests/ada_api/app/gpr_missing_dirs/gpr2-warn/main.adb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
-- Check that App reports GPR missing directories by default with --gpr2 | ||
|
||
with Ada.Text_IO; use Ada.Text_IO; | ||
|
||
with Libadalang.Analysis; use Libadalang.Analysis; | ||
with Libadalang.Helpers; use Libadalang.Helpers; | ||
|
||
procedure Main is | ||
procedure Process_Unit (Context : App_Job_Context; Unit : Analysis_Unit); | ||
|
||
package App is new Libadalang.Helpers.App | ||
(Name => "example", | ||
Description => "Example app", | ||
Process_Unit => Process_Unit); | ||
|
||
------------------ | ||
-- Process_Unit -- | ||
------------------ | ||
|
||
procedure Process_Unit (Context : App_Job_Context; Unit : Analysis_Unit) is | ||
pragma Unreferenced (Context); | ||
begin | ||
Put_Line (Unit.Root.Image); | ||
end Process_Unit; | ||
|
||
begin | ||
App.Run; | ||
end Main; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
package P is | ||
end P; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
project P is | ||
for Source_Files use ("p.ads"); | ||
for Object_Dir use "obj-p"; | ||
end P; |
2 changes: 2 additions & 0 deletions
2
testsuite/tests/ada_api/app/gpr_missing_dirs/gpr2-warn/test.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
p.gpr:3:23: warning: object directory "obj-p" not found | ||
<CompilationUnit p.ads:1:1-2:7> |
3 changes: 3 additions & 0 deletions
3
testsuite/tests/ada_api/app/gpr_missing_dirs/gpr2-warn/test.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
driver: ada-api | ||
main: main.adb | ||
argv: [-Pp.gpr, --gpr2] |