Skip to content

Commit aff84d9

Browse files
Adapt tests to GNATpp replacement by GNATformat
For eng/ide/gnatstudio#465
1 parent 7ab16c0 commit aff84d9

File tree

15 files changed

+18
-53
lines changed

15 files changed

+18
-53
lines changed

share/support/ui/gnatformat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def run_gnatformat_on_project_and_subprojects():
100100
</target>
101101
102102
<target model="gnatformat" category="_Project"
103-
name="Format project and subprojects">
103+
name="Format current project and subprojects">
104104
<in-toolbar>FALSE</in-toolbar>
105105
<in-menu>FALSE</in-menu>
106106
<launch-mode>MANUALLY_WITH_DIALOG</launch-mode>

testsuite/tests/S612-031.messages.highlight_gnatpp/test.py

Lines changed: 0 additions & 31 deletions
This file was deleted.

testsuite/tests/S612-031.messages.highlight_gnatpp/test.yaml

Lines changed: 0 additions & 1 deletion
This file was deleted.

testsuite/tests/S612-031.messages.highlight_gnatpp/unit.adb

Lines changed: 0 additions & 1 deletion
This file was deleted.

testsuite/tests/V329-036.gnatpp.projects/default.gpr

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,5 @@ with "imported.gpr";
22

33
project Default is
44

5-
package Pretty_Printer is
6-
for Default_Switches ("ada") use ("-kU", "--verbose");
7-
end Pretty_Printer;
8-
95
end Default;
106

testsuite/tests/V329-036.gnatpp.projects/imported.gpr

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,4 @@ project Imported is
22

33
for Source_Dirs use ("src");
44

5-
package Pretty_Printer is
6-
for Default_Switches ("ada") use ("-kU", "--verbose");
7-
end Pretty_Printer;
8-
95
end Imported;

testsuite/tests/V329-036.gnatpp.projects/test.py

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,32 @@
11
"""
2-
This test checks that gnatpp actions and project and subprojects
2+
This test checks that gnatformat actions on project and subprojects
33
work correctly.
44
"""
5+
56
import GPS
67
from workflows import run_as_workflow
78
from gs_utils.internal.utils import *
89

910

1011
@run_as_workflow
11-
def run_gnatpp(unit_to_check, subprojects=False, excluded_unit=None):
12-
action_name = "run gnatpp on project"
13-
12+
def run_gnatformat(unit_to_check, subprojects=False, excluded_unit=None):
13+
action_name = "run gnatformat on project"
14+
dialog_name = "Format current project"
1415
if subprojects:
1516
action_name += " and subprojects"
17+
dialog_name += " and subprojects"
1618

1719
yield idle_modal_dialog(lambda: GPS.execute_action(action_name))
18-
dialog = get_window_by_title("Pretty Print current project")
20+
dialog = get_window_by_title(dialog_name)
1921
get_button_from_label("Execute", dialog).clicked()
22+
buttons = get_widgets_by_type(Gtk.CheckButton, dialog)
23+
verbose_button = [b for b in buttons if b.get_label() == "Verbose output"][0]
24+
verbose_button.set_active(True)
2025
yield wait_tasks()
2126

2227
text = GPS.Console().get_text()
2328
gps_assert(
24-
"gnatpp" in text and unit_to_check in text,
29+
"gnatformat" in text and unit_to_check in text,
2530
True,
2631
unit_to_check + " should be pretty printed",
2732
)
@@ -40,10 +45,10 @@ def test_driver():
4045
prj_view.select_by_name(column=1, value="Default")
4146
yield wait_idle()
4247

43-
# Run gnatpp on the root project only
44-
yield run_gnatpp(
48+
# Run gnatformat on the root project only
49+
yield run_gnatformat(
4550
unit_to_check="unit.adb", subprojects=False, excluded_unit="main.adb"
4651
)
4752

48-
# Run gnatpp on the root project and subprojects
49-
yield run_gnatpp(unit_to_check="main.adb", subprojects=True)
53+
# Run gnatformat on the root project and subprojects
54+
yield run_gnatformat(unit_to_check="main.adb", subprojects=True)
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)