mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-26 14:50:32 +02:00
* patch from Pierre for working around the exitcode <= 125 limitation in wasmtime
This commit is contained in:
parent
32fa0ecaf9
commit
a8b789d183
@ -146,6 +146,11 @@ End;
|
|||||||
|
|
||||||
procedure System_exit;
|
procedure System_exit;
|
||||||
begin
|
begin
|
||||||
|
if ExitCode>=126 then
|
||||||
|
begin
|
||||||
|
writeln(stderr,'##WASI-EXITCODE: ',ExitCode,' -> 125##');
|
||||||
|
ExitCode:=125;
|
||||||
|
end;
|
||||||
__wasi_proc_exit(ExitCode);
|
__wasi_proc_exit(ExitCode);
|
||||||
End;
|
End;
|
||||||
|
|
||||||
|
@ -1024,6 +1024,7 @@ var
|
|||||||
t : text;
|
t : text;
|
||||||
s : string;
|
s : string;
|
||||||
i,code : integer;
|
i,code : integer;
|
||||||
|
is_wasi :boolean;
|
||||||
begin
|
begin
|
||||||
CheckTestExitCode:=false;
|
CheckTestExitCode:=false;
|
||||||
{ open logfile }
|
{ open logfile }
|
||||||
@ -1033,18 +1034,34 @@ begin
|
|||||||
{$I+}
|
{$I+}
|
||||||
if ioresult<>0 then
|
if ioresult<>0 then
|
||||||
exit;
|
exit;
|
||||||
|
GetCompilerTarget;
|
||||||
|
is_wasi:=(CompilerTarget='wasi');
|
||||||
while not eof(t) do
|
while not eof(t) do
|
||||||
begin
|
begin
|
||||||
readln(t,s);
|
readln(t,s);
|
||||||
i:=pos('TestExitCode: ',s);
|
if is_wasi then
|
||||||
if i>0 then
|
begin
|
||||||
begin
|
i:=pos('##WASI-EXITCODE: ',s);
|
||||||
delete(s,1,i+14-1);
|
delete(s,1,i+17-1);
|
||||||
val(s,ExecuteResult,code);
|
val(s,ExecuteResult,code);
|
||||||
if code=0 then
|
if code>1 then
|
||||||
CheckTestExitCode:=true;
|
val(copy(s,1,code-1),ExecuteResult,code);
|
||||||
break;
|
if code=0 then
|
||||||
end;
|
CheckTestExitCode:=true;
|
||||||
|
break;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
i:=pos('TestExitCode: ',s);
|
||||||
|
if i>0 then
|
||||||
|
begin
|
||||||
|
delete(s,1,i+14-1);
|
||||||
|
val(s,ExecuteResult,code);
|
||||||
|
if code=0 then
|
||||||
|
CheckTestExitCode:=true;
|
||||||
|
break;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
close(t);
|
close(t);
|
||||||
end;
|
end;
|
||||||
@ -1325,6 +1342,11 @@ begin
|
|||||||
{$I-}
|
{$I-}
|
||||||
ChDir(OldDir);
|
ChDir(OldDir);
|
||||||
{$I+}
|
{$I+}
|
||||||
|
GetCompilerTarget;
|
||||||
|
if (CompilerTarget='wasi') then
|
||||||
|
begin
|
||||||
|
CheckTestExitCode(FullEXELogFile);
|
||||||
|
end;
|
||||||
end
|
end
|
||||||
else if RemoteAddr<>'' then
|
else if RemoteAddr<>'' then
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user