mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-24 13:49:30 +02:00
* print exitcode of remote test to stdout and parse the output file.
this is the most reliable passing of the exitcode
This commit is contained in:
parent
5787d92d8f
commit
b432c9a246
@ -514,6 +514,36 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function CheckTestExitCode(const OutName:string):boolean;
|
||||||
|
var
|
||||||
|
t : text;
|
||||||
|
s : string;
|
||||||
|
i,code : integer;
|
||||||
|
begin
|
||||||
|
CheckTestExitCode:=false;
|
||||||
|
{ open logfile }
|
||||||
|
assign(t,Outname);
|
||||||
|
{$I-}
|
||||||
|
reset(t);
|
||||||
|
{$I+}
|
||||||
|
if ioresult<>0 then
|
||||||
|
exit;
|
||||||
|
while not eof(t) do
|
||||||
|
begin
|
||||||
|
readln(t,s);
|
||||||
|
i:=pos('TestExitCode: ',s);
|
||||||
|
if i>0 then
|
||||||
|
begin
|
||||||
|
delete(s,1,i+14-1);
|
||||||
|
val(s,ExecuteResult,code);
|
||||||
|
CheckTestExitCode:=true;
|
||||||
|
break;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
close(t);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
function RunExecutable:boolean;
|
function RunExecutable:boolean;
|
||||||
var
|
var
|
||||||
outname,
|
outname,
|
||||||
@ -538,7 +568,11 @@ begin
|
|||||||
TestRemoteExe:=RemotePath+'/'+SplitFileName(TestExe);
|
TestRemoteExe:=RemotePath+'/'+SplitFileName(TestExe);
|
||||||
ExecuteRemote(rshprog,RemoteAddr+' rm -f '+TestRemoteExe);
|
ExecuteRemote(rshprog,RemoteAddr+' rm -f '+TestRemoteExe);
|
||||||
ExecuteRemote(rcpprog,TestExe+' '+RemoteAddr+':'+TestRemoteExe);
|
ExecuteRemote(rcpprog,TestExe+' '+RemoteAddr+':'+TestRemoteExe);
|
||||||
execres:=ExecuteRemote(rshprog,RemoteAddr+' '+TestRemoteExe);
|
{ rsh doesn't pass the exitcode, use a second command to print the exitcode
|
||||||
|
on the remoteshell to stdout }
|
||||||
|
execres:=ExecuteRemote(rshprog,RemoteAddr+' '''+TestRemoteExe+' ; echo "TestExitCode: $?"''');
|
||||||
|
{ Check for TestExitCode error in output, sets ExecuteResult }
|
||||||
|
CheckTestExitCode(OutName);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
@ -682,13 +716,13 @@ begin
|
|||||||
'R' : RemoteAddr:=Para;
|
'R' : RemoteAddr:=Para;
|
||||||
|
|
||||||
'T' :
|
'T' :
|
||||||
DelExecutable:=true;
|
DelExecutable:=true;
|
||||||
|
|
||||||
'S' :
|
'S' :
|
||||||
begin
|
begin
|
||||||
rshprog:='ssh';
|
rshprog:='ssh';
|
||||||
rcpprog:='scp';
|
rcpprog:='scp';
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -912,7 +946,11 @@ begin
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.35 2004-05-16 20:13:04 peter
|
Revision 1.36 2004-05-17 20:51:29 peter
|
||||||
|
* print exitcode of remote test to stdout and parse the output file.
|
||||||
|
this is the most reliable passing of the exitcode
|
||||||
|
|
||||||
|
Revision 1.35 2004/05/16 20:13:04 peter
|
||||||
* remote execute updates, see readme.txt
|
* remote execute updates, see readme.txt
|
||||||
|
|
||||||
Revision 1.34 2004/05/03 14:48:51 peter
|
Revision 1.34 2004/05/03 14:48:51 peter
|
||||||
|
Loading…
Reference in New Issue
Block a user