bring Mono Security to monotouch
[mcs.git] / tests / Makefile
blob503b0d348ca4d6183211aced95eaa705f87aebc0
2 # use make run-test PROFILE=net_2_0
5 thisdir = tests
6 SUBDIRS =
7 include ../build/rules.make
9 DISTFILES = README.tests $(wildcard dlls/**/*.cs)
10 DISTFILES += $(wildcard *.cs) $(wildcard *.il) $(wildcard *.xml) $(wildcard *.inc) $(wildcard known-issues-*) $(wildcard *.snk)
12 with_mono_path = MONO_PATH="$(topdir)/class/lib/$(PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH"
14 ifeq (net_1_1, $(PROFILE))
15 # force this, we don't case if CSC is broken. This also
16 # means we can use --options, yay.
17 MCS = $(with_mono_path) $(INTERNAL_MCS)
18 endif
19 ilasm = $(topdir)/class/lib/net_1_1_bootstrap/ilasm.exe
20 ILASM = MONO_PATH="$(topdir)/class/lib/net_1_1_bootstrap$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(ilasm)
22 ifeq (net_2_0, $(PROFILE))
23 BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/net_2_0_bootstrap$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/net_2_0_bootstrap/mcs.exe
24 endif
26 USE_MCS_FLAGS :=
28 # mention all targets
29 all-local $(STD_TARGETS:=-local):
31 VALID_PROFILE := $(filter net_1_1 net_2_0 net_2_1 net_4_0, $(PROFILE))
32 ifdef VALID_PROFILE
33 # casts
34 bootstrap-cast.exe: gen-cast-test.cs
35 $(BOOT_COMPILE) -target:exe /out:$@ $<
37 casts.cs: bootstrap-cast.exe
38 $(with_mono_path) $(RUNTIME) $(RUNTIME_FLAGS) $< >$@
40 casts-mcs.exe: casts.cs
41 $(CSCOMPILE) -target:exe /out:$@ $<
43 casts-boot.exe: casts.cs
44 $(BOOT_COMPILE) -target:exe /out:$@ $<
46 boot-casts.out: casts-boot.exe
47 $(with_mono_path) $(RUNTIME) $(RUNTIME_FLAGS) $< >$@
49 mcs-casts.out: casts-mcs.exe
50 $(with_mono_path) $(RUNTIME) $(RUNTIME_FLAGS) $< >$@
52 test-casts: boot-casts.out mcs-casts.out
53 cmp $^
54 -rm -f bootstrap-cast.exe casts.cs casts-boot.exe casts-mcs.exe boot-casts.out mcs-casts.out
56 eval.exe: eval-tests.cs
58 ifeq (net_4_0, $(PROFILE))
59 COMPILER_NAME = dmcs
60 TEST_PATTERN = 'v4'
61 LOCAL_RUNTIME_FLAGS = --verify-all
62 #TOPTIONS += '-il:ver-il-dmcs.xml'
63 endif
64 ifeq (net_2_1, $(PROFILE))
65 COMPILER_NAME = smcs
66 TEST_PATTERN = 'v2'
67 LOCAL_RUNTIME_FLAGS = --security=temporary-smcs-hack
68 endif
69 ifeq (net_2_0, $(PROFILE))
70 COMPILER_NAME = gmcs
71 TEST_PATTERN = 'v2'
72 LOCAL_RUNTIME_FLAGS = --verify-all
73 TOPTIONS += '-il:ver-il-gmcs.xml'
74 endif
75 ifeq (net_1_1, $(PROFILE))
76 COMPILER_NAME = mcs
77 TEST_PATTERN = 'v1'
78 LOCAL_RUNTIME_FLAGS = --verify-all
79 endif
81 COMPILER = $(topdir)/class/lib/$(PROFILE)/$(COMPILER_NAME).exe
82 TESTER = MONO_RUNTIME='$(RUNTIME)' $(TEST_RUNTIME) $(RUNTIME_FLAGS) $(LOCAL_RUNTIME_FLAGS) $(topdir)/class/lib/$(PROFILE)/compiler-tester.exe
84 TEST_ILS := $(wildcard *-lib.il)
86 ifeq (net_2_0, $(PROFILE))
87 eval-test:
88 $(CSCOMPILE) eval-test.cs -r:$(COMPILER)
89 $(with_mono_path) $(RUNTIME) $(RUNTIME_FLAGS) eval-test.exe
90 else
91 eval-test:
92 endif
94 check: run-test
96 test-local:
99 run-test-local: $(TEST_ILS:.il=.dll) eval-test
100 $(TESTER) -mode:pos -files:$(TEST_PATTERN) -compiler:$(COMPILER) -issues:known-issues-$(COMPILER_NAME) -log:$(COMPILER_NAME).log $(TOPTIONS)
102 # Temporary testing targets
103 cecil:
104 rm -f *.mdb
105 $(TESTER) -mode:pos -files:'test-*.cs' -compiler:gmcs.exe -issues:known-issues-$(COMPILER_NAME) -log:$(COMPILER_NAME).log -verbose
107 cecil2:
108 rm -f *.mdb
109 $(TESTER) -mode:pos -files:'*test-*.cs' -compiler:gmcs.exe -issues:known-issues-$(COMPILER_NAME) -log:$(COMPILER_NAME).log -verbose
110 # End
112 test-everything:
113 $(MAKE) PROFILE=net_1_1 run-test
114 $(MAKE) PROFILE=net_2_0 run-test
116 test-generics:
117 $(MAKE) PROFILE=net_2_0 run-test
119 clean-local:
120 -rm -fr dir-*
121 -rm -f *.exe *.dll *.netmodule *.out *.pdb *.mdb casts.cs *.log
122 -rm -f xml-*.xml
124 dist-local: dist-default
125 rm -f $(distdir)/casts.cs
127 %-il.dll: %-il.il
128 $(ILASM) /dll $<
130 %-lib.dll: %-lib.il
131 $(ILASM) /dll /out:$@ $<
133 ifeq (net_1_1, $(PROFILE))
134 run-test-local: ilasm
135 ilasm:
136 $(ILASM) /dll property-il.il
137 $(CSCOMPILE) /r:property-il.dll property-main.cs /out:property-main.exe
138 $(TEST_RUNTIME) property-main.exe
140 $(CSCOMPILE) -t:library dlls/test-679-2/test-679-lib-2.cs
141 $(CSCOMPILE) -t:library dlls/test-679-1/test-679-lib.cs -r:dlls/test-679-2/test-679-lib-2.dll
142 endif
144 endif