Skip to content

Commit

Permalink
grt: add Error_NF to report final error status. Fix #803
Browse files Browse the repository at this point in the history
  • Loading branch information
tgingold committed Jan 26, 2021
1 parent 6b81ec1 commit 0978b48
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
7 changes: 7 additions & 0 deletions src/grt/grt-errors.adb
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,13 @@ package body Grt.Errors is
Error_E;
end Error;

procedure Error_NF (Str : String) is
begin
Error_S (Str);
Newline_Err;
Exit_Status := 1;
end Error_NF;

procedure Info_S (Str : String := "") is
begin
Put_Err (Progname);
Expand Down
4 changes: 4 additions & 0 deletions src/grt/grt-errors.ads
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ package Grt.Errors is
Line : Ghdl_I32);
pragma No_Return (Error);

-- Non-fatal error (for the final message in case of previous error).
-- Set the exit status.
procedure Error_NF (Str : String);

-- Warning message.
procedure Warning (Str : String);

Expand Down
4 changes: 2 additions & 2 deletions src/grt/grt-main.adb
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,11 @@ package body Grt.Main is
if Expect_Failure then
if Status >= 0 then
Expect_Failure := False;
Error ("error expected, but none occurred");
Error_NF ("error expected, but none occurred");
end if;
else
if Status < 0 then
Error ("simulation failed");
Error_NF ("simulation failed");
end if;
end if;
end Run_Finish;
Expand Down

0 comments on commit 0978b48

Please sign in to comment.