Browse Source

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

florian 21 years ago
parent
commit
1b78804998
4 changed files with 96 additions and 27 deletions
  1. 25 6
      tests/Makefile
  2. 16 4
      tests/Makefile.fpc
  3. 9 2
      tests/readme.txt
  4. 46 15
      tests/utils/dotest.pp

+ 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
-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),)
@@ -1461,7 +1471,7 @@ NOGRAPH=1
 endif
 .PHONY: utils units copyfiles testprep
 utils:
-	$(MAKE) -C utils 
+	$(MAKE) -C utils
 ifeq ($(USESQL),YES)
 ifndef DBDIGEST
 DBDIGEST=utils/dbdigest
@@ -1495,10 +1505,10 @@ ifeq ($(findstring -c$(TEST_FPC),$(DOTESTOPT)),)
 override DOTESTOPT+=-c$(TEST_FPC)
 endif
 endif
-ifneq ($(OS_TARGET),$(TEST_OS_TARGET)) 
+ifneq ($(OS_TARGET),$(TEST_OS_TARGET))
 override DOTESTOPT+=-Y-T$(TEST_OS_TARGET)
 endif
-ifneq ($(OS_TARGET),$(TEST_BINUTILSPREFIX)) 
+ifneq ($(OS_TARGET),$(TEST_BINUTILSPREFIX))
 override DOTESTOPT+=-Y-XP$(TEST_BINUTILSPREFIX)
 endif
 ifdef TEST_RSH
@@ -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
@@ -1571,7 +1590,7 @@ endif
 	-$(DEL) test*.txt *.tmp *$(SHAREDLIBEXT) *$(OEXT) *$(PPUEXT) core
 	-$(DEL) $(LOG) $(LONGLOG) $(FAILLIST)
 	-$(DEL) ppas$(SRCBATCHEXT) gmon.out testprep-stamp.*
-	-$(DEL) *_ppas$(BATCHEXT) 
+	-$(DEL) *_ppas$(BATCHEXT)
 clean:
 	$(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)

+ 16 - 4
tests/Makefile.fpc

@@ -106,7 +106,7 @@ endif
 #
 
 utils:
-        $(MAKE) -C utils 
+        $(MAKE) -C utils
 
 
 ifeq ($(USESQL),YES)
@@ -169,10 +169,10 @@ override DOTESTOPT+=-c$(TEST_FPC)
 endif
 endif
 
-ifneq ($(OS_TARGET),$(TEST_OS_TARGET)) 
+ifneq ($(OS_TARGET),$(TEST_OS_TARGET))
 override DOTESTOPT+=-Y-T$(TEST_OS_TARGET)
 endif
-ifneq ($(OS_TARGET),$(TEST_BINUTILSPREFIX)) 
+ifneq ($(OS_TARGET),$(TEST_BINUTILSPREFIX))
 override DOTESTOPT+=-Y-XP$(TEST_BINUTILSPREFIX)
 endif
 ifdef TEST_RSH
@@ -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
@@ -285,7 +297,7 @@ endif
         -$(DEL) $(LOG) $(LONGLOG) $(FAILLIST)
         -$(DEL) ppas$(SRCBATCHEXT) gmon.out testprep-stamp.*
 #          Needed when link on target:
-        -$(DEL) *_ppas$(BATCHEXT) 
+        -$(DEL) *_ppas$(BATCHEXT)
 
 
 clean:

+ 9 - 2
tests/readme.txt

@@ -27,7 +27,7 @@ TARGET.............Only for these OS targets (win32,macos,etc).
                    Might be a list.
 SKIPTARGET.........Not for these OS targets (win32,macos,etc).
                    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.
 RESULT.............Exit code of execution of test expected
 GRAPH..............Requires graph unit
@@ -112,11 +112,18 @@ Requirements:
 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_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- [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;
   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