Skip to content

Commit 42dcb11

Browse files
committed
Merge branch 'mr/thevenoux-langkit-query-language#568' into 'master'
GNATcheck: spawn worker with the default GPR project file Closes #568 See merge request eng/libadalang/langkit-query-language!560
2 parents e2de2a2 + 070bb70 commit 42dcb11

File tree

8 files changed

+33
-7
lines changed

8 files changed

+33
-7
lines changed

lkql_checker/src/gnatcheck-compiler.adb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1773,6 +1773,15 @@ package body Gnatcheck.Compiler is
17731773
Num_Args := @ + 1;
17741774
Args (Num_Args) := new String'("--ignore-project-switches");
17751775
end if;
1776+
elsif Gnatcheck_Prj.Tree.Is_Defined
1777+
and then Gnatcheck_Prj.Tree.Root_Project.Path_Name.Exists
1778+
then
1779+
-- In case Prj has not been explicitly set, spawn the project option
1780+
-- with the default project file used by gpr.
1781+
Num_Args := @ + 1;
1782+
Args (Num_Args) :=
1783+
new String'
1784+
("-P" & Gnatcheck_Prj.Tree.Root_Project.Path_Name.String_Value);
17761785
end if;
17771786

17781787
if Arg.Aggregated_Project then

testsuite/tests/gnatcheck/config_pragmas/prj.gpr

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
project Prj is
2+
for Source_Dirs use ("../.");
3+
4+
package Builder is
5+
for Global_Configuration_Pragmas use "../gnat.adc";
6+
end Builder;
7+
end Prj;

testsuite/tests/gnatcheck/config_pragmas/test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ rules_dirs:
55
rules:
66
- +Rfoo
77
tests:
8-
- project: prj.gpr
8+
- project: project/prj.gpr
99
- input_sources: [main.adb]
10-
- project: prj.gpr
10+
- project: project/prj.gpr
1111
jobs: 2
1212
- input_sources: [main.adb]
1313
jobs: 2
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
project P is
2+
for Source_Dirs use ("src");
3+
end P;
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
procedure Main is
2+
begin
3+
null;
4+
end Name;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<gnatcheck_worker_exe> -P<working-dir>/p.gpr --target=x86_64-linux -d --log-file=<working-dir>/gnatcheck-log1.TMP --files-from=<working-dir>/gnatcheck-files1.TMP --rules-from=<working-dir>/gnatcheck-rules0.TMP
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
driver: gnatcheck
2+
format: brief
3+
input_sources: [src/main.adb]
4+
rules:
5+
- +Rsame_instantiations
6+
extra_args:
7+
- -d

0 commit comments

Comments
 (0)