Merge pull request #901 from Blewzman/FixAggregateExceptionGetBaseException
[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)
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 USE_MCS_FLAGS :=
18
19 # mention all targets
20 all-local $(STD_TARGETS:=-local):
21
22 VALID_PROFILE := $(filter net_4_5, $(PROFILE))
23 ifdef VALID_PROFILE
24 # casts
25 bootstrap-cast.exe: gen-cast-test.cs
26         $(BOOT_COMPILE) -target:exe /out:$@ $<
27
28 casts.cs: bootstrap-cast.exe
29         $(with_mono_path) $(RUNTIME) $(RUNTIME_FLAGS) $< >$@
30
31 casts-mcs.exe: casts.cs
32         $(CSCOMPILE) -target:exe /out:$@ $<
33
34 casts-boot.exe: casts.cs
35         $(BOOT_COMPILE) -target:exe /out:$@ $<
36
37 boot-casts.out: casts-boot.exe
38         $(with_mono_path) $(RUNTIME) $(RUNTIME_FLAGS) $< >$@
39
40 mcs-casts.out: casts-mcs.exe
41         $(with_mono_path) $(RUNTIME) $(RUNTIME_FLAGS) $< >$@
42
43 test-casts: boot-casts.out mcs-casts.out
44         cmp $^
45         -rm -f bootstrap-cast.exe casts.cs casts-boot.exe casts-mcs.exe boot-casts.out mcs-casts.out
46
47 TEST_PATTERN = 'v2'
48
49 ifeq (net_4_5, $(PROFILE))
50 TEST_PATTERN = 'v4'
51 DEFINES = -compiler-options:"-d:NET_4_0;NET_4_5"
52 endif
53
54 LOCAL_RUNTIME_FLAGS = --verify-all
55 COMPILER = $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/mcs.exe
56 TESTER = MONO_RUNTIME='$(RUNTIME)' $(TEST_RUNTIME) $(RUNTIME_FLAGS) $(LOCAL_RUNTIME_FLAGS) $(topdir)/class/lib/$(PROFILE)/compiler-tester.exe
57
58 TEST_ILS := $(wildcard *-lib.il)
59
60 build-compiler-lib:
61         cd ../class/Mono.CSharp && $(MAKE) NO_DIR_CHECK=yes
62
63 qcheck: build-compiler-lib qcheck2
64         
65 qcheck2:
66         $(TESTER) -mode:pos -files:$(TEST_PATTERN) -compiler:$(COMPILER) -issues:known-issues-$(PROFILE) -log:$(PROFILE).log -il:ver-il-$(PROFILE).xml $(DEFINES) $(TOPTIONS)
67
68 gen-mt-tests:
69         $(TESTER) -mode:nunit -files:'v2' -compiler:$(COMPILER) -issues:known-issues-mt -compiler-options:"-lib:$(topdir)/class/lib/monotouch projects/MonoTouch/ivt.cs"
70
71 test-local:
72         @:
73
74 run-test-local: $(TEST_ILS:.il=.dll) setup qcheck
75
76 check: run-test-local
77
78 endif
79
80 clean-local:
81         -rm -fr dir-*
82         -rm -f *.exe *.dll *.netmodule *.out *.pdb *.mdb casts.cs *.log
83         -rm -f xml-*.xml
84
85 dist-local: dist-default
86         rm -f $(distdir)/casts.cs
87
88 csproj-local:
89
90 %-il.dll: %-il.il
91         $(ILASM) /dll $<
92
93 %-lib.dll: %-lib.il
94         $(ILASM) /dll /out:$@ $<
95
96 setup:
97         $(CSCOMPILE) -t:library dlls/test-679-2/test-679-lib-2.cs
98         $(CSCOMPILE) -t:library dlls/test-679-1/test-679-lib.cs -r:dlls/test-679-2/test-679-lib-2.dll
99         $(ILASM) -dll dlls/test-883.il