Include test in build
[mono.git] / mcs / tests / makefile
1 CSC=csc.exe
2
3 MCS=../mcs/mcs.exe
4 VERIFY=../tools/verifier.exe
5
6 TEST_SOURCES = \
7         test-1  test-2  test-3  test-4  test-5  test-6  test-7  test-8  test-9  test-10 \
8         test-11 test-12 test-13 test-14 test-15 test-16 test-17 test-18 test-19 test-20 \
9         test-21 test-22 test-23 test-24 test-25 test-26 test-27 test-28         test-30 \
10         test-31 test-32 test-33 test-34 test-35 test-36 test-37         test-39 test-40 \
11         test-41 test-42 test-43 test-44 test-45 test-46 test-47 test-48 test-49 test-50 \
12         test-51 test-52 test-53 test-54 test-55 test-56 test-57         test-59         \
13         test-61 test-62 test-63 test-64 test-65 test-66 test-67 test-68 test-69 test-70 \
14         test-71 test-72 test-73 test-74 test-75         test-77 test-78 test-79
15
16 UNSAFE_SOURCES = \
17         unsafe-1 unsafe-2
18
19 TEST_NOPASS = \
20         test-29 test-38 test-76
21
22 all: test-compiler test-unsafe
23
24 test-compiler:
25         -rm *.exe
26         for i in $(TEST_SOURCES); do \
27                 if $(MCS) $$i.cs > /dev/null; then \
28                         if ./$$i.exe; then \
29                                 echo $$i: ok; \
30                         else \
31                                 echo test $$i failed; exit; \
32                         fi; \
33                 else \
34                         echo compiler failed on $$i;   exit; \
35                 fi \
36         done
37
38 test-unsafe:
39         for i in $(UNSAFE_SOURCES); do \
40                 if $(MCS) --unsafe $$i.cs > /dev/null; then \
41                         if ./$$i.exe; then \
42                                 echo $$i: ok; \
43                         else \
44                                 echo test $$i failed; exit; \
45                         fi; \
46                 else \
47                         echo compiler failed on $$i;   exit; \
48                 fi \
49         done
50
51 test-jit:
52         for i in $(TEST_SOURCES:.cs=.exe); do \
53                 if mono ./$$i.exe; then \
54                         echo $$i: ok; \
55                 else \
56                         echo test $$i failed; exit; \
57                 fi \
58         done
59
60
61
62 verify:
63         for i in $(TEST_SOURCES); do \
64                 if $(MCS) -o mcs-gen-code.exe $$i.cs > /dev/null; then \
65                         if $(CSC) /out:csc-gen-code.exe $$i.cs > /dev/null; then \
66                                 if $(VERIFY) mcs-gen-code.exe csc-gen-code.exe > /dev/null; then \
67                                         echo $$i: identical assemblies; \
68                                 else \
69                                         echo $$i: unidentical assemblies; exit; \
70                                 fi; \
71                         fi \
72                 fi \
73         done
74
75
76 casts.cs: gen-cast-test.cs
77         $(CSC) /out:csc-cast.exe gen-cast-test.cs
78         ./csc-cast > casts.cs
79
80 casts-csc.exe: casts.cs
81         $(CSC) /out:casts-csc.exe casts.cs
82
83 casts.exe: casts.cs
84         $(MCS) casts.cs
85
86 csc-casts.out: casts-csc.exe
87         ./casts-csc.exe > csc-casts.out
88
89 msc-casts.out: casts.exe
90         ./casts.exe > msc-casts.out
91
92 test-casts: csc-casts.out msc-casts.out
93         cmp csc-casts.out msc-casts.out
94
95 clean:
96         rm *.exe
97         rm *.out
98         rm casts.cs
99