2
0
Эх сурвалжийг харах

+ added support of putty utils to dotest
+ remote testing executes a chmod 755 before running a test

florian 21 жил өмнө
parent
commit
1b78804998

+ 25 - 6
tests/Makefile

@@ -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
 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
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) sunos qnx
 UNIXs = linux $(BSDs) sunos qnx
 FORCE:
 FORCE:
@@ -489,6 +489,11 @@ EXEEXT=
 SHAREDLIBEXT=.library
 SHAREDLIBEXT=.library
 FPCMADE=fpcmade.amg
 FPCMADE=fpcmade.amg
 endif
 endif
+ifeq ($(OS_TARGET),morphos)
+EXEEXT=
+SHAREDLIBEXT=.library
+FPCMADE=fpcmade.mos
+endif
 ifeq ($(OS_TARGET),atari)
 ifeq ($(OS_TARGET),atari)
 EXEEXT=.ttp
 EXEEXT=.ttp
 FPCMADE=fpcmade.ata
 FPCMADE=fpcmade.ata
@@ -1066,6 +1071,11 @@ ifeq ($(CPU_TARGET),i386)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
 endif
 endif
+ifeq ($(OS_TARGET),morphos)
+ifeq ($(CPU_TARGET),powerpc)
+REQUIRE_PACKAGES_RTL=1
+endif
+endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
@@ -1461,7 +1471,7 @@ NOGRAPH=1
 endif
 endif
 .PHONY: utils units copyfiles testprep
 .PHONY: utils units copyfiles testprep
 utils:
 utils:
-	$(MAKE) -C utils 
+	$(MAKE) -C utils
 ifeq ($(USESQL),YES)
 ifeq ($(USESQL),YES)
 ifndef DBDIGEST
 ifndef DBDIGEST
 DBDIGEST=utils/dbdigest
 DBDIGEST=utils/dbdigest
@@ -1495,10 +1505,10 @@ ifeq ($(findstring -c$(TEST_FPC),$(DOTESTOPT)),)
 override DOTESTOPT+=-c$(TEST_FPC)
 override DOTESTOPT+=-c$(TEST_FPC)
 endif
 endif
 endif
 endif
-ifneq ($(OS_TARGET),$(TEST_OS_TARGET)) 
+ifneq ($(OS_TARGET),$(TEST_OS_TARGET))
 override DOTESTOPT+=-Y-T$(TEST_OS_TARGET)
 override DOTESTOPT+=-Y-T$(TEST_OS_TARGET)
 endif
 endif
-ifneq ($(OS_TARGET),$(TEST_BINUTILSPREFIX)) 
+ifneq ($(OS_TARGET),$(TEST_BINUTILSPREFIX))
 override DOTESTOPT+=-Y-XP$(TEST_BINUTILSPREFIX)
 override DOTESTOPT+=-Y-XP$(TEST_BINUTILSPREFIX)
 endif
 endif
 ifdef TEST_RSH
 ifdef TEST_RSH
@@ -1516,9 +1526,18 @@ endif
 ifdef TEST_VERBOSE
 ifdef TEST_VERBOSE
 override DOTESTOPT+=-V
 override DOTESTOPT+=-V
 endif
 endif
+ifdef TEST_REMOTEOPT
+override DOTESTOPT+="-U$(TEST_REMOTEOPT)"
+endif
+ifdef TEST_PUTTY
+override DOTESTOPT+=-R$(TEST_PUTTY) -W
+endif
 ifdef TEST_OPT
 ifdef TEST_OPT
 override DOTESTOPT+=$(addprefix -Y, $(TEST_OPT))
 override DOTESTOPT+=$(addprefix -Y, $(TEST_OPT))
 endif
 endif
+ifdef TEST_REMOTEPW
+override DOTESTOPT+=-U-pw -U$(TEST_REMOTEPW)
+endif
 ifdef GRAPH
 ifdef GRAPH
 override DOTESTOPT+=-g
 override DOTESTOPT+=-g
 endif
 endif
@@ -1571,7 +1590,7 @@ endif
 	-$(DEL) test*.txt *.tmp *$(SHAREDLIBEXT) *$(OEXT) *$(PPUEXT) core
 	-$(DEL) test*.txt *.tmp *$(SHAREDLIBEXT) *$(OEXT) *$(PPUEXT) core
 	-$(DEL) $(LOG) $(LONGLOG) $(FAILLIST)
 	-$(DEL) $(LOG) $(LONGLOG) $(FAILLIST)
 	-$(DEL) ppas$(SRCBATCHEXT) gmon.out testprep-stamp.*
 	-$(DEL) ppas$(SRCBATCHEXT) gmon.out testprep-stamp.*
