2004-07-02 Zoltan Varga <vargaz@freemail.hu>
[mono.git] / mono / tests / Makefile.am
index 1498e9b74997432299ba66c5b916aa0e41e0b449..25e723d94bf9ada9ca51d8d2cff97d2c590a47c3 100644 (file)
@@ -1,15 +1,16 @@
 
 TEST_PROG=../interpreter/mint
-JITTEST_PROG=../jit/mono
-RUNTIME_ARGS=--config tests-config
-
-CSC=csc /unsafe
+JITTEST_PROG=../mini/mono
+RUNTIME_ARGS=--config tests-config --optimize=all
+#CSC=csc /unsafe
+CSC=mcs --unsafe -nowarn:0162
 
 BENCHSRC=fib.cs random.cs nested-loops.cs ackermann.cs tight-loop.cs sieve.cs
 
-TESTSRC=                       \
+TEST_CS_SRC=                   \
        array-init.cs           \
        arraylist.cs            \
+       checked.cs              \
        char-isnumber.cs        \
        create-instance.cs      \
        field-layout.cs         \
@@ -36,11 +37,29 @@ TESTSRC=                    \
        exception12.cs          \
        exception13.cs          \
        exception14.cs          \
+       exception15.cs          \
+       exception16.cs          \
        struct.cs               \
        valuetype-gettype.cs    \
        static-constructor.cs   \
        pinvoke.cs              \
        pinvoke1.cs             \
+       pinvoke2.cs             \
+       pinvoke3.cs             \
+       pinvoke9.cs             \
+       pinvoke10.cs            \
+       pinvoke11.cs            \
+       pinvoke13.cs            \
+       pinvoke14.cs            \
+       pinvoke15.cs            \
+       pinvoke16.cs            \
+       pinvoke17.cs            \
+       pinvoke18.cs            \
+       invoke.cs               \
+       invoke2.cs              \
+       runtime-invoke.cs               \
+       invoke-string-ctors.cs          \
+       reinit.cs               \
        box.cs                  \
        array.cs                \
        enum.cs                 \
@@ -50,6 +69,8 @@ TESTSRC=                      \
        assignable-tests.cs     \
        array-cast.cs           \
        cattr-compile.cs        \
+       cattr-field.cs          \
+       cattr-object.cs         \
        custom-attr.cs          \
        double-cast.cs          \
        newobj-valuetype.cs     \
@@ -89,10 +110,13 @@ TESTSRC=                   \
        jit-float.cs            \
        pop.cs                  \
        time.cs                 \
-       appdomain.cs            \
+       appdomain.cs        \
+       appdomain1.cs           \
+       appdomain2.cs           \
+       appdomain3.cs           \
        appdomain-client.cs     \
+       appdomain-unload.cs \
        pointer.cs              \
-       vararg.cs               \
        rounding.cs             \
        hashcode.cs             \
        delegate1.cs            \
@@ -100,9 +124,13 @@ TESTSRC=                   \
        delegate3.cs            \
        delegate4.cs            \
        delegate5.cs            \
+       delegate6.cs            \
+       delegate7.cs            \
        remoting1.cs            \
        remoting2.cs            \
        remoting3.cs            \
+       remoting4.cs            \
+       remoting5.cs            \
        nonvirt.cs              \
        largeexp.cs             \
        largeexp2.cs            \
@@ -112,59 +140,170 @@ TESTSRC=                 \
        bound.cs                \
        array-invoke.cs         \
        decimal.cs              \
+       decimal-array.cs        \
        marshal1.cs             \
+       marshal2.cs             \
+       marshal3.cs             \
+       marshal5.cs             \
+       marshal6.cs             \
+       marshal7.cs             \
+       marshal8.cs             \
+       marshal9.cs             \
+       marshal10.cs            \
+       test-byval-in-struct.cs \
+       thread.cs               \
+       thread5.cs              \
+       thread6.cs              \
+       thread-static.cs        \
+       context-static.cs       \
+       float-pop.cs            \
+       interfacecast.cs        \
+       array3.cs               \
+       classinit.cs            \
+       classinit2.cs           \
+       synchronized.cs         \
+       async_read.cs           \
+       threadpool.cs           \
+       threadpool1.cs          \
+       base-definition.cs      \
+       bug-27420.cs            \
+       bug-47295.cs            \
+       bug-46781.cs            \
+       bug-48015.cs            \
+       bug-42136.cs
+
+if X86
+PLATFORM_DISABLED_TESTS=
+endif
+
+DISABLED_TESTS=                        \
+       $(PLATFORM_DISABLED_TESTS)
+
+# These only compile with MS CSC
+TEST_CSC_SRC=                  \
+       vararg.cs
+
+TEST_IL_SRC=                   \
        cpblkTest.il            \
-       jmpTest.il              \
+       jmpTest.il                      \
        calliTest.il            \
        ckfiniteTest.il         \
        locallocTest.il         \
-       initblkTest.il
+       initblkTest.il          \
+       qt-instance.il          \
+       vararg.il                       \
+       bug-29859.il            \
+       even-odd.il
 
 
-TESTSI_TMP=$(TESTSRC:.cs=.exe)
-TESTSI=$(TESTSI_TMP:.il=.exe)
+TESTSI_CS=$(TEST_CS_SRC:.cs=.exe)
+TESTSI_IL=$(TEST_IL_SRC:.il=.exe)
 TESTBS=$(BENCHSRC:.cs=.exe)
 
-EXTRA_DIST=test-driver $(TESTSRC)
+EXTRA_DIST=test-driver $(TEST_CS_SRC) $(TEST_IL_SRC) $(BENCHSRC)
 
 %.exe: %.il
