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