-	-$(DEL) *_ppas$(BATCHEXT) 
+	-$(DEL) *_ppas$(BATCHEXT)
 clean:
 clean:
 	$(MAKE) clean_test CPU_TARGET=$(TEST_CPU_TARGET) OS_TARGET=$(TEST_OS_TARGET)
 	$(MAKE) clean_test CPU_TARGET=$(TEST_CPU_TARGET) OS_TARGET=$(TEST_OS_TARGET)
 	$(MAKE) -C units clean CPU_TARGET=$(TEST_CPU_TARGET) OS_TARGET=$(TEST_OS_TARGET)
 	$(MAKE) -C units clean CPU_TARGET=$(TEST_CPU_TARGET) OS_TARGET=$(TEST_OS_TARGET)

+ 16 - 4
tests/Makefile.fpc

@@ -106,7 +106,7 @@ endif
 #
 #
 
 
 utils:
 utils:
-        $(MAKE) -C utils 
+        $(MAKE) -C utils
 
 
 
 
 ifeq ($(USESQL),YES)
 ifeq ($(USESQL),YES)
@@ -169,10 +169,10 @@ override DOTESTOPT+=-c$(TEST_FPC)
 endif
 endif
 endif
 endif
 
 
-ifneq ($(OS_TARGET),$(TEST_OS_TARGET)) 
+ifneq ($(OS_TARGET),$(TEST_OS_TARGET))
 override DOTESTOPT+=-Y-T$(TEST_OS_TARGET)
 override DOTESTOPT+=-Y-T$(TEST_OS_TARGET)
 endif
 endif
-ifneq ($(OS_TARGET),$(TEST_BINUTILSPREFIX)) 
+ifneq ($(OS_TARGET),$(TEST_BINUTILSPREFIX))
 override DOTESTOPT+=-Y-XP$(TEST_BINUTILSPREFIX)
 override DOTESTOPT+=-Y-XP$(TEST_BINUTILSPREFIX)
 endif
 endif
 ifdef TEST_RSH
 ifdef TEST_RSH
@@ -190,12 +190,24 @@ endif
 ifdef TEST_VERBOSE
 ifdef TEST_VERBOSE
 override DOTESTOPT+=-V
 override DOTESTOPT+=-V
 endif
 endif
+ifdef TEST_REMOTEOPT
+override DOTESTOPT+="-U$(TEST_REMOTEOPT)"
+endif
+ifdef TEST_PUTTY
+override DOTESTOPT+=-R$(TEST_PUTTY) -W
+endif
 
 
 ifdef TEST_OPT
 ifdef TEST_OPT
 #  handles several options as well
 #  handles several options as well
 override DOTESTOPT+=$(addprefix -Y, $(TEST_OPT))
 override DOTESTOPT+=$(addprefix -Y, $(TEST_OPT))
 endif
 endif
 
 
+ifdef TEST_REMOTEPW
+#  handles several options as well
+override DOTESTOPT+=-U-pw -U$(TEST_REMOTEPW)
+endif
+
+
 ifdef GRAPH
 ifdef GRAPH
 override DOTESTOPT+=-g
 override DOTESTOPT+=-g
 endif
 endif
@@ -285,7 +297,7 @@ endif
         -$(DEL) $(LOG) $(LONGLOG) $(FAILLIST)
         -$(DEL) $(LOG) $(LONGLOG) $(FAILLIST)
         -$(DEL) ppas$(SRCBATCHEXT) gmon.out testprep-stamp.*
         -$(DEL) ppas$(SRCBATCHEXT) gmon.out testprep-stamp.*
 #          Needed when link on target:
 #          Needed when link on target:
-        -$(DEL) *_ppas$(BATCHEXT) 
+        -$(DEL) *_ppas$(BATCHEXT)
 
 
 
 
 clean:
 clean:

+ 9 - 2
tests/readme.txt

@@ -27,7 +27,7 @@ TARGET.............Only for these OS targets (win32,macos,etc).
                    Might be a list.
                    Might be a list.
 SKIPTARGET.........Not for these OS targets (win32,macos,etc).
 SKIPTARGET.........Not for these OS targets (win32,macos,etc).
                    Might be a list.
                    Might be a list.
-VERSION............Compiler with at lest this version number required. 
+VERSION............Compiler with at lest this version number required.
 MAXVERSION.........Compiler with at most this version number required.
 MAXVERSION.........Compiler with at most this version number required.
 RESULT.............Exit code of execution of test expected
 RESULT.............Exit code of execution of test expected
 GRAPH..............Requires graph unit
 GRAPH..............Requires graph unit
@@ -112,11 +112,18 @@ Requirements:
 Test options:
 Test options:
 TEST_RSH             set this to the hostname when you want to use rsh/rcp
 TEST_RSH             set this to the hostname when you want to use rsh/rcp
                      to execute/copy the test
                      to execute/copy the test
-TEST_SSH             set this to use ssh/scp to execute 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_REMOTEPATH      set remote path to use, default is /tmp
 TEST_DELTEMP         delete executable after running, so the remote system
 TEST_DELTEMP         delete executable after running, so the remote system
                      doesn't need much free disk space
                      doesn't need much free disk space
