فهرست منبع

Report if ExitStatus of DosBox process is non-zero

git-svn-id: trunk@39197 -
pierre 7 سال پیش
والد
کامیت
cf8c5d2540
1فایلهای تغییر یافته به همراه7 افزوده شده و 2 حذف شده
  1. 7 2
      tests/utils/dosbox/dosbox_wrapper.pas

+ 7 - 2
tests/utils/dosbox/dosbox_wrapper.pas

@@ -17,6 +17,7 @@ const
   verbose : boolean = false;
   DosBoxProcess: TProcess = nil;
   dosbox_timeout : integer = 400;  { default timeout in seconds }
+  DosBoxExitStatus : integer = -1;
 var
   OutputFileName : String;
   SourceFileName : String;
@@ -365,15 +366,18 @@ begin
     CloseFile(F);
   except
     Writeln('Unable to read exitcode value');
+    if (DosBoxExitStatus <> 0) then
+      Writeln('DosBox exit status = ',DosBoxExitStatus);
     ReadExitCode:=127*256;
   end;
 end;
 
-procedure ExecuteDosBox(const ADosBoxBinaryPath, ADosBoxDir: string);
+function ExecuteDosBox(const ADosBoxBinaryPath, ADosBoxDir: string) : Integer;
 var
   Time: Integer = 0;
 begin
   DosBoxProcess := TProcess.Create(nil);
+  result:=-1;
   try
     DosBoxProcess.Executable := ADosBoxBinaryPath;
     DosBoxProcess.Parameters.Add('-conf');
@@ -394,6 +398,7 @@ begin
       Sleep(100);
     end;
   finally
+    result:=DosBoxProcess.ExitStatus;
     DosBoxProcess.Free;
     DosBoxProcess:=nil;
     EchoOutput;
@@ -603,7 +608,7 @@ begin
         else if verbose then
           writeln('cwsdpmi executable missing');
       end;
-    ExecuteDosBox(DosBoxBinaryPath, DosBoxDir);
+    DosBoxExitStatus:=ExecuteDosBox(DosBoxBinaryPath, DosBoxDir);
   finally
     ExitProc;
   end;