Skip to content

Commit 4934dca

Browse files
committed
fix(test): report failure when zero tests are executed
Print_Category_Summary now guards against Total=0 so that an empty test run is reported as FAILURE instead of SUCCESS.
1 parent 0a2c422 commit 4934dca

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

test/common/test_framework.adb

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,18 @@ package body Test_Framework is
5151
begin
5252
Put_Line ("");
5353

54-
if Passed = Total then
54+
if Total = 0 then
55+
-- No tests ran: Bright red box
56+
Put_Line (Color_Red & "########################################");
57+
Put_Line ("###");
58+
Put_Line ("### " & Category_Name & ": FAILURE");
59+
Put_Line ("### No tests were executed!");
60+
Put_Line ("###");
61+
Put_Line ("########################################" & Color_Reset);
62+
Put_Line ("");
63+
return 1; -- Failure exit code
64+
65+
elsif Passed = Total then
5566
-- Success: Bright green box
5667
Put_Line (Color_Green & "########################################");
5768
Put_Line ("###");

0 commit comments

Comments
 (0)