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 
 ts010016.pp       tests conversion of smallsets in normsets in consts 
 ts010017.pp       tests the problem of iocheck inside iocheck routines
 ts010017.pp       tests the problem of iocheck inside iocheck routines
 ts010018.pp       tests the problem of enums inside objects
 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
 ts10100.pp        tests for delphi object model
 -
 -
 ts101xx.pp
 ts101xx.pp

+ 13 - 10
tests/makefile

@@ -4,7 +4,9 @@
 # make all test
 # make all test
 # and printout errors
 # and printout errors
 
 
-all : clean all_compilations
+all : info
+
+tests : clean all_compilations
 
 
 ifdef DJGPP
 ifdef DJGPP
 
 
@@ -47,7 +49,7 @@ else
 testsuccess:
 testsuccess:
 	@echo Test for $(FILE) fails (does not compile) error $(RETVAL)
 	@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)>>log
-	@echo $(FILE) >> ts_list
+	@echo $(FILE) >> ts_fail
 	@echo $(FILE) >> faillist
 	@echo $(FILE) >> faillist
 endif
 endif
 	
 	
@@ -100,7 +102,7 @@ else
 testfail:
 testfail:
 	@echo Test for $(FILE) fails (does compile and should not)
 	@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) >> log
-	@echo $(FILE) >> tf_list
+	@echo $(FILE) >> tf_fail
 	@echo $(FILE) >> faillist
 	@echo $(FILE) >> faillist
 endif
 endif
 	
 	
@@ -180,7 +182,7 @@ endif
 clean_fail :
 clean_fail :
 	-rm $(addsuffix .res,$(TS_FAIL_LIST)) 
 	-rm $(addsuffix .res,$(TS_FAIL_LIST)) 
 	-rm $(addsuffix .ref,$(TF_FAIL_LIST)) 
 	-rm $(addsuffix .ref,$(TF_FAIL_LIST)) 
-	-rm log
+	-rm log 
 
 
 again : clean_fail $(addsuffix .res,$(TS_FAIL_LIST)) \
 again : clean_fail $(addsuffix .res,$(TS_FAIL_LIST)) \
 	$(addsuffix .ref,$(TF_FAIL_LIST)) 
 	$(addsuffix .ref,$(TF_FAIL_LIST)) 
@@ -190,6 +192,7 @@ all_compilations : allts alltbs alltf alltbf allto alltest alltesi alltis
 	grep fails log
 	grep fails log
 
 
 allexec : alltsexec alltbsexec alltestexec
 allexec : alltsexec alltbsexec alltestexec
+	grep "fails exec" log
 
 
 alltestexec: $(patsubst %.pp,%.elg,$(wildcard test*.pp)) 
 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)) 
 alltisexec: $(patsubst %.pp,%.eli,$(wildcard tis*.pp)) 
 
 
 clean :
 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 :
 info :
 	@echo This Makefile allows to test the compiler
 	@echo This Makefile allows to test the compiler
@@ -212,16 +215,16 @@ info :
 	@echo compilation of 'tf*.pp' should fail
 	@echo compilation of 'tf*.pp' should fail
 	@echo compilation of 'test*.pp' should succeed
 	@echo compilation of 'test*.pp' should succeed
 	@echo 'to*.pp' files should also compile
 	@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 run \'make allexec\' to test also if the executables
 	@echo created behave like the should
 	@echo created behave like the should
 	@echo run \'make tesiexec\' to test executables 
 	@echo run \'make tesiexec\' to test executables 
 	@echo that require interactive mode
 	@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$
 # $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
 #  * see readme.txt
 #
 #
 # Revision 1.7  1998/10/22 16:41:11  pierre
 # Revision 1.7  1998/10/22 16:41:11  pierre

+ 1 - 1
tests/readme.txt

@@ -4,7 +4,7 @@
   with compilation and execution tests.
   with compilation and execution tests.
 
 
   Standard way :
   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
    will printout a list of errors
   - programs that do not compile but should
   - programs that do not compile but should
   - programs that do compile when they should create an error !
   - 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;
 library test;
 
 
   procedure exporttest;export;
   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.