merge r67228-r67235, r67237, r67251 and r67256-67259 to trunk (they are
[mono.git] / mono / tests / cas / threads / Makefile.am
1 with_mono_path = MONO_PATH=$(mcs_topdir)/class/lib/default
2 with_mono_path2 = MONO_PATH=$(mcs_topdir)/class/lib/net_2_0
3
4 RUNTIME = $(with_mono_path) $(top_builddir)/runtime/mono-wrapper --debug --security
5 RUNTIME2 = $(with_mono_path2) $(top_builddir)/runtime/mono-wrapper --debug --security
6
7 CSCOMPILE = $(RUNTIME) $(mcs_topdir)/class/lib/default/mcs.exe -debug
8 PROFILE = net_1_1
9
10 EXTRA_DIST = thread1.cs thread2.cs thread3.cs \
11         tpool1.cs tpool2.cs \
12         timer1.cs timer2.cs swf-timer3.cs swf-timer4.cs \
13         delegate1.cs delegate2.cs \
14         swf-control1.cs
15
16 tests:  thread1.exe thread2.exe thread3.exe \
17         tpool1.exe tpool2.exe delegate1.exe delegate2.exe \
18         timer1.exe timer2.exe
19 #       swf-timer3.exe swf-timer4.exe swf-control1.exe
20
21 aot:    thread1.exe.so thread2.exe.so thread3.exe.so \
22         tpool1.exe.so tpool2.exe.so \
23         timer1.exe.so timer2.exe.so swf-timer3.exe.so swf-timer4.exe.so \
24         delegate1.exe.so delegate2.exe.so \
25         swf-control1.exe.so
26
27 FULLTRUST_TEST_FILES = thread1 thread2 thread3 \
28         tpool1 tpool2 \
29         timer1 timer2 \
30         delegate1 delegate2
31
32 UNHANDLED_TEST_FILES = 
33
34 run: tests
35         @for i in $(FULLTRUST_TEST_FILES); do   \
36                 $(RUNTIME) $$i.exe x;   \
37         done;
38         @for i in $(INTERNET_TEST_FILES); do    \
39                 MONO_CAS_ZONE=Internet $(RUNTIME) $$i.exe;      \
40         done;
41
42 test: tests
43         @failed=0; \
44         passed=0; \
45         for i in $(FULLTRUST_TEST_FILES); do    \
46                 $(RUNTIME) $$i.exe > /dev/null; \
47                 if [ "$$?" = "0" ]; then        \
48                         echo -e "fulltrust-$$i\tpass";  \
49                         passed=`expr $${passed} + 1`; \
50                 else    \
51                         echo -e "fulltrust-$$i\tFAIL ($$?)";    \
52                         failed=`expr $${failed} + 1`; \
53                         failed_tests="$${failed_tests} fulltrust-$$i"; \
54                 fi;     \
55         done;   \
56         for i in $(UNHANDLED_TEST_FILES); do    \
57                 $(RUNTIME) $$i.exe > /dev/null; \
58                 if [ "$$?" = "0" ]; then        \
59                         echo -e "unhandled-$$i\tFAIL ($$?)";    \
60                         failed=`expr $${failed} + 1`; \
61                         failed_tests="$${failed_tests} unhandled-$$i"; \
62                 else    \
63                         echo -e "unhandled-$$i\tpass";  \
64                         passed=`expr $${passed} + 1`; \
65                 fi;     \
66         done;   \
67         echo -e "\n$${passed} test(s) passed. $${failed} test(s) failed."; \
68         if [ "$${failed}" != "0" ]; then        \
69                 echo -e "Failed tests are:";    \
70                 for i in $${failed_tests};      \
71                         do echo -e "\t$${i}";   \
72                 done;   \
73                 exit 1; \
74         fi
75
76 clean:
77         rm -f *.exe* *.dll* *.snk
78
79 swf-%.exe: swf-%.cs
80         $(CSCOMPILE) $^ /out:$@ /r:System.Windows.Forms.dll /r:System.Drawing.dll
81
82 %.exe: %.cs
83         $(CSCOMPILE) $^ /out:$@
84
85 %.exe.so: %.exe
86         $(RUNTIME) --aot $^