Browse Source

* more tests

pierre 27 years ago
parent
commit
636ad3ddee
6 changed files with 74 additions and 13 deletions
  1. 4 1
      tests/README
  2. 13 10
      tests/makefile
  3. 1 1
      tests/readme.txt
  4. 1 1
      tests/ts010006.pp
  5. 36 0
      tests/ts010019.pp
  6. 19 0
      tests/ts010021.pp

+ 4 - 1
tests/README

@@ -27,7 +27,10 @@ ts010015.pp       tests typed files.
 ts010016.pp       tests conversion of smallsets in normsets in consts 
 ts010017.pp       tests the problem of iocheck inside iocheck routines
 ts010018.pp       tests the problem of enums inside objects
-
+ts010019.pp	  tests problems of name mangling
+ts010020.pp	  tests for const strings problems if const is a single char.
+ts010021.pp	  test for long mangled names (they are strings, ie no longer then
+		  255 chars (but they have to be allways shorten the same way !!)
 ts10100.pp        tests for delphi object model
 -
 ts101xx.pp

+ 13 - 10
tests/makefile

@@ -4,7 +4,9 @@
 # make all test
 # and printout errors
 
-all : clean all_compilations
+all : info
+
+tests : clean all_compilations
 
 ifdef DJGPP
 
@@ -47,7 +49,7 @@ else
 testsuccess:
 	@echo Test for $(FILE) fails (does not compile) error $(RETVAL)
 	@echo Test for $(FILE) fails (does not compile) error $(RETVAL)>>log
-	@echo $(FILE) >> ts_list
+	@echo $(FILE) >> ts_fail
 	@echo $(FILE) >> faillist
 endif
 	
@@ -100,7 +102,7 @@ else
 testfail:
 	@echo Test for $(FILE) fails (does compile and should not)
 	@echo Test for $(FILE) fails (does compile and should not) >> log
-	@echo $(FILE) >> tf_list
+	@echo $(FILE) >> tf_fail
 	@echo $(FILE) >> faillist
 endif
 	
@@ -180,7 +182,7 @@ endif
 clean_fail :
 	-rm $(addsuffix .res,$(TS_FAIL_LIST)) 
 	-rm $(addsuffix .ref,$(TF_FAIL_LIST)) 
-	-rm log
+	-rm log 
 
 again : clean_fail $(addsuffix .res,$(TS_FAIL_LIST)) \
 	$(addsuffix .ref,$(TF_FAIL_LIST)) 
@@ -190,6 +192,7 @@ all_compilations : allts alltbs alltf alltbf allto alltest alltesi alltis
 	grep fails log
 
 allexec : alltsexec alltbsexec alltestexec
+	grep "fails exec" log
 
 alltestexec: $(patsubst %.pp,%.elg,$(wildcard test*.pp)) 
 
@@ -204,7 +207,7 @@ alltbsexec: $(patsubst %.pp,%.elg,$(wildcard tbs*.pp))
 alltisexec: $(patsubst %.pp,%.eli,$(wildcard tis*.pp)) 
 
 clean :
-	-rm *.re* *.o *.ppu *.elg ts*.exe tf*.exe log faillist ts_fail tf_fail
+	-rm *.re* *.o *.ppu *.log *.elg *.exc t*.exe log faillist ts_fail tf_fail
 
 info :
 	@echo This Makefile allows to test the compiler
@@ -212,16 +215,16 @@ info :
 	@echo compilation of 'tf*.pp' should fail
 	@echo compilation of 'test*.pp' should succeed
 	@echo 'to*.pp' files should also compile
-	@echo simply run \'make\' to test all compilation
+	@echo simply run \'make tests\' to test all compilation
 	@echo run \'make allexec\' to test also if the executables
 	@echo created behave like the should
 	@echo run \'make tesiexec\' to test executables 
 	@echo that require interactive mode
-	@echo To add a test file
-	@echo for 'ts*.pp' the created program should call halt or runerror
-	@echo if the code is wrong
 # $Log$
-# Revision 1.8  1998-10-28 09:52:26  pierre
+# Revision 1.9  1998-11-10 11:13:07  pierre
+#  * more tests
+#
+# Revision 1.8  1998/10/28 09:52:26  pierre
 #  * see readme.txt
 #
 # Revision 1.7  1998/10/22 16:41:11  pierre

+ 1 - 1
tests/readme.txt

@@ -4,7 +4,7 @@
   with compilation and execution tests.
 
   Standard way :
-  'make all' will try to compile all the sources
+  'make tests' will try to compile all the sources
    will printout a list of errors
   - programs that do not compile but should
   - programs that do compile when they should create an error !

+ 1 - 1
tests/ts010006.pp

@@ -1,4 +1,4 @@
-{ $OPT=-S2 -Tos2 }
+{ $OPT= -Twin32 }
 library test;
 
   procedure exporttest;export;

+ 36 - 0
tests/ts010019.pp

@@ -0,0 +1,36 @@
+  procedure test;
+
+    function a : longint;
+      begin
+         a:=1;
+      end;
+
+    begin
+       writeln('a = ',a);
+    end;
+
+  procedure test(b : byte);
+
+    function a : longint;
+      begin
+         a:=2;
+      end;
+
+    begin
+       writeln('b = ',b);
+       writeln('a = ',a);
+    end;
+
+  type a = word;
+ 
+  function test_(b : a) : longint;
+    begin
+      test_:=b;
+    end;
+
+begin
+   test(1);
+   test;
+   test(4);
+end.
+

+ 19 - 0
tests/ts010021.pp

@@ -0,0 +1,19 @@
+{ $OPT=-g }
+{ the debug info created problems for very long mangled names
+  because the manglednames where shorten differently (PM)
+  fixed in v 0.99.9 }
+program ts010021;
+
+var i : longint;
+
+   type very_very_very_long_integer = longint;
+
+  function ugly(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p : 
+                very_very_very_long_integer) : longint;
+  
+    begin
+       ugly:=0;
+    end;
+
+begin
+end.