From b55e201b6fd805d7f786e614f22c6b52289ba981 Mon Sep 17 00:00:00 2001 From: florian Date: Sat, 1 Jan 2005 18:59:50 +0000 Subject: [PATCH] + emulator execution support added --- tests/Makefile | 7 +++++-- tests/Makefile.fpc | 6 +++++- tests/readme.txt | 14 +++++++++++++- tests/utils/dotest.pp | 40 ++++++++++++++++++++++++++++++++++------ 4 files changed, 57 insertions(+), 10 deletions(-) diff --git a/tests/Makefile b/tests/Makefile index e6d6fbae4d..310ec54464 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -1,5 +1,5 @@ # -# Don't edit, this file is generated by FPCMake Version 1.1 [2004/12/20] +# Don't edit, this file is generated by FPCMake Version 1.1 [2005/01/01] # default: allexectests MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx netware openbsd wdosx palmos macos darwin emx watcom morphos netwlibc @@ -1507,7 +1507,7 @@ endif endif endif endif -TEST_OUTPUTDIR=output/$(FULL_TARGET) +TEST_OUTPUTDIR=output/$(TEST_FULL_TARGET) ifndef FAILLIST export FAILLIST:=$(TEST_OUTPUTDIR)/faillist endif @@ -1598,6 +1598,9 @@ endif ifdef DOALL override DOTESTOPT+=-a endif +ifdef EMULATOR +override DOTESTOPT+=-M$(EMULATOR) +endif DIRS=webtbs webtbf tbs tbf $(TESTDIRS) vpath %.log $(TEST_OUTPUTDIR) vpath %.elg $(TEST_OUTPUTDIR) diff --git a/tests/Makefile.fpc b/tests/Makefile.fpc index 11adea5d6a..0a5959bc53 100644 --- a/tests/Makefile.fpc +++ b/tests/Makefile.fpc @@ -67,7 +67,7 @@ endif endif # Target dir where the ppu and binaries are created -TEST_OUTPUTDIR=output/$(FULL_TARGET) +TEST_OUTPUTDIR=output/$(TEST_FULL_TARGET) ################################ @@ -217,6 +217,10 @@ ifdef DOALL override DOTESTOPT+=-a endif +ifdef EMULATOR +override DOTESTOPT+=-M$(EMULATOR) +endif + ################################ # Run tests diff --git a/tests/readme.txt b/tests/readme.txt index efb4127611..43a0bdbd5b 100644 --- a/tests/readme.txt +++ b/tests/readme.txt @@ -126,4 +126,16 @@ make TEST_FPC=$HOME/fpc/compiler/ppcsparc TEST_BINUTILSPREFIX=sparc-linux- TEST_ 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 \ No newline at end of file +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 + +Emulator execution +------------------ + +Emulator execution is possible as well. It can't be combined with remote execution though. + +EMULATOR name of the emulator to use + +Example: + +make TEST_FPC=~/fpc/compiler/ppcrossarm TEST_OPT=-XParm-linux- EMULATOR=qemu-arm +make TEST_FPC=~/fpc/compiler/ppcrossarm TEST_OPT=-XParm-linux- EMULATOR=qemu-arm digest DBDIGESTOPT="-C qemu-arm" USESQL=YES diff --git a/tests/utils/dotest.pp b/tests/utils/dotest.pp index 1de5e5ddbc..469e5b38d3 100644 --- a/tests/utils/dotest.pp +++ b/tests/utils/dotest.pp @@ -74,6 +74,7 @@ const rshprog : string = 'rsh'; rcpprog : string = 'rcp'; rquote : char = ''''; + emulatorname : string = ''; Function FileExists (Const F : String) : Boolean; { @@ -631,10 +632,16 @@ var execres : boolean; function ExecuteRemote(const prog,args:string):boolean; - begin - Verbose(V_Debug,'RemoteExecuting '+Prog+' '+args); - ExecuteRemote:=ExecuteRedir(prog,args,'',EXELogFile,'stdout'); - end; + begin + Verbose(V_Debug,'RemoteExecuting '+Prog+' '+args); + ExecuteRemote:=ExecuteRedir(prog,args,'',EXELogFile,'stdout'); + end; + + function ExecuteEmulated(const prog,args:string):boolean; + begin + Verbose(V_Debug,'EmulatorExecuting '+Prog+' '+args); + ExecuteEmulated:=ExecuteRedir(prog,args,'',FullExeLogFile,'stdout'); + end; begin RunExecutable:=false; @@ -644,7 +651,22 @@ begin TestExe:=OutputFileName(PPFile,ExeExt) else TestExe:=OutputFileName(PPFile,''); - if RemoteAddr<>'' then + if EmulatorName<>'' then + begin + { Get full name out log file, because we change the directory during + execution } + FullExeLogFile:=FExpand(EXELogFile); + {$I-} + GetDir(0,OldDir); + ChDir(TestOutputDir); + {$I+} + ioresult; + execres:=ExecuteEmulated(EmulatorName,CurrDir+SplitFileName(TestExe)); + {$I-} + ChDir(OldDir); + {$I+} + end + else if RemoteAddr<>'' then begin { We don't want to create subdirs, remove paths from the test } TestRemoteExe:=RemotePath+'/'+SplitFileName(TestExe); @@ -754,6 +776,7 @@ var writeln(' -G include graph tests'); writeln(' -K include known bug tests'); writeln(' -I include interactive tests'); + writeln(' -M run the tests using the given emulator'); writeln(' -R 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)'); @@ -810,6 +833,8 @@ begin DoUsual:=false; end; + 'M' : EmulatorName:=Para; + 'P' : RemotePath:=Para; 'R' : RemoteAddr:=Para; @@ -1088,7 +1113,10 @@ begin end. { $Log$ - Revision 1.42 2004-11-29 21:25:32 peter + Revision 1.43 2005-01-01 18:59:52 florian + + emulator execution support added + + Revision 1.42 2004/11/29 21:25:32 peter support for limit83fs Revision 1.41 2004/11/09 23:13:50 peter