2004-12-06 Zoltan Varga <vargaz@freemail.hu>
[mono.git] / mcs / tests / harness.mk
1 thisdir = @thisdir@
2 SUBDIRS = 
3 include ../../build/rules.make
4
5 ifeq (default, $(PROFILE))
6 # force this, we don't case if CSC is broken. This also
7 # means we can use --options, yay.
8
9 MCS = MONO_PATH="$(topdir)/class/lib/$(PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_MCS)
10 endif
11
12 XMLDOCDIFF = $(TEST_RUNTIME) ../xmldocdiff.exe
13
14 all-local $(STD_TARGETS:=-local):
15
16 %.res:
17         @f=../$*.cs; options=`sed -n 's,^// Compiler options:,,p' $$f`; \
18         case $$options in *-t:library*) ext=dll ;; *-t:module*) ext=netmodule ;; *) ext=exe ;; esac; \
19         testlogfile="$*.log" ; \
20         echo '*** $(CSCOMPILE)' "$$options -out:$*.$$ext $$f" > $$testlogfile ; \
21         if $(CSCOMPILE) $$options -out:$*.$$ext $$f >> $$testlogfile 2>&1 ; then \
22           if test -f $*.exe; then \
23             echo '*** $(TEST_RUNTIME) -O=-all ./$*.exe' >> $$testlogfile ; \
24               if $(TEST_RUNTIME) -O=-all ./$*.exe >> $$testlogfile 2>&1 ; then \
25                 if test -f $*.xml; then \
26                   if $(XMLDOCDIFF) ../$*-ref.xml $*.xml >> $$testlogfile ; then \
27                     echo "PASS: $*: xml comparison" > $@ ; \
28                     rm -f $$testlogfile ; \
29                   else \
30                     echo "FAIL: $*: xml comparison" > $@ ; \
31                   fi \
32                 else \
33                   echo "PASS: $*" > $@ ; \
34                   rm -f $$testlogfile ; \
35                 fi \
36               else \
37                 echo "Exit code: $$?" >> $$testlogfile ; \
38                 echo "FAIL: $*" > $@ ; \
39               fi ; \
40             else \
41               echo "PASS: $*: compilation" > $@ ; \
42               rm -f $$testlogfile ; \
43             fi ; \
44         else \
45           echo "Exit code: $$?" >> $$testlogfile ; \
46           echo "FAIL: $*: compilation" > $@ ; \
47         fi ; \
48         cat $@; \
49         if test ! -f $$testlogfile ; then :; else cat $$testlogfile; fi
50
51 # test ordering dependencies will be pasted after this