Browse Source

* linux updates

peter 26 years ago
parent
commit
91070d3da1
11 changed files with 100 additions and 50 deletions
  1. 22 18
      tests/Makefile
  2. 1 1
      tests/tbs0102.pp
  3. 4 1
      tests/tbs0104.pp
  4. 4 3
      tests/tbs0105.pp
  5. 3 0
      tests/tbs0107.pp
  6. 1 1
      tests/tbs0123.pp
  7. 3 4
      tests/tbs0124.pp
  8. 7 7
      tests/tbs0187.pp
  9. 1 0
      tests/tbs0198.pp
  10. 15 12
      tests/tesirand.pp
  11. 39 3
      tests/teststr.pp

+ 22 - 18
tests/makefile → tests/Makefile

@@ -20,9 +20,9 @@ else
 
 EXEEXT=
 getreturncode : 
-	getret $(COMMAND) !> $(FILE).log !2>$(FILE).log
+	getret $(COMMAND) > $(FILE).log 2>$(FILE).log
 	cp retcode $(FILE).$(RESEXT)
-	@echo Return code of $(FILE) is $(cat retcode)
+	@echo "Return code of $(FILE) is $(cat retcode)"
 endif
 	
 
@@ -43,12 +43,12 @@ endif
 
 ifeq ($(RETVAL),0)
 testsuccess:
-	@echo Test for $(FILE) success (compiles)
-	@echo Test for $(FILE) success (compiles) >>log
+	@echo "Test for $(FILE) success (compiles)"
+	@echo "Test for $(FILE) success (compiles)" >>log
 else
 testsuccess:
-	@echo Test for $(FILE) fails (does not compile) error $(RETVAL)
-	@echo Test for $(FILE) fails (does not compile) error $(RETVAL)>>log
+	@echo "Test for $(FILE) fails (does not compile) error $(RETVAL)"
+	@echo "Test for $(FILE) fails (does not compile) error $(RETVAL)" >>log
 	@echo $(FILE) >> ts_fail
 	@echo $(FILE) >> faillist
 endif
@@ -65,17 +65,17 @@ endif
 
 ifeq ($(EXERETVAL),0)
 testexecsuccess:
-	@echo Test for exec $(FILE) success (runs without error)
-	@echo Test for $(FILE) success (runs without error) >>log
+	@echo "Test for exec $(FILE) success (runs without error)"
+	@echo "Test for $(FILE) success (runs without error)" >>log
 else
 testexecsuccess:
-	@echo Test for exec $(FILE) fails exec error $(EXERETVAL)
-	@echo Test for exec $(FILE) fails exec error $(EXERETVAL)>>log
+	@echo "Test for exec $(FILE) fails exec error $(EXERETVAL)"
+	@echo "Test for exec $(FILE) fails exec error $(EXERETVAL)" >>log
 endif
 	
 ifeq ($(wildcard $(FILE)$(EXEEXT)*),$(FILE)$(EXEEXT))
 testexec:
-	@echo Testing $(FILE)$(EXEEXT)
+	@echo "Testing $(FILE)$(EXEEXT)"
 ifdef NOREDIR
 	getret $(FILE)$(EXEEXT)
 else
@@ -85,7 +85,7 @@ endif
 	$(MAKE) testexecsuccess 'FILE=$(FILE)' 'EXCFILE=$(FILE).exc'
 else
 testexec:
-	@echo No exefile $(FILE)$(EXEEXT)
+	@echo "No exefile $(FILE)$(EXEEXT)"
 	@echo $(FILE) >> faillist
 endif
 
@@ -96,12 +96,12 @@ test_exc :
 	
 ifneq ($(RETVAL),0)
 testfail:
-	@echo Test for $(FILE) success (does not compile) error $(RETVAL)
-	@echo Test for $(FILE) success (does not compile) error $(RETVAL)>> log
+	@echo "Test for $(FILE) success (does not compile) error $(RETVAL)"
+	@echo "Test for $(FILE) success (does not compile) error $(RETVAL)" >> log
 else
 testfail:
