Browse Source

Allow to pass antoher exitcode to fail utility by command line first parameter

Pierre Muller 1 year ago
parent
commit
9f69dd28b4
1 changed files with 11 additions and 0 deletions
  1. 11 0
      tests/utils/fail.pp

+ 11 - 0
tests/utils/fail.pp

@@ -1,5 +1,16 @@
 program fail;
 
+var
+  i : int64;
+  err : word;
 begin
+  if paramstr(1)<>'' then
+    begin
+      val(paramstr(1),i,err);
+      if err<>0 then
+        writeln('Error with ',paramstr(1))
+      else
+        halt(i);
+    end;
   halt(1);
 end.