fd3b650bf27bb30196628e81aec194b59ce68b18
[mono.git] / mcs / tests / Makefile
1 #
2 # use `run-test-local'
3 #
4 # *** make sure you add multi-file tests to TEST_ORDERING if necessary
5
6 thisdir = tests
7 SUBDIRS =
8 include ../build/rules.make
9
10 DISTFILES = README.tests $(wildcard *.cs) $(wildcard *.il) $(wildcard *.xml) $(wildcard *.inc) $(wildcard known-issues-*)
11
12 with_mono_path = MONO_PATH="$(topdir)/class/lib/$(PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH"
13
14 ifeq (default, $(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 all-local install-local uninstall-local:
29
30 # casts
31
32 bootstrap-cast.exe: gen-cast-test.cs
33         $(BOOT_COMPILE) -target:exe /out:$@ $<
34
35 casts.cs: bootstrap-cast.exe
36         $(with_mono_path) $(RUNTIME) $(RUNTIME_FLAGS) $< >$@
37
38 casts-mcs.exe: casts.cs
39         $(CSCOMPILE) -target:exe /out:$@ $<
40
41 casts-boot.exe: casts.cs
42         $(BOOT_COMPILE) -target:exe /out:$@ $<
43
44 boot-casts.out: casts-boot.exe
45         $(with_mono_path) $(RUNTIME) $(RUNTIME_FLAGS) $< >$@
46
47 mcs-casts.out: casts-mcs.exe
48         $(with_mono_path) $(RUNTIME) $(RUNTIME_FLAGS) $< >$@
49
50 test-casts: boot-casts.out mcs-casts.out
51         cmp $^
52
53 test-local: casts-boot.exe
54
55 ifeq (net_2_0, $(PROFILE))
56 COMPILER_NAME = gmcs
57 COMPILER = $(topdir)/gmcs/gmcs.exe
58 TEST_PATTERN = '*test-*.cs'
59 else
60 COMPILER_NAME = mcs
61 COMPILER = $(topdir)/class/lib/$(PROFILE)/mcs.exe
62 TEST_PATTERN = 'test-*.cs'
63 endif
64
65 run-test-local: ilasm test-377-lib.dll test-443-lib.dll
66         MONO_RUNTIME='mono' $(TEST_RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(PROFILE)/compiler-tester.exe positive $(TEST_PATTERN) $(COMPILER) known-issues-$(COMPILER_NAME) $(COMPILER_NAME).log
67
68 # do nothing for this target
69 run-test-ondotnet-local:
70
71 test-everything:
72         $(MAKE) PROFILE=default run-test
73         $(MAKE) PROFILE=net_2_0 run-test
74
75 test-generics:
76         $(MAKE) PROFILE=net_2_0 run-test
77
78 clean-local:
79         -rm -fr dir-*
80         -rm -f *.exe *.dll *.netmodule *.out *.pdb casts.cs *.log
81         -rm -f xml-*.xml
82
83 dist-local: dist-default
84         rm -f $(distdir)/casts.cs
85
86 %-il.dll: %-il.il
87         $(ILASM) /dll $<
88         
89 %-lib.dll: %-lib.il
90         $(ILASM) /dll /out:$@ $<
91
92 ilasm:
93 ifeq (default, $(PROFILE))
94         $(ILASM) /dll property-il.il
95         $(CSCOMPILE) /r:property-il.dll property-main.cs /out:property-main.exe
96         $(TEST_RUNTIME) property-main.exe
97 endif