Browse Source

* Remove limitations to 255 chars of shortstrings
* Better handle relative remotepath:
- use cd to go to this path,
- but call executable using only ./execfilename
* Keep .exe suffix for cygwin style ssh for go32v2, win32 or win64 targets

git-svn-id: trunk@16905 -

pierre 14 years ago
parent
commit
acb2aca3d0
1 changed files with 18 additions and 9 deletions
  1. 18 9
      tests/utils/dotest.pp

+ 18 - 9
tests/utils/dotest.pp

@@ -296,7 +296,7 @@ begin
   while (j>0) and (Hstr[j]<>'.') do
   while (j>0) and (Hstr[j]<>'.') do
    dec(j);
    dec(j);
   if j=0 then
   if j=0 then
-   j:=255;
+   j:=length(Hstr);
   if Ext<>'' then
   if Ext<>'' then
    ForceExtension:=Copy(Hstr,1,j-1)+'.'+Ext
    ForceExtension:=Copy(Hstr,1,j-1)+'.'+Ext
   else
   else
@@ -804,7 +804,7 @@ var
   TestRemoteExe,
   TestRemoteExe,
   TestExe  : string;
   TestExe  : string;
   LocalFile, RemoteFile: string;
   LocalFile, RemoteFile: string;
-  LocalPath: string;
+  LocalPath, LTarget : string;
   execcmd,
   execcmd,
   pref     : string;
   pref     : string;
   execres  : boolean;
   execres  : boolean;
@@ -843,8 +843,16 @@ label
 begin
 begin
   RunExecutable:=false;
   RunExecutable:=false;
   execres:=true;
   execres:=true;
-  { when remote testing, leave extension away }
-  if (RemoteAddr='') or (rcpprog='pscp') then
+  { when remote testing, leave extension away,
+    but not for go32v2, win32 or win64 as cygwin ssh
+    will remove the .exe in that case }
+  LTarget := lowercase(CompilerTarget);
+
+  if (RemoteAddr='') or
+     (rcpprog='pscp') or
+     (LTarget='go32v2') or
+     (LTarget='win32') or
+     (LTarget='win64') then
     TestExe:=OutputFileName(PPFile[current],ExeExt)
     TestExe:=OutputFileName(PPFile[current],ExeExt)
   else
   else
     TestExe:=OutputFileName(PPFile[current],'');
     TestExe:=OutputFileName(PPFile[current],'');
@@ -912,9 +920,8 @@ begin
       else
       else
         execcmd:='';
         execcmd:='';
       execcmd:=execcmd+RemotePara+' '+RemoteAddr+' '+rquote+
       execcmd:=execcmd+RemotePara+' '+RemoteAddr+' '+rquote+
-         'chmod 755 '+TestRemoteExe+' ; ';
-       //  ' ; cd '+RemotePath+' ;'; incompatible with directory
-       // present on TestRemoteExe
+         'chmod 755 '+TestRemoteExe+
+          ' ; cd '+RemotePath+' ; ';
       if UseTimeout then
       if UseTimeout then
       begin
       begin
         execcmd:=execcmd+'timeout -9 ';
         execcmd:=execcmd+'timeout -9 ';
@@ -923,8 +930,10 @@ begin
         str(Config.Timeout,s);
         str(Config.Timeout,s);
         execcmd:=execcmd+s;
         execcmd:=execcmd+s;
       end;
       end;
+      { as we moved to RemotePath, if path is not absolute
+        we need to use ./execfilename only }
       if not isabsolute(TestRemoteExe) then
       if not isabsolute(TestRemoteExe) then
-        execcmd:=execcmd+' ./'+TestRemoteExe
+        execcmd:=execcmd+' ./'+SplitFileName(TestRemoteExe)
       else
       else
         execcmd:=execcmd+' '+TestRemoteExe;
         execcmd:=execcmd+' '+TestRemoteExe;
       execcmd:=execcmd+' ; echo "TestExitCode: $?"';
       execcmd:=execcmd+' ; echo "TestExitCode: $?"';
@@ -1130,7 +1139,7 @@ begin
              if j>0 then
              if j>0 then
                begin
                begin
                  CompilerCPU:=Copy(Para,1,j-1);
                  CompilerCPU:=Copy(Para,1,j-1);
-                 CompilerTarget:=Copy(Para,j+1,255);
+                 CompilerTarget:=Copy(Para,j+1,length(para));
                end
                end
              else
              else
                CompilerTarget:=Para
                CompilerTarget:=Para