From 94ab3f44574e7a7ad8fdcd0c2e5c08a93c00701e Mon Sep 17 00:00:00 2001 From: florian Date: Sun, 21 Mar 2004 19:15:18 +0000 Subject: [PATCH] * explanation for running the testsuite remotely + dotest supports remote execution using scp/ssh --- tests/readme.txt | 11 ++++++++++ tests/utils/dotest.pp | 48 +++++++++++++++++++++++++++++++++++++------ 2 files changed, 53 insertions(+), 6 deletions(-) diff --git a/tests/readme.txt b/tests/readme.txt index b160b0613a..0ab46242c2 100644 --- a/tests/readme.txt +++ b/tests/readme.txt @@ -34,3 +34,14 @@ make full This should create a log of all failed tests. make rundigest scans the created log file and outputs some statistics make rundigest USESQL=YES sends the results to an SQL database + + +Also remote execution of the testsuite is possible +Requirements: +- current build tree contains a cross compiled rtl/fcl +- the cross compiler is installed works without passing extra parameters +- the tests tree is somewhere on the remote machine e.g. /mnt/cf/fpc/tests +- some dir, e.g. i386-utils contains a dotest executable for the host system +- ssh must work without keyboard interaction or extra parameters +then a example make command could be +make DOTEST=i386-utils/dotest FPC=ppcarm "DOTESTOPT=-Y-XParm-linux- -Rroot@192.168.44.9 -P/mnt/cf/fpc/tests -T" diff --git a/tests/utils/dotest.pp b/tests/utils/dotest.pp index e4a12a50fb..1f01eccb4b 100644 --- a/tests/utils/dotest.pp +++ b/tests/utils/dotest.pp @@ -51,6 +51,10 @@ const DoKnown : boolean = false; DoAll : boolean = false; DoUsual : boolean = true; + ExtraCompilerOpts : string = ''; + DelExecutable : boolean = false; + RemoteAddr : string = ''; + RemotePath : string = ''; Function FileExists (Const F : String) : Boolean; { @@ -373,7 +377,7 @@ var begin RunCompiler:=false; OutName:=ForceExtension(PPFile,'log'); - args:='-n -Fuunits'; + args:='-n -Fuunits '+ExtraCompilerOpts; {$ifdef unix} { Add runtime library path to current dir to find .so files } if Config.NeedLibrary then @@ -477,11 +481,26 @@ begin TestExe:=ForceExtension(PPFile,ExeExt); OutName:=ForceExtension(PPFile,'elg'); Verbose(V_Debug,'Executing '+TestExe); - { don't redirect interactive and graph programs .. } - if Config.IsInteractive or Config.UsesGraph then - ExecuteRedir(TestExe,'','','','') + if RemoteAddr<>'' then + begin + ExecuteRedir('ssh',RemoteAddr+' rm -f '+RemotePath+'/'+TestExe,'',OutName,''); + ExecuteRedir('scp',TestExe+' '+RemoteAddr+':'+RemotePath+'/'+TestExe,'',OutName,''); + { don't redirect interactive and graph programs .. } + if Config.IsInteractive or Config.UsesGraph then + ExecuteRedir(TestExe,'','','','') + else + ExecuteRedir('ssh',RemoteAddr+' '+RemotePath+'/'+TestExe,'',OutName,''); + if DelExecutable then + ExecuteRedir('ssh',RemoteAddr+' rm -f '+RemotePath+'/'+TestExe,'',OutName,''); + end else - ExecuteRedir(TestExe,'','',OutName,''); + begin + { don't redirect interactive and graph programs .. } + if Config.IsInteractive or Config.UsesGraph then + ExecuteRedir(TestExe,'','','','') + else + ExecuteRedir(TestExe,'','',OutName,''); + end; Verbose(V_Debug,'Exitcode '+ToStr(ExecuteResult)); if ExecuteResult<>Config.ResultCode then begin @@ -533,6 +552,10 @@ var writeln(' -G include graph tests'); writeln(' -K include known bug tests'); writeln(' -I include interactive tests'); + writeln(' -R run the tests remotely with the given ssh address'); + writeln(' -P path to the tests tree on the remote machine'); + writeln(' -T remove executables after execution (applies only for remote tests)'); + writeln(' -Y extra options passed to the compiler'); halt(1); end; @@ -575,7 +598,16 @@ begin DoUsual:=false; end; 'V' : DoVerbose:=true; + 'X' : UseComSpec:=false; + + 'P' : RemotePath:=Para; + + 'Y' : ExtraCompilerOpts:=Para; + + 'R' : RemoteAddr:=Para; + + 'T' : DelExecutable:=true; end; end else @@ -793,7 +825,11 @@ begin end. { $Log$ - Revision 1.29 2003-10-31 16:14:20 peter + Revision 1.30 2004-03-21 19:15:18 florian + * explanation for running the testsuite remotely + + dotest supports remote execution using scp/ssh + + Revision 1.29 2003/10/31 16:14:20 peter * remove compileerror10, note10 * remove known, use knowncompileerror,knownrunerror instead * knowncompileerror,knownrunerror tests are now really skipped