-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make Is_Main_File recognize mains even if they are specified in corresponding attribute without extentions. Change-Id: I939d583760eb670e8fc25c1e19c54a248da6d1d8 TN: U412-040
- Loading branch information
1 parent
f28498b
commit 12821a4
Showing
6 changed files
with
100 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
procedure Main is | ||
|
||
Type Fred is tagged | ||
|
||
record | ||
|
||
Something : Boolean; | ||
|
||
end record; | ||
|
||
procedure Simon (This : access Fred'Class); | ||
|
||
procedure Simon (This : access Fred'Class) is | ||
begin | ||
null; | ||
end Simon; | ||
begin | ||
null; | ||
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,6 @@ | ||
#include <stdio.h> | ||
int main2() { | ||
// printf() displays the string inside quotation | ||
printf("Hello, World!"); | ||
return 0; | ||
} |
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,9 @@ | ||
project r is | ||
for Languages use ("Ada", "C"); | ||
for Main use ("main", "main2"); | ||
|
||
package Naming is | ||
for Body_Suffix ("Ada") use ".ada2"; | ||
for Body_Suffix ("C") use ".c2"; | ||
end Naming; | ||
end r; |
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,25 @@ | ||
with GNATCOLL.Projects; use GNATCOLL.Projects; | ||
with GNATCOLL.Projects.Aux; | ||
with GNATCOLL.VFS; use GNATCOLL.VFS; | ||
|
||
with Test_Assert; | ||
|
||
function Test return Integer is | ||
PT : Project_Tree; | ||
Env : Project_Environment_Access; | ||
begin | ||
|
||
Initialize (Env); | ||
PT.Load (GNATCOLL.VFS.Create ("r.gpr"), Env); | ||
|
||
Test_Assert.Assert | ||
(PT.Root_Project.Is_Main_File ("main.ada2"), "check Ada main"); | ||
Test_Assert.Assert | ||
(PT.Root_Project.Is_Main_File ("main2.c2"), "check C main"); | ||
|
||
GNATCOLL.Projects.Aux.Delete_All_Temp_Files (PT.Root_Project); | ||
Unload (PT); | ||
Free (Env); | ||
return Test_Assert.Report; | ||
|
||
end Test; |
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,8 @@ | ||
description: > | ||
Check that Is_Main_File correctly works when mains | ||
are specified in the project file as unit names without | ||
corresponding language specific suffix. | ||
data: | ||
- "r.gpr" | ||
- "main.ada2" | ||
- "main2.c2" |