Browse Source

* fix regressions after previous patch by correctly parsing output, which does not contain '##WASI-EXITCODE:'

Nikolay Nikolov 3 years ago
parent
commit
0f4340e659
1 changed files with 10 additions and 7 deletions
  1. 10 7
      tests/utils/dotest.pp

+ 10 - 7
tests/utils/dotest.pp

@@ -1042,13 +1042,16 @@ begin
      if is_wasi then
      if is_wasi then
        begin
        begin
          i:=pos('##WASI-EXITCODE: ',s);
          i:=pos('##WASI-EXITCODE: ',s);
-         delete(s,1,i+17-1);
-         val(s,ExecuteResult,code);
-        if code>1 then
-           val(copy(s,1,code-1),ExecuteResult,code);
-         if code=0 then
-           CheckTestExitCode:=true;
-         break;
+         if i>0 then
+           begin
+             delete(s,1,i+17-1);
+             val(s,ExecuteResult,code);
+             if code>1 then
+               val(copy(s,1,code-1),ExecuteResult,code);
+             if code=0 then
+               CheckTestExitCode:=true;
+             break;
+           end;
        end
        end
      else
      else
        begin
        begin