aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2021-01-26 07:49:57 +0100
committerTristan Gingold <tgingold@free.fr>2021-01-26 07:49:57 +0100
commit0978b48007afe920d8f7000c2c8722327c901259 (patch)
tree2bccc8796a0bb037a363e2fa698c038af50e56d1 /src
parent6b81ec185f16791362ca770f391578c2a8b828f0 (diff)
downloadghdl-0978b48007afe920d8f7000c2c8722327c901259.tar.gz
ghdl-0978b48007afe920d8f7000c2c8722327c901259.tar.bz2
ghdl-0978b48007afe920d8f7000c2c8722327c901259.zip
grt: add Error_NF to report final error status. Fix #803
Diffstat (limited to 'src')
-rw-r--r--src/grt/grt-errors.adb7
-rw-r--r--src/grt/grt-errors.ads4
-rw-r--r--src/grt/grt-main.adb4
3 files changed, 13 insertions, 2 deletions
diff --git a/src/grt/grt-errors.adb b/src/grt/grt-errors.adb
index 704132368..48cdd1870 100644
--- a/src/grt/grt-errors.adb
+++ b/src/grt/grt-errors.adb
@@ -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);
diff --git a/src/grt/grt-errors.ads b/src/grt/grt-errors.ads
index f70a77764..371908fad 100644
--- a/src/grt/grt-errors.ads
+++ b/src/grt/grt-errors.ads
@@ -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);
diff --git a/src/grt/grt-main.adb b/src/grt/grt-main.adb
index e97b02eea..71b148467 100644
--- a/src/grt/grt-main.adb
+++ b/src/grt/grt-main.adb
@@ -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;