File tree Expand file tree Collapse file tree 6 files changed +61
-3
lines changed
testsuite/tests/gnatcheck/rules_dir Expand file tree Collapse file tree 6 files changed +61
-3
lines changed Original file line number Diff line number Diff line change 33-- SPDX-License-Identifier: GPL-3.0-or-later
44--
55
6+ with Ada.Containers.Ordered_Sets ;
67with Ada.Environment_Variables ;
78
89with GNAT.OS_Lib ;
@@ -35,9 +36,12 @@ package body Rules_Factory is
3536 (Ctx : L.Analysis_Context; Dirs : Path_Array := No_Paths)
3637 return Rule_Vector
3738 is
39+ package Virtual_File_Sets is new
40+ Ada.Containers.Ordered_Sets (Element_Type => Virtual_File);
41+
3842 Rules_Dirs : constant Virtual_File_Array := Get_Rules_Directories (Dirs);
3943 Rules : Rule_Vector := Rule_Vectors.Empty_Vector;
40- Seen : String_Sets .Set := String_Sets .Empty_Set;
44+ Seen : Virtual_File_Sets .Set := Virtual_File_Sets .Empty_Set;
4145 Impacts : constant JSON_Value := Get_Impacts (Rules_Dirs);
4246
4347 begin
@@ -53,7 +57,7 @@ package body Rules_Factory is
5357 begin
5458 for File of Dir.all loop
5559 if File.File_Extension = +" .lkql"
56- and then not Seen.Contains (+ File.Full_Name )
60+ and then not Seen.Contains (File)
5761 then
5862 declare
5963 Rc : Rule_Command;
@@ -64,7 +68,7 @@ package body Rules_Factory is
6468 begin
6569 if Has_Rule then
6670 Rules.Append (Rc);
67- Seen.Include (+ File.Full_Name );
71+ Seen.Include (File);
6872 end if ;
6973 end ;
7074 end if ;
Original file line number Diff line number Diff line change 1+ project Prj is
2+ end Prj;
Original file line number Diff line number Diff line change 1+ @check(help="help", message="message")
2+ fun my_rule(node) =
3+ node is DefiningName
Original file line number Diff line number Diff line change 1+ procedure Test is -- FLAG
2+ begin
3+ null ;
4+ end ;
Original file line number Diff line number Diff line change 1+ 1. Summary
2+
3+ fully compliant sources : 0
4+ sources with exempted violations only : 0
5+ sources with non-exempted violations : 1
6+ unverified sources : 0
7+ total sources : 1
8+ ignored sources : 0
9+
10+ non-exempted violations : 1
11+ rule exemption warnings : 0
12+ compilation errors : 0
13+ exempted violations : 0
14+ internal errors : 0
15+
16+ 2. Exempted Coding Standard Violations
17+
18+ no exempted violations detected
19+
20+ 3. Non-exempted Coding Standard Violations
21+
22+ test.adb:1:11: rule violation: message
23+
24+ 4. Rule exemption problems
25+
26+ no rule exemption problems detected
27+
28+ 5. Language violations
29+
30+ no language violations detected
31+
32+ 6. Gnatcheck internal errors
33+
34+ no internal error detected
35+
Original file line number Diff line number Diff line change 1+ description : |
2+ Ensure GNATCheck can handle several times the same rule directory and properly
3+ builds a set of unique rules.
4+ driver : gnatcheck
5+ project : prj.gpr
6+ rules_dirs :
7+ - rules
8+ - ./rules/../rules
9+ rules :
10+ - +Rmy_rule
You can’t perform that action at this time.
0 commit comments