+ add "FILES" variable for testsuite tests: list of files required by test needing to be copied to remote target

git-svn-id: trunk@10467 -
This commit is contained in:
micha 2008-03-09 18:25:25 +00:00
parent 00ae5d1d5d
commit b96823997d
6 changed files with 46 additions and 1 deletions

View File

@ -41,6 +41,8 @@ MAXVERSION.........Compiler with at most this version number required.
RESULT.............Exit code of execution of test expected
TIMEOUT............Timeout indication for test in seconds (only used if
enabled by defining TEST_TIMEOUT)
FILES..............List of files (separated by spaces) required by test,
will be copied to remote before execution
GRAPH..............Requires graph unit
FAIL...............Compilation must fail
RECOMPILE..........After compiling a test, recompile the test for a second

View File

@ -1,3 +1,4 @@
{ %FILES=testpc.txt }
Program trdtxt01;
{$ifdef fpc}

View File

@ -1,3 +1,4 @@
{ %FILES=testux.txt }
Program trdtxt02;
{$ifdef fpc}

View File

@ -1,3 +1,4 @@
{ %FILES=testmac.txt }
Program trdtxt03;
{$ifdef fpc}

View File

@ -697,8 +697,11 @@ var
FullExeLogFile,
TestRemoteExe,
TestExe : string;
LocalFile, RemoteFile: string;
LocalPath: string;
execcmd : string;
execres : boolean;
index : integer;
EndTicks,
StartTicks : int64;
function ExecuteRemote(const prog,args:string):boolean;
@ -717,6 +720,8 @@ var
EndTicks:=GetMicroSTicks;
end;
label
done;
begin
RunExecutable:=false;
execres:=true;
@ -747,7 +752,37 @@ begin
TestRemoteExe:=RemotePath+'/'+SplitFileName(TestExe);
if deBefore in DelExecutable then
ExecuteRemote(rshprog,RemotePara+' '+RemoteAddr+' rm -f '+TestRemoteExe);
ExecuteRemote(rcpprog,RemotePara+' '+TestExe+' '+RemoteAddr+':'+TestRemoteExe);
execres:=ExecuteRemote(rcpprog,RemotePara+' '+TestExe+' '+RemoteAddr+':'+TestRemoteExe);
if not execres then
begin
Verbose(V_Abort, 'Could not copy executable '+TestExe);
goto done;
end;
s:=Config.Files;
if length(s) > 0 then
begin
LocalPath:=SplitPath(PPFile);
if Length(LocalPath) > 0 then
LocalPath:=LocalPath+'/';
repeat
index:=pos(' ',s);
if index=0 then
LocalFile:=s
else
LocalFile:=copy(s,1,index-1);
RemoteFile:=RemotePath+'/'+SplitFileName(LocalFile);
LocalFile:=LocalPath+LocalFile;
execres:=ExecuteRemote(rcpprog,RemotePara+' '+LocalFile+' '+RemoteAddr+':'+RemoteFile);
if not execres then
begin
Verbose(V_Abort, 'Could not copy required file '+LocalFile);
goto done;
end;
if index=0 then
break;
s:=copy(s,index+1,length(s)-index);
until false;
end;
{ rsh doesn't pass the exitcode, use a second command to print the exitcode
on the remoteshell to stdout }
execcmd:=RemotePara+' '+RemoteAddr+' '+rquote+'chmod 755 '+TestRemoteExe+
@ -798,6 +833,7 @@ begin
begin
Verbose(V_Normal,'Execution took '+ToStr(EndTicks-StartTicks)+' us');
end;
done:
if (not execres) and (ExecuteResult=0) then
begin
AddLog(FailLogFile,TestName);

View File

@ -37,6 +37,7 @@ type
Timeout : longint;
Category : string;
Note : string;
Files : string;
end;
Const
@ -257,6 +258,9 @@ begin
else
if GetEntry('TIMEOUT') then
Val(res,r.Timeout,code)
else
if GetEntry('FILES') then
r.Files:=res
else
Verbose(V_Error,'Unknown entry: '+s);
end;