+TEST_REMOTEPW        pass a password with -pw to remote tools, mainly usefull for putty
+
 Example:
 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_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
 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- [email protected] TEST_REMOTEPATH=/tmp TEST_DELTEMP=1 "TEST_REMOTEPW=xxx" FPC=c:\fpc\compiler\ppc386

+ 46 - 15
tests/utils/dotest.pp

@@ -57,8 +57,10 @@ const
   DelExecutable : boolean = false;
   DelExecutable : boolean = false;
   RemoteAddr : string = '';
   RemoteAddr : string = '';
   RemotePath : string = '/tmp';
   RemotePath : string = '/tmp';
+  RemotePara : string = '';
   rshprog : string = 'rsh';
   rshprog : string = 'rsh';
   rcpprog : string = 'rcp';
   rcpprog : string = 'rcp';
+  rquote : char = '''';
 
 
 Function FileExists (Const F : String) : Boolean;
 Function FileExists (Const F : String) : Boolean;
 {
 {
@@ -560,17 +562,22 @@ var
 begin
 begin
   RunExecutable:=false;
   RunExecutable:=false;
   execres:=true;
   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');
   OutName:=ForceExtension(PPFile,'elg');
   if RemoteAddr<>'' then
   if RemoteAddr<>'' then
     begin
     begin
       { We don't want to create subdirs, remove paths from the test }
       { We don't want to create subdirs, remove paths from the test }
       TestRemoteExe:=RemotePath+'/'+SplitFileName(TestExe);
       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
       { rsh doesn't pass the exitcode, use a second command to print the exitcode
         on the remoteshell to stdout }
         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 }
       { Check for TestExitCode error in output, sets ExecuteResult }
       CheckTestExitCode(OutName);
       CheckTestExitCode(OutName);
     end
     end
@@ -632,7 +639,7 @@ begin
     begin
     begin
       Verbose(V_Debug,'Deleting executable '+TestExe);
       Verbose(V_Debug,'Deleting executable '+TestExe);
       if RemoteAddr<>'' then
       if RemoteAddr<>'' then
-        ExecuteRemote(rshprog,RemoteAddr+' rm -f '+TestRemoteExe);
+        ExecuteRemote(rshprog,RemotePara+' '+RemoteAddr+' rm -f '+TestRemoteExe);
       RemoveFile(TestExe);
       RemoveFile(TestExe);
       RemoveFile(ForceExtension(TestExe,ObjExt));
       RemoveFile(ForceExtension(TestExe,ObjExt));
       RemoveFile(ForceExtension(TestExe,PPUExt));
       RemoveFile(ForceExtension(TestExe,PPUExt));
@@ -661,8 +668,12 @@ var
     writeln('  -I            include interactive tests');
     writeln('  -I            include interactive tests');
     writeln('  -R<remote>    run the tests remotely with the given rsh/ssh address');
     writeln('  -R<remote>    run the tests remotely with the given rsh/ssh address');
     writeln('  -S            use ssh instead of rsh');
     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('  -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.');
     writeln('  -Y<opts>      extra options passed to the compiler. Several -Y<opt> can be given.');
     halt(1);
     halt(1);
   end;
   end;
@@ -688,41 +699,57 @@ begin
              DoKnown:=true;
              DoKnown:=true;
              DoAll:=true;
              DoAll:=true;
            end;
            end;
+
          'C' : CompilerBin:=Para;
          'C' : CompilerBin:=Para;
+
          'E' : DoExecute:=true;
          'E' : DoExecute:=true;
+
          'G' : begin
          'G' : begin
                  DoGraph:=true;
                  DoGraph:=true;
                  if para='-' then
                  if para='-' then
                    DoUsual:=false;
                    DoUsual:=false;
                end;
                end;
+
          'I' : begin
          'I' : begin
                  DoInteractive:=true;
                  DoInteractive:=true;
                  if para='-' then
                  if para='-' then
                    DoUsual:=false;
                    DoUsual:=false;
                end;
                end;
+
          'K' : begin
          'K' : begin
                  DoKnown:=true;
                  DoKnown:=true;
                  if para='-' then
                  if para='-' then
                    DoUsual:=false;
                    DoUsual:=false;
                end;
                end;
-         'V' : DoVerbose:=true;
-
-         'X' : UseComSpec:=false;
 
 
          'P' : RemotePath:=Para;
          'P' : RemotePath:=Para;
 
 
-         'Y' : ExtraCompilerOpts:= ExtraCompilerOpts +' '+ Para;
-
          'R' : RemoteAddr:=Para;
          'R' : RemoteAddr:=Para;
 
 
-         'T' :
-           DelExecutable:=true;
-
          'S' :
          'S' :
            begin
            begin
              rshprog:='ssh';
              rshprog:='ssh';
              rcpprog:='scp';
              rcpprog:='scp';
            end;
            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;
      end
      end
     else
     else
@@ -946,7 +973,11 @@ begin
 end.
 end.
 {
 {
   $Log$
   $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.
     * print exitcode of remote test to stdout and parse the output file.
       this is the most reliable passing of the exitcode
       this is the most reliable passing of the exitcode