|
21 | 21 | -- <http://www.gnu.org/licenses/>. -- |
22 | 22 | ------------------------------------------------------------------------------ |
23 | 23 |
|
| 24 | +with Ada.Directories; |
24 | 25 | with GNATCOLL.JSON; |
25 | 26 | with GNATCOLL.VFS; use GNATCOLL.VFS; |
26 | 27 | with GNATCOLL.Traces; use GNATCOLL.Traces; |
@@ -3149,43 +3150,43 @@ package body Test.Harness is |
3149 | 3150 | GNATCOLL.Projects.Project_From_Name |
3150 | 3151 | (Source_Project_Tree, P.Name_Of_Extended.all); |
3151 | 3152 |
|
| 3153 | + Exposed_List : constant String_List := |
| 3154 | + Project.Attribute_Value (Interfaces_Attribute).all; |
| 3155 | + |
3152 | 3156 | Driver_Sources_Present : constant Boolean := |
3153 | | - P.Sources_List.First = List_Of_Strings.No_Element; |
| 3157 | + P.Sources_List.First /= List_Of_Strings.No_Element; |
3154 | 3158 | begin |
3155 | 3159 | S_Put (3, "for Interfaces use ("); |
3156 | 3160 |
|
3157 | 3161 | -- Go through all units exposed in the interface and add them |
3158 | 3162 | -- to the driver's interface. |
3159 | | - declare |
3160 | | - Exposed_List : constant String_List := |
3161 | | - Project.Attribute_Value (Interfaces_Attribute).all; |
3162 | | - begin |
3163 | | - for Source of Exposed_List loop |
3164 | | - S_Put (0, """" & Source.all & ""","); |
3165 | | - end loop; |
3166 | | - end; |
| 3163 | + |
| 3164 | + for Source of Exposed_List loop |
| 3165 | + S_Put (0, """" & Source.all & ""","); |
| 3166 | + end loop; |
3167 | 3167 |
|
3168 | 3168 | -- If there are source for this test driver, add all of them to |
3169 | 3169 | -- the interface. If not, only add the relevant unit. |
3170 | 3170 |
|
3171 | 3171 | if Driver_Sources_Present then |
3172 | | - S_Put (0, """" & Base_Name (P.UUT_File_Name.all) & """"); |
3173 | | - else |
3174 | 3172 | declare |
3175 | 3173 | Cur : String_Set.Cursor := Sources_Names.First; |
3176 | 3174 | begin |
3177 | 3175 | while Cur /= String_Set.No_Element loop |
3178 | | - S_Put (0, """" & String_Set.Element (Cur) & """"); |
3179 | | - |
| 3176 | + S_Put (0, """" & String_Set.Element (Cur) & ""","); |
3180 | 3177 | Next (Cur); |
3181 | | - |
3182 | | - if Cur /= String_Set.No_Element then |
3183 | | - S_Put (0, ","); |
3184 | | - end if; |
3185 | 3178 | end loop; |
3186 | 3179 | end; |
3187 | 3180 | end if; |
3188 | 3181 |
|
| 3182 | + -- Always add the unit under test to the interface |
| 3183 | + |
| 3184 | + S_Put |
| 3185 | + (0, |
| 3186 | + """" |
| 3187 | + & Ada.Directories.Simple_Name (P.UUT_File_Name.all) |
| 3188 | + & """"); |
| 3189 | + |
3189 | 3190 | S_Put (0, ");"); |
3190 | 3191 |
|
3191 | 3192 | -- Reset the sources list to be added to the interface |
|
0 commit comments