New tests.
[mono.git] / mcs / tests / Makefile
1 #
2 # use `run-test'
3 #
4
5 thisdir = tests
6 SUBDIRS =
7 include ../build/rules.make
8
9 DISTFILES = README.tests $(wildcard dlls/**/*.cs)
10 DISTFILES += $(wildcard *.cs) $(wildcard *.il) $(wildcard *.xml) $(wildcard *.inc) $(wildcard known-issues-*) $(wildcard *.snk)
11
12 with_mono_path = MONO_PATH="$(topdir)/class/lib/$(PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH"
13
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)
21
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
25
26 USE_MCS_FLAGS :=
27
28 # mention all targets
29 all-local $(STD_TARGETS:=-local):
30
31 VALID_PROFILE := $(filter net_1_1 net_2_0 net_2_1, $(PROFILE))
32 ifdef VALID_PROFILE
33 # casts
34 bootstrap-cast.exe: gen-cast-test.cs
35         $(BOOT_COMPILE) -target:exe /out:$@ $<
36
37 casts.cs: bootstrap-cast.exe
38         $(with_mono_path) $(RUNTIME) $(RUNTIME_FLAGS) $< >$@
39
40 casts-mcs.exe: casts.cs
41         $(CSCOMPILE) -target:exe /out:$@ $<
42
43 casts-boot.exe: casts.cs
44         $(BOOT_COMPILE) -target:exe /out:$@ $<
45
46 boot-casts.out: casts-boot.exe
47         $(with_mono_path) $(RUNTIME) $(RUNTIME_FLAGS) $< >$@
48
49 mcs-casts.out: casts-mcs.exe
50         $(with_mono_path) $(RUNTIME) $(RUNTIME_FLAGS) $< >$@
51
52 test-casts: boot-casts.out mcs-casts.out
53         cmp $^
54
55 test-local: casts-boot.exe
56
57 eval.exe: eval-tests.cs
58
59 ifeq (net_2_1, $(PROFILE))
60 COMPILER_NAME = smcs
61 TEST_PATTERN = '*test-*.cs'
62 LOCAL_RUNTIME_FLAGS = --security=temporary-smcs-hack
63 endif
64 ifeq (net_2_0, $(PROFILE))
65 COMPILER_NAME = gmcs
66 TEST_PATTERN = '*test-*.cs'
67 LOCAL_RUNTIME_FLAGS = --verify-all
68 TOPTIONS += '-il:ver-il-gmcs.xml'
69 endif
70 ifeq (net_1_1, $(PROFILE))
71 COMPILER_NAME = mcs
72 TEST_PATTERN = 'test-*.cs'
73 LOCAL_RUNTIME_FLAGS = --verify-all
74 endif
75
76 COMPILER = $(topdir)/class/lib/$(PROFILE)/$(COMPILER_NAME).exe
77 TESTER = MONO_RUNTIME='$(RUNTIME)' $(TEST_RUNTIME) $(RUNTIME_FLAGS) $(LOCAL_RUNTIME_FLAGS) $(topdir)/class/lib/$(PROFILE)/compiler-tester.exe
78
79 TEST_ILS := $(wildcard *-lib.il)
80
81 ifeq (net_2_0, $(PROFILE))
82 eval-test: 
83         $(CSCOMPILE) eval-test.cs -r:$(COMPILER)
84         $(with_mono_path) $(RUNTIME) $(RUNTIME_FLAGS) eval-test.exe
85 else
86 eval-test:
87 endif
88
89 check: run-test
90
91 run-test-local: $(TEST_ILS:.il=.dll) eval-test
92         $(TESTER) -mode:pos -files:$(TEST_PATTERN) -compiler:$(COMPILER) -issues:known-issues-$(COMPILER_NAME) -log:$(COMPILER_NAME).log $(TOPTIONS)
93
94 # Temporary testing targets
95 cecil:
96         rm -f *.mdb
97         $(TESTER) -mode:pos -files:'test-*.cs' -compiler:gmcs.exe -issues:known-issues-$(COMPILER_NAME) -log:$(COMPILER_NAME).log -verbose
98
99 cecil2:
100         rm -f *.mdb
101         $(TESTER) -mode:pos -files:'*test-*.cs' -compiler:gmcs.exe -issues:known-issues-$(COMPILER_NAME) -log:$(COMPILER_NAME).log -verbose
102 # End   
103
104 test-everything:
105         $(MAKE) PROFILE=net_1_1 run-test
106         $(MAKE) PROFILE=net_2_0 run-test
107
108 test-generics:
109         $(MAKE) PROFILE=net_2_0 run-test
110
111 clean-local:
112         -rm -fr dir-*
113         -rm -f *.exe *.dll *.netmodule *.out *.pdb *.mdb casts.cs *.log
114         -rm -f xml-*.xml
115
116 dist-local: dist-default
117         rm -f $(distdir)/casts.cs
118
119 %-il.dll: %-il.il
120         $(ILASM) /dll $<
121
122 %-lib.dll: %-lib.il
123         $(ILASM) /dll /out:$@ $<
124
125 ifeq (net_1_1, $(PROFILE))
126 run-test-local: ilasm
127 ilasm:
128         $(ILASM) /dll property-il.il
129         $(CSCOMPILE) /r:property-il.dll property-main.cs /out:property-main.exe
130         $(TEST_RUNTIME) property-main.exe
131
132         $(CSCOMPILE) -t:library dlls/test-679-2/test-679-lib-2.cs
133         $(CSCOMPILE) -t:library dlls/test-679-1/test-679-lib.cs -r:dlls/test-679-2/test-679-lib-2.dll
134 endif
135
136 endif