Add new error case
[mono.git] / mcs / btests / Makefile
1 thisdir = btests
2 SUBDIRS = 
3 TEST_RUNTIME = mono
4 COMPILER_FLAGS = /libpath:../class/lib/default/ /imports:System
5 INTERNAL_MBAS = $(TEST_RUNTIME) --debug ../mbas/mbas.exe --stacktrace $(COMPILER_FLAGS)
6 LIBRARY_OPT = /target:library
7 SUPPORT_DLLS = /r:./Dll1.dll,./Override_dll.dll,./Delegate_dll.dll,./Event_dll.dll,./OptionalArgu_dll.dll
8 #INTERNAL_MBAS = vbc $(COMPILER_FLAGS)
9 all: test-compiler-jit 
10
11 # removed this cause INTERNAL_MBAS now getting set in 
12 # rules.make which is conflicting with this instance of 
13 # INTERNAL_MBAS
14 #include ../build/rules.make
15
16 DISTFILES = README.tests $(wildcard *.vb)
17
18 # We don't want debugging info :-)
19 USE_MCS_FLAGS :=
20
21 # include the test cases source file
22 include Test.Sources
23
24 # A test is a 'no pass' if it fails on either windows or linux
25
26 #TEST_NOPASS = \
27
28 all-local install-local:
29
30 # compilation is part of the testing too, so we don't actually 
31 # do anything in test-local.
32 #  echo "Inside loop" ; \
33 #  echo $$i | sed -e 's/\*//' | >> $$target; \ 
34 #  echo $$target; \
35
36 test-local: 
37
38
39 run-test-local: test-compiler-jit 
40
41
42 test-compiler-jit: test-compiler-jit-real test-compiler-jit-ngtive_compile \
43 test-compiler-jit-ngtive_run
44
45 TEST_TAG = mbas-positive
46
47 test-dlls:
48         @logpath=./logs ; mkdir -p $$logpath ; \
49         logfile="$$logpath/$(TEST_TAG).results"; \
50         rm -f *.dll $$logpath/$(TEST_TAG).results $$logpath/$(TEST_TAG)-*.log ; \
51         echo "********** Support DLLs ************" > $$logfile ; \
52         echo "********** Support DLLs ************" ; \
53         for i in $(TEST_DLL_SOURCES) ; do \
54             echo -n -e "========================\n$$i: " >> $$logfile; \
55             testlogfile="$$logpath/$(TEST_TAG)-$$i.log" ; \
56             echo -n "$$i: "; \
57             echo "*** $(INTERNAL_MBAS) $(LIBRARY_OPT) $$i.vb" > $$testlogfile ; \
58             if $(INTERNAL_MBAS) $(LIBRARY_OPT)  $$i.vb >> $$testlogfile 2>&1 ; then \
59                 echo "COMPILED OK  " ; \
60             else \
61                 echo "Exit code: $$?" >> $$testlogfile ; \
62                 failed="$$failed $$i" ; \
63                 echo "FAILED: $$i: COMPILATION" >> $$logfile; \
64                 echo FAILED COMPILATION ; \
65                 continue; \
66             fi ; \
67         done ; 
68
69 test-compiler-jit-real: test-dlls
70         @logpath=./logs ; mkdir -p $$logpath ; \
71         logfile="$$logpath/$(TEST_TAG).results"; \
72         rm -f *.exe ; \
73         echo "********** Positive Tests ************" >> $$logfile ; \
74         echo "********** Positive Tests ************" ; \
75         for i in $(TEST_SOURCES) ; do \
76             targetexe=`echo "$$i" |sed -e 's,\*,,'` ; \
77             echo -n -e "========================\n$$i: " >> $$logfile; \
78             testlogfile="$$logpath/$(TEST_TAG)-$$targetexe.log" ; \
79             echo -n "$$i: "; \
80             echo "*** $(INTERNAL_MBAS) $(SUPPORT_DLLS) $$i.vb" > $$testlogfile ; \
81             if $(INTERNAL_MBAS) $(SUPPORT_DLLS) /o:$$targetexe.exe $$i.vb >> $$testlogfile 2>&1 ; then \
82                 echo -n "COMPILED OK : " ; \
83             else \
84                 echo "Exit code: $$?" >> $$testlogfile ; \
85                 failed="$$failed $$i" ; \
86                 echo "FAILED: $$i: COMPILATION" >> $$logfile; \
87                 echo FAILED COMPILATION ; \
88                 continue; \
89             fi ; \
90             echo "*** $(TEST_RUNTIME) ./$$targetexe.exe" >> $$testlogfile ; \
91             if $(TEST_RUNTIME) ./$$targetexe.exe >> $$testlogfile 2>&1 ; then \
92                 echo "EXECUTED OK: $$i" >> $$logfile ; \
93                 echo "EXECUTED OK" ; rm -f $$testlogfile ; \
94             else \
95                 echo "$$i : FAILED AT RUNTIME Exit code: $$?" >> $$testlogfile ; \
96                 failed="$$failed $$i" ; \
97                 echo "FAILED AT RUNTIME"; \
98             fi ; \
99             rm -f ./$$targetexe.exe ; \
100         done ; \
101
102 test-compiler-jit-ngtive_compile: TEST_TAG = mbas-negative-compile
103 test-compiler-jit-ngtive_compile: 
104         @logpath=./logs ; mkdir -p $$logpath; \
105         logfile="$$logpath/$(TEST_TAG).results"; \
106         rm -f *.exe $$logpath/$(TEST_TAG).results $$logpath/$(TEST_TAG)-*.log ; \
107         echo "********** Negative Compilation Tests ************" >> $$logfile; \
108         echo "********** Negative Compilation Tests ************" ; \
109         for i in $(TEST_NGTIVE_COMPILATION_SOURCES) ; do \
110             echo -n -e "========================\n$$i: " >> $$logfile; \
111             testlogfile="$$logpath/$(TEST_TAG)-$$i.log" ; \
112             echo -n "$$i: "; \
113             echo "*** $(INTERNAL_MBAS) $$i.vb" > $$testlogfile ; \
114             if $(INTERNAL_MBAS) $$i.vb >> $$testlogfile 2>&1 ; then \
115                 echo "UNEXPECTED BEHAVIOUR" >> $$logfile ; \
116                 echo UNEXPECTED BEHAVIOUR ; \
117             else \
118                 echo "Exit code: $$?" >> $$testlogfile ; \
119                 echo "OK" >> $$logfile ; \
120                 echo OK; \
121             fi ; \
122             rm -f ./$$i.exe ; \
123         done
124
125
126 test-compiler-jit-ngtive_run: TEST_TAG = mbas-negative-runtime
127 test-compiler-jit-ngtive_run:
128         @logpath=./logs ; mkdir -p $$logpath; \
129         logfile="$$logpath/$(TEST_TAG).results"; \
130         rm -f *.exe $$logpath/$(TEST_TAG).results $$logpath/$(TEST_TAG)-*.log ; \
131         echo "****** Negative Execution Tests ********" >> $$logfile; \
132         echo "****** Negative Execution Tests ********" ; \
133         for i in $(TEST_NGTIVE_RUNTIME_SOURCES) ; do \
134             testlogfile="$$logpath/$(TEST_TAG)-$$i.log" ; \
135             echo -n "$$i: "; \
136             echo "*** $(INTERNAL_MBAS) $$i.vb" > $$testlogfile ; \
137             if $(INTERNAL_MBAS) $$i.vb >> $$testlogfile 2>&1 ; then \
138                 true ; \
139             else \
140                 echo "Exit code: $$?" >> $$testlogfile ; \
141                 failed="$$failed $$i" ; \
142                 echo -n -e "\n$$i : FAILED COMPILATION\n " >> $$logfile; \
143                 echo FAILED COMPILATION ; \
144                 continue; \
145             fi ; \
146             echo "*** $(TEST_RUNTIME) ./$$i.exe" >> $$testlogfile ; \
147             if $(TEST_RUNTIME) ./$$i.exe >> $$testlogfile 2>&1 ; then \
148                 echo -n -e "\n$$i : UNEXPECTED BEHAVIOUR\n " >> $$logfile; \
149                 echo -n -e "\n========================" >> $$logfile; \
150                 echo UNEXPECTED BEHAVIOUR ; rm -f $$testlogfile ; \
151             else \
152                 echo -n -e "\n$$i : OK\n" >> $$logfile; \
153                 echo OK; \
154             fi ; \
155             rm -f ./$$i.exe ; \
156         done
157