-	@echo Test for $(FILE) fails (does compile and should not)
-	@echo Test for $(FILE) fails (does compile and should not) >> log
+	@echo "Test for $(FILE) fails (does compile and should not)"
+	@echo "Test for $(FILE) fails (does compile and should not)" >> log
 	@echo $(FILE) >> tf_fail
 	@echo $(FILE) >> faillist
 endif
@@ -219,8 +219,13 @@ info :
 	@echo created behave like the should
 	@echo run \'make tesiexec\' to test executables 
 	@echo that require interactive mode
+
+#
 # $Log$
-# Revision 1.12  1999-01-19 18:01:43  pierre
+# Revision 1.1  1999-01-25 20:23:04  peter
+#   * linux updates
+#
+# Revision 1.12  1999/01/19 18:01:43  pierre
 #  local change removed
 #
 # Revision 1.11  1999/01/19 17:34:01  pierre
@@ -254,4 +259,3 @@ info :
 # Revision 1.3  1998/10/21 12:12:09  pierre
 # Log inserted
 #
-

+ 1 - 1
tests/tbs0102.pp

@@ -1,4 +1,4 @@
-{$OPT= -Tamiga}
+{ $OPT= -Tamiga }
 
 unit tbs0102;
   interface

+ 4 - 1
tests/tbs0104.pp

@@ -1,5 +1,8 @@
+{$ifdef go32v2}
 uses
    dpmiexcp;
+{$endif}
+
 { Two cardinal type bugs }
 var
   c : cardinal;
@@ -9,5 +12,5 @@ begin
   c:=$80001234;
   writeln(c);
   c:=$ffffffff;
-  writeln(c); 
+  writeln(c);
 end.

+ 4 - 3
tests/tbs0105.pp

@@ -10,18 +10,19 @@
  uses linux;
 {$endif linux}
 
-  function our_sig(l : longint) : longint;
+  function our_sig(l : longint) : longint;{$ifdef linux}cdecl;{$endif}
     begin
        { If we land here the program works correctly !! }
        Writeln('Bound check error signal recieved');
+       our_sig:=0;
        Halt(0);
     end;
-    
+
 Var
  Sel: Word;
  v: longint;
 Begin
- Signal(SIGSEGV,our_sig);
+ Signal(SIGSEGV,signalhandler(our_sig));
  v:=$00ffffff;
  Sel:=word(v);
  writeln(sel);

+ 3 - 0
tests/tbs0107.pp

@@ -3,8 +3,11 @@
 
 Program Test1;
 
+{$ifdef go32v2}
 uses
    dpmiexcp;
+{$endif}
+
 type
  myObject = object
    constructor init;

+ 1 - 1
tests/tbs0123.pp

@@ -1,5 +1,5 @@
-{$I386_INTEL}
 begin
+{$asmmode intel}
    asm
       SHRD [ESI-8], EAX, CL
    end;

+ 3 - 4
tests/tbs0124.pp

@@ -1,12 +1,11 @@
-{$I386_INTEL}
-{ Compile with -Rintel switch }
 var
  l : longint;
 begin
+{$asmmode intel}
  { problem here is that l is replaced by BP-offset     }
  { relative to stack, and the parser thinks all wrong  }
  { because of this.                                    }
  asm
-   mov eax, [eax*4+l]    
+   mov eax, [eax*4+l]
  end;
-end. 
+end.

+ 7 - 7
tests/tbs0187.pp

@@ -1,4 +1,4 @@
-{ $OPT=-Cr }
+{ $OPT=-St -Cr }
 program test;
 
 {$ifdef go32v2}
@@ -61,7 +61,7 @@ end;
   var other1 : TOtherClass;
   begin
      with other1 do
-          Init;  
+          Init;
      with base1 do
           Init;
      with other1 do
@@ -69,21 +69,21 @@ end;
            Writeln('number of objects = ',st_count);
            base_arg:=2;
            other_arg:=6;
-           Run;  
+           Run;
         end;
      { test if changed !! }