-       ilasm $< /OUTPUT=$@
+       ilasm -out:$@ $<
 
-%.exe: %.cs
-       $(CSC) $<
+%.exe: %.cs TestDriver.dll
+       $(CSC) -r:TestDriver.dll -out:$@ $<
+
+test:  testjit
+
+TestDriver.dll:
+       $(CSC) -target:library -o $@ $(srcdir)/../mini/TestDriver.cs
+
+test_cs: $(TEST_PROG) $(TESTSI_CS) libtest.la
+       @failed=0; \
+       passed=0; \
+       export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
+       for i in $(TESTSI_CS); do       \
+               if $(srcdir)/test-driver $(TEST_PROG) $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
+               then \
+                       passed=`expr $${passed} + 1`; \
+               else \
+                       if [ $$? = 2 ]; then break; fi; \
+                       failed=`expr $${failed} + 1`; \
+               fi \
+       done; \
+       echo; echo ".cs: $${passed} test(s) passed. $${failed} test(s) failed."; echo
 
-test: $(TEST_PROG) $(TESTSI) libtest.la
+test_il: $(TEST_PROG) $(TESTSI_IL) libtest.la
        @failed=0; \
        passed=0; \
        export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
-       for i in $(TESTSI); do  \
-               if ./test-driver $(TEST_PROG) $$i $(RUNTIME_ARGS); \
+       for i in $(TESTSI_IL); do       \
+               if $(srcdir)/test-driver $(TEST_PROG) $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
                then \
                        passed=`expr $${passed} + 1`; \
                else \
+                       if [ $$? = 2 ]; then break; fi; \
                        failed=`expr $${failed} + 1`; \
                fi \
        done; \
-       echo "$${passed} test(s) passed. $${failed} test(s) failed."
+       echo; echo ".il: $${passed} test(s) passed. $${failed} test(s) failed."; echo
 
 testb: $(TEST_PROG) $(TESTBS)
        for i in $(TESTBS); do  \
-               ./test-driver $(TEST_PROG) $$ii $(RUNTIME_ARGS);        \
+               $(srcdir)/test-driver $(TEST_PROG) $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS);     \
        done
 
-testjit: $(JITTEST_PROG) $(TESTSI) $(TESTBS)
+testjit: $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la
+       @failed=0; \
+       passed=0; \
+       failed_tests="";\
+       export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
+       for i in $(TESTSI_CS) $(TESTBS) $(TESTSI_IL); do        \
+               rm -f $${i}.so; \
+               if $(srcdir)/test-driver $(JITTEST_PROG) $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
+               then \
+                       passed=`expr $${passed} + 1`; \
+               else \
+                       if [ $$? = 2 ]; then break; fi; \
+                       failed=`expr $${failed} + 1`; \
+                       failed_tests="$${failed_tests} $$i"; \
+               fi \
+       done; \
+       echo "$${passed} test(s) passed. $${failed} test(s) failed."; \
+       if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; for i in $${failed_tests}; do echo $${i}; done; fi; 
+
+testaot: $(TESTSI_CS) $(TESTBS) libtest.la
+       @failed=0; \
+       passed=0; \
+       failed_tests="";\
+       export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
+       for i in $(TESTSI_CS) $(TESTBS); do     \
+               rm -f $${i}.so; \
+               $(JITTEST_PROG) --aot $${i} > /dev/null; \
+               if $(srcdir)/test-driver $(JITTEST_PROG) $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
+               then \
+                       passed=`expr $${passed} + 1`; \
+               else \
+                       if [ $$? = 2 ]; then break; fi; \
+                       failed=`expr $${failed} + 1`; \
+                       failed_tests="$${failed_tests} $$i"; \
+               fi \
+       done; \
+       echo "$${passed} test(s) passed. $${failed} test(s) failed."; \
+       if [ $$failed != 0 ]; then echo -e "\nFailed tests:\n"; for i in $${failed_tests}; do echo $${i}; done; fi; 
+
+testinterp: $(TESTSI_CS) $(TESTSI_IL) libtest.la
        @failed=0; \
        passed=0; \
+       failed_tests="";\
        export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
-       for i in $(TESTSI) $(TESTBS); do        \
-               if ./test-driver $(JITTEST_PROG) $$i $(RUNTIME_ARGS); \
+       for i in $(TESTSI_CS) $(TESTSI_IL); do \
+               if $(srcdir)/test-driver $(TEST_PROG) $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
                then \
                        passed=`expr $${passed} + 1`; \
                else \
+                       if [ $$? = 2 ]; then break; fi; \
                        failed=`expr $${failed} + 1`; \
+                       failed_tests="$${failed_tests} $$i"; \
                fi \
        done; \
-       echo "$${passed} test(s) passed. $${failed} test(s) failed."
+       echo "$${passed} test(s) passed. $${failed} test(s) failed."; \
+       if [ $$failed != 0 ]; then echo -e "\nFailed tests:\n"; for i in $${failed_tests}; do echo $${i}; done; fi ;
 
 testjitspeed: $(JITTEST_PROG) $(TESTBS)
        for i in $(TESTBS); do  \
@@ -177,5 +316,11 @@ check:
 
 noinst_LTLIBRARIES = libtest.la
 
+INCLUDES = $(GLIB_CFLAGS)
+
 libtest_la_LDFLAGS = -rpath `pwd`
 libtest_la_SOURCES = libtest.c
+libtest_la_LIBADD = $(GLIB_LIBS)
+
+CLEANFILES = $(TESTSI_CS) $(TESTSI_IL) TestDriver.dll *.stdout
+