[build] Roslyn switch
[mono.git] / mcs / tests / Makefile
1 #
2 # use make run-test PROFILE=net_2_0
3 #
4
5 thisdir = tests
6 SUBDIRS =
7 include ../build/rules.make
8
9 DISTFILES = $(wildcard dlls/**/*.cs) $(wildcard dlls/*.cs) $(wildcard dlls/*.inc) $(wildcard dlls/*.il)
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 ilasm = $(topdir)/class/lib/$(PROFILE)/ilasm.exe
15 ILASM = MONO_PATH="$(topdir)/class/lib/$(PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(ilasm)
16
17 -include $(mcs_topdir)/build/config.make
18
19 USE_MCS_FLAGS :=
20
21 # mention all targets
22 all-local $(STD_TARGETS:=-local):
23
24 VALID_PROFILE := $(filter $(DEFAULT_PROFILE), $(PROFILE))
25 ifdef VALID_PROFILE
26 # casts
27 bootstrap-cast.exe: gen-cast-test.cs
28         $(BOOT_COMPILE) -target:exe /out:$@ $<
29
30 casts.cs: bootstrap-cast.exe
31         $(with_mono_path) $(RUNTIME) $(RUNTIME_FLAGS) $< >$@
32
33 casts-mcs.exe: casts.cs
34         $(CSCOMPILE) -target:exe /out:$@ $<
35
36 casts-boot.exe: casts.cs
37         $(BOOT_COMPILE) -target:exe /out:$@ $<
38
39 boot-casts.out: casts-boot.exe
40         $(with_mono_path) $(RUNTIME) $(RUNTIME_FLAGS) $< >$@
41
42 mcs-casts.out: casts-mcs.exe
43         $(with_mono_path) $(RUNTIME) $(RUNTIME_FLAGS) $< >$@
44
45 test-casts: boot-casts.out mcs-casts.out
46         cmp $^
47         -rm -f bootstrap-cast.exe casts.cs casts-boot.exe casts-mcs.exe boot-casts.out mcs-casts.out
48
49 TEST_PATTERN = 'v2'
50
51 ifeq (net_4_x, $(PROFILE))
52 TEST_PATTERN = 'v4'
53 DEFINES = -compiler-options:"-d:NET_4_0;NET_4_5 -debug"
54 endif
55
56 LOCAL_RUNTIME_FLAGS = --verify-all
57 COMPILER = $(topdir)/class/lib/$(PROFILE)/mcs.exe
58 TESTER = MONO_RUNTIME='$(RUNTIME)' $(TEST_RUNTIME) $(RUNTIME_FLAGS) $(LOCAL_RUNTIME_FLAGS) $(topdir)/class/lib/$(PROFILE)/compiler-tester.exe
59
60 TEST_ILS := $(wildcard *-lib.il)
61
62 build-compiler-lib:
63         cd ../class/Mono.CSharp && $(MAKE) NO_DIR_CHECK=yes
64
65 qcheck: build-compiler-lib qcheck2
66
67 qcheck2:
68         $(TESTER) -mode:pos -files:$(TEST_PATTERN) -compiler:$(COMPILER) -issues:known-issues-$(PROFILE) -log:$(PROFILE).log -il:ver-il-$(PROFILE).xml $(DEFINES) $(TOPTIONS)
69
70 gen-mt-tests:
71         $(TESTER) -mode:nunit -files:'v2' -compiler:$(COMPILER) -issues:known-issues-mt -compiler-options:"-lib:$(topdir)/class/lib/monotouch projects/MonoTouch/ivt.cs"
72
73 test-local:
74         @:
75
76 run-test-local: $(TEST_ILS:.il=.dll) setup qcheck
77
78 check: run-test-local
79
80 endif
81
82 clean-local:
83         -rm -fr dir-*
84         -rm -f *.exe *.dll *.netmodule *.out *.pdb *.mdb casts.cs *.log
85         -rm -f xml-*.xml
86
87 dist-local: dist-default
88         rm -f $(distdir)/casts.cs
89
90 csproj-local:
91
92 %-il.dll: %-il.il
93         $(ILASM) /dll $<
94
95 %-lib.dll: %-lib.il
96         $(ILASM) /dll /out:$@ $<
97
98 CSCOMPILE_UTIL = $(CSCOMPILE) -noconfig -nologo -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll
99
100 setup:
101         $(CSCOMPILE_UTIL) -t:library dlls/test-679-2/test-679-lib-2.cs -out:dlls/test-679-2/test-679-lib-2.dll
102         $(CSCOMPILE_UTIL) -t:library dlls/test-679-1/test-679-lib.cs -r:dlls/test-679-2/test-679-lib-2.dll -out:dlls/test-679-1/test-679-lib.dll
103         $(CSCOMPILE_UTIL) -t:library dlls/test-939-common.cs -keyfile:key.snk -publicsign -out:dlls/test-939-common.dll
104         $(CSCOMPILE_UTIL) -t:library dlls/test-939-1/test-939-lib.cs -keyfile:key.snk -publicsign -out:dlls/test-939-1/test-939-lib.dll
105         $(CSCOMPILE_UTIL) -t:library dlls/test-939-1/test-939-ref.cs -r:dlls/test-939-1/test-939-lib.dll -keyfile:key.snk -publicsign -out:dlls/test-939-1/test-939-ref.dll
106         $(CSCOMPILE_UTIL) -t:library dlls/test-939-2/test-939-lib.cs -r:dlls/test-939-common.dll -keyfile:key.snk -publicsign -out:dlls/test-939-2/test-939-lib.dll
107         $(ILASM) -dll dlls/test-883.il