+ added support of putty utils to dotest

+ remote testing executes a chmod 755 before running a test
This commit is contained in:
florian 2004-07-03 18:28:20 +00:00
parent bbd7f75dbd
commit 1b78804998
4 changed files with 96 additions and 27 deletions

View File

@ -1,8 +1,8 @@
#
# Don't edit, this file is generated by FPCMake Version 1.1 [2004/05/23]
# Don't edit, this file is generated by FPCMake Version 1.1 [2004/07/03]
#
default: allexectests
MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx netware openbsd wdosx palmos macos darwin emx watcom
MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx netware openbsd wdosx palmos macos darwin emx watcom morphos
BSDs = freebsd netbsd openbsd darwin
UNIXs = linux $(BSDs) sunos qnx
FORCE:
@ -489,6 +489,11 @@ EXEEXT=
SHAREDLIBEXT=.library
FPCMADE=fpcmade.amg
endif
ifeq ($(OS_TARGET),morphos)
EXEEXT=
SHAREDLIBEXT=.library
FPCMADE=fpcmade.mos
endif
ifeq ($(OS_TARGET),atari)
EXEEXT=.ttp
FPCMADE=fpcmade.ata
@ -1066,6 +1071,11 @@ ifeq ($(CPU_TARGET),i386)
REQUIRE_PACKAGES_RTL=1
endif
endif
ifeq ($(OS_TARGET),morphos)
ifeq ($(CPU_TARGET),powerpc)
REQUIRE_PACKAGES_RTL=1
endif
endif
ifdef REQUIRE_PACKAGES_RTL
PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
ifneq ($(PACKAGEDIR_RTL),)
@ -1516,9 +1526,18 @@ endif
ifdef TEST_VERBOSE
override DOTESTOPT+=-V
endif
ifdef TEST_REMOTEOPT
override DOTESTOPT+="-U$(TEST_REMOTEOPT)"
endif
ifdef TEST_PUTTY
override DOTESTOPT+=-R$(TEST_PUTTY) -W
endif
ifdef TEST_OPT
override DOTESTOPT+=$(addprefix -Y, $(TEST_OPT))
endif
ifdef TEST_REMOTEPW
override DOTESTOPT+=-U-pw -U$(TEST_REMOTEPW)
endif
ifdef GRAPH
override DOTESTOPT+=-g
endif

View File

@ -190,12 +190,24 @@ endif
ifdef TEST_VERBOSE
override DOTESTOPT+=-V
endif
ifdef TEST_REMOTEOPT
override DOTESTOPT+="-U$(TEST_REMOTEOPT)"
endif
ifdef TEST_PUTTY
override DOTESTOPT+=-R$(TEST_PUTTY) -W
endif
ifdef TEST_OPT
# handles several options as well
override DOTESTOPT+=$(addprefix -Y, $(TEST_OPT))
endif
ifdef TEST_REMOTEPW
# handles several options as well
override DOTESTOPT+=-U-pw -U$(TEST_REMOTEPW)
endif
ifdef GRAPH
override DOTESTOPT+=-g
endif

View File

@ -113,10 +113,17 @@ Test options:
TEST_RSH set this to the hostname when you want to use rsh/rcp
to execute/copy the test
TEST_SSH set this to use ssh/scp to execute the test
TEST_PUTTY test using putty when remote testing (pscp and plink)
TEST_REMOTEOPT extra options to remote program
TEST_REMOTEPATH set remote path to use, default is /tmp
TEST_DELTEMP delete executable after running, so the remote system
doesn't need much free disk space
TEST_REMOTEPW pass a password with -pw to remote tools, mainly usefull for putty
Example:
make TEST_FPC=$HOME/fpc/compiler/ppcsparc TEST_BINUTILSPREFIX=sparc-linux- TEST_RSH=sunny TEST_REMOTEPATH=/tmp/tests
make TEST_FPC=$HOME/fpc/compiler/ppcsparc TEST_BINUTILSPREFIX=sparc-linux- TEST_SSH=fpc@sunny TEST_REMOTEPATH=/tmp/tests
Example for win32/putty:
make TEST_FPC=c:\fpc\compiler\ppcarm TEST_BINUTILSPREFIX=arm-linux- TEST_PUTTY=root@192.168.42.210 TEST_REMOTEPATH=/tmp TEST_DELTEMP=1 "TEST_REMOTEPW=xxx" FPC=c:\fpc\compiler\ppc386

View File

