-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'topic/gs.266.message_secondary_with_higher_importance' …
…into 'master' Avoid creating a secondary message of higher importance See merge request eng/ide/gnatstudio!486
- Loading branch information
Showing
7 changed files
with
86 additions
and
0 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
8 changes: 8 additions & 0 deletions
8
testsuite/tests/gs.266.message_secondary_with_higher_importance/obsolescent.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,8 @@ | ||
project Obsolescent is | ||
|
||
for Source_Dirs use ("src"); | ||
|
||
package Builder is | ||
for Default_Switches ("Ada") use ("-gnatwj", "-f"); | ||
end Builder; | ||
end Obsolescent; |
6 changes: 6 additions & 0 deletions
6
testsuite/tests/gs.266.message_secondary_with_higher_importance/src/foo.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,6 @@ | ||
with Pack; | ||
|
||
procedure Foo is | ||
begin | ||
Pack.Obs (1, 2, 3); | ||
end Foo; |
26 changes: 26 additions & 0 deletions
26
testsuite/tests/gs.266.message_secondary_with_higher_importance/src/pack.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,26 @@ | ||
with Ada.Text_IO; | ||
|
||
package body Pack is | ||
|
||
--------- | ||
-- Obs -- | ||
--------- | ||
|
||
procedure Obs (I, J, K, L : Integer) is | ||
pragma Unreferenced (L); | ||
begin | ||
Real (I, J, K); | ||
end Obs; | ||
|
||
---------- | ||
-- Real -- | ||
---------- | ||
|
||
procedure Real (I, J, K : Integer) is | ||
begin | ||
if I = J and then K = I + J then | ||
Ada.Text_IO.Put_Line ("Hello World"); | ||
end if; | ||
end Real; | ||
|
||
end Pack; |
8 changes: 8 additions & 0 deletions
8
testsuite/tests/gs.266.message_secondary_with_higher_importance/src/pack.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,8 @@ | ||
package Pack is | ||
|
||
procedure Obs (I, J, K, L : Integer); | ||
pragma Obsolescent (Obs, "Use Real"); | ||
|
||
procedure Real (I, J, K : Integer); | ||
|
||
end Pack; |
31 changes: 31 additions & 0 deletions
31
testsuite/tests/gs.266.message_secondary_with_higher_importance/test.py
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,31 @@ | ||
""" | ||
Verify that when multiple messages are located in the same location, | ||
the highest message will be a primary. | ||
""" | ||
import GPS | ||
from gs_utils.internal.utils import * | ||
|
||
EXPECTED = ['Builder results (2 items in 1 file)', | ||
['foo.adb (2 items)', | ||
['<b>5:8</b> warning: call to obsolescent procedure' + | ||
' "Obs" declared at pack.ads:3 [enabled by default]', | ||
[' warning: call to obsolescent procedure' + | ||
' "Obs" declared at <span color="#729FCF">' + | ||
'<u>pack.ads:3</u></span> [enabled by default]', | ||
' warning: Use Real [enabled by default]'], | ||
'<b>5:8</b> error: missing argument for parameter' + | ||
' "L" in call to "Obs"' + | ||
' declared at pack.ads:3', | ||
[' error: missing argument for parameter "' + | ||
'L" in call to "Obs" declared at' + | ||
' <span color="#729FCF"><u>pack.ads:3</u></span>']]]] | ||
|
||
|
||
@run_test_driver | ||
def driver(): | ||
GPS.BuildTarget("Build All").execute(force=True) | ||
yield wait_tasks() | ||
|
||
gps_assert(dump_locations_tree(), | ||
EXPECTED, | ||
"Missing error for first renaming") |
1 change: 1 addition & 0 deletions
1
testsuite/tests/gs.266.message_secondary_with_higher_importance/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 @@ | ||
title: 'gs.266.message_secondary_with_higher_importance' |