-     
+
      if (other1.base_arg<>2) or (other1.other_arg<>6) then
        Halt(1);
-       
+
      with base1 do
         begin
-           Run;  
+           Run;
            Done;
         end;
      other1.done;
    end;
-  
+
 var     base            : Tbaseclass;
         other           : Totherclass;
         testfield       : longint;

+ 1 - 0
tests/tbs0198.pp

@@ -1,3 +1,4 @@
+{$mode objfpc}
 type
    to1 = class
        function GetCaps1 : Longint;virtual;abstract;

+ 15 - 12
tests/tesirand.pp

@@ -19,24 +19,24 @@ uses
   dpmiexcp,
 {$endif go32v2}
    graph;
-   
+
 
 const max = 1000;
       maxint = 10000*max;
-      
+
 
 var x : array[0..max-1] of longint;
     y : array[-100..100] of longint;
-    
+
     mean,level,i : longint;
     maxcount,delta,maximum,minimum : longint;
     st,st2 : string;
     gm,gd : integer;
     color : longint;
-    
+
 begin
 
-{$ifdef FPC}
+{$ifdef go32v2}
    gm:=G640x400x256;
    gd:=$ff;
 {$else }
@@ -50,10 +50,10 @@ begin
    color:=blue;
 
    mean:=maxint div max;
-   
+
    for level:=0 to 10 do
      begin
-     
+
         for i:=0 to max-1 do
           x[i]:=0;
         for i:=-100 to 100 do
@@ -93,9 +93,9 @@ begin
             maxcount:=y[i];
         if maxcount=0 then
           inc(maxcount);
-          
+
         OutTextXY(GetMaxX div 2,GetMaxY-30,'Random Test Program');
-        
+
         str(level,st);
         st:='Level '+st;
         OutTextXY(30,GetMaxY-60,st);
@@ -103,7 +103,7 @@ begin
         str(minimum,st2);
         st:='Maximum = '+st+' Minimum ='+st2;
         OutTextXY(30,GetMaxY-30,st);
-        
+
         for i:=0 to max-1 do
           putpixel( (i*getmaxX) div max,
             GetMaxY-(x[i]*getMaxY) div (2*mean), color);
@@ -127,10 +127,13 @@ begin
      end;
    CloseGraph;
 end.
-        
+
 {
   $Log$
-  Revision 1.2  1998-11-23 23:44:52  pierre
+  Revision 1.3  1999-01-25 20:23:13  peter
+    * linux updates
+
+  Revision 1.2  1998/11/23 23:44:52  pierre
    + several bugs converted
 
 }

+ 39 - 3
tests/teststr.pp

@@ -1,10 +1,47 @@
 { $OPT=-Fu../rtl/utils
   $Id$
-  
+
   Program to test string functions and speed of the functions
 }
 program TestStr;
+{$ifdef timer}
 uses Timer;
+{$else}
+type
+  TTimer = Object
+    TotalMSec,
+    StartMSec : longint;
+    constructor init;
+    procedure reset;
+    procedure start;
+    procedure stop;
+    Function MSec:longint;
+  end;
+
+procedure TTimer.Reset;
+begin
+end;
+
+procedure TTimer.Start;
+begin
+end;
+
+
+procedure TTimer.Stop;
+begin
+end;
+
+
+Function TTimer.MSec:longint;
+begin
+  MSec:=0;
+end;
+
+Constructor TTimer.Init;
+begin
+end;
+
+{$endif}
 
 const
   TestSize=10; {Use at least 10 for reasonable results}
@@ -22,7 +59,6 @@ var
   MixBen     : BenType;
   t          : TTimer;
 
-
 function TestOK:boolean;
 Const
   TestStr: string[22]='HELLO, THIS IS A TEST ';
@@ -87,7 +123,7 @@ procedure TestSpeed(Row,Len:byte);
 var
   l      : longint;
   hstr,
-  OrgStr : string;
+  OrgStr : string[10];
 begin
   HeadBen[Row]:=Len;
   OrgStr:='';