@ -57,8 +57,10 @@ const
DelExecutable : boolean = false;
RemoteAddr : string = '';
RemotePath : string = '/tmp';
RemotePara : string = '';
rshprog : string = 'rsh';
rcpprog : string = 'rcp';
rquote : char = '''';
Function FileExists (Const F : String) : Boolean;
{
@ -560,17 +562,22 @@ var
begin
RunExecutable:=false;
execres:=true;
TestExe:=ForceExtension(PPFile,ExeExt);
{ when remote testing, leave extension away }
if RemoteAddr='' then
TestExe:=ForceExtension(PPFile,ExeExt)
else
TestExe:=ForceExtension(PPFile,'');
OutName:=ForceExtension(PPFile,'elg');
if RemoteAddr<>'' then
begin
{ We don't want to create subdirs, remove paths from the test }
TestRemoteExe:=RemotePath+'/'+SplitFileName(TestExe);
ExecuteRemote(rshprog,RemoteAddr+' rm -f '+TestRemoteExe);
ExecuteRemote(rcpprog,TestExe+' '+RemoteAddr+':'+TestRemoteExe);
ExecuteRemote(rshprog,RemotePara+' '+RemoteAddr+' rm -f '+TestRemoteExe);
ExecuteRemote(rcpprog,RemotePara+' '+TestExe+' '+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: $?"''');
execres:=ExecuteRemote(rshprog,RemotePara+' '+RemoteAddr+' '+rquote+'chmod 755 '+TestRemoteExe+' ; '+
TestRemoteExe+' ; echo "TestExitCode: $?"'+rquote);
{ Check for TestExitCode error in output, sets ExecuteResult }
CheckTestExitCode(OutName);
end
@ -632,7 +639,7 @@ begin
begin
Verbose(V_Debug,'Deleting executable '+TestExe);
if RemoteAddr<>'' then
ExecuteRemote(rshprog,RemoteAddr+' rm -f '+TestRemoteExe);
ExecuteRemote(rshprog,RemotePara+' '+RemoteAddr+' rm -f '+TestRemoteExe);
RemoveFile(TestExe);
RemoveFile(ForceExtension(TestExe,ObjExt));
RemoveFile(ForceExtension(TestExe,PPUExt));
@ -661,8 +668,12 @@ var
writeln(' -I include interactive tests');
writeln(' -R<remote> run the tests remotely with the given rsh/ssh address');
writeln(' -S use ssh instead of rsh');
writeln(' -T remove temporary files (executable,ppu,o)');
writeln(' -P<path> path to the tests tree on the remote machine');
writeln(' -T leave temporary files (executable,ppu,o)');
writeln(' -U<remotepara>');
writeln(' pass additional parameter to remove program. Multiple -U can be used');
writeln(' -V be verbose');
writeln(' -W use putty compatible file names when testing (plink and pscp)');
writeln(' -Y<opts> extra options passed to the compiler. Several -Y<opt> can be given.');
halt(1);
end;
@ -688,41 +699,57 @@ begin
DoKnown:=true;
DoAll:=true;
end;
'C' : CompilerBin:=Para;
'E' : DoExecute:=true;
'G' : begin
DoGraph:=true;
if para='-' then
DoUsual:=false;
end;
'I' : begin
DoInteractive:=true;
if para='-' then
DoUsual:=false;
end;
'K' : begin
DoKnown:=true;
if para='-' then
DoUsual:=false;
end;
'V' : DoVerbose:=true;
'X' : UseComSpec:=false;
'P' : RemotePath:=Para;
'Y' : ExtraCompilerOpts:= ExtraCompilerOpts +' '+ Para;
'R' : RemoteAddr:=Para;
'T' :
DelExecutable:=true;
'S' :
begin
rshprog:='ssh';
rcpprog:='scp';
end;
'T' :
DelExecutable:=true;
'U' :
RemotePara:=+RemotePara+' '+Para;
'V' : DoVerbose:=true;
'W' :
begin
rshprog:='plink';
rcpprog:='pscp';
rquote:=' ';
end;
'X' : UseComSpec:=false;
'Y' : ExtraCompilerOpts:= ExtraCompilerOpts +' '+ Para;
end;
end
else
@ -946,7 +973,11 @@ begin
end.
{
$Log$
Revision 1.36 2004-05-17 20:51:29 peter
Revision 1.37 2004-07-03 18:28:21 florian
+ added support of putty utils to dotest
+ remote testing executes a chmod 755 before running a test
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