New tests.
[mono.git] / mono / tests / Makefile.am
index fa74de3ab8fbb56a658cee1a700ed44887b7ebb2..ece41ac8d4bcbcd06c2fdc5bffec62bc8cb9895e 100644 (file)
@@ -20,17 +20,17 @@ JITTEST_PROG_RUN = MONO_SHARED_DIR=$(mono_build_root)/runtime MONO_CFG_DIR=$(mon
 RUNTIME_ARGS=--config tests-config --optimize=all --debug
 
 with_mono_path = MONO_PATH=$(mcs_topdir)/class/lib/net_2_0
-with_mono_path21 = MONO_PATH=$(mcs_topdir)/class/lib/net_2_1
+with_mono_path_moonlight = MONO_PATH=$(mcs_topdir)/class/lib/moonlight_raw
 
 RUNTIME = $(with_mono_path) $(top_builddir)/runtime/mono-wrapper
-RUNTIME21 = $(with_mono_path21) $(top_builddir)/runtime/mono-wrapper
+RUNTIME_MOONLIGHT = $(with_mono_path_moonlight) $(top_builddir)/runtime/mono-wrapper
 
 MKBUNDLE = \
        PKG_CONFIG_PATH=$(top_builddir):$(PKG_CONFIG_PATH) \
        $(RUNTIME) $(mcs_topdir)/class/lib/net_2_0/mkbundle.exe
 
 MCS = $(RUNTIME) $(mcs_topdir)/class/lib/net_2_0/gmcs.exe -unsafe -nowarn:0162 -nowarn:0168 -nowarn:0219 -debug
-SMCS = $(RUNTIME21) --runtime=moonlight --security=temporary-smcs-hack $(mcs_topdir)/class/lib/net_2_1/smcs.exe -unsafe -nowarn:0162 -nowarn:0168 -nowarn:0219
+SMCS = $(RUNTIME_MOONLIGHT) --runtime=moonlight --security=temporary-smcs-hack $(mcs_topdir)/class/lib/moonlight_raw/smcs.exe -unsafe -nowarn:0162 -nowarn:0168 -nowarn:0219
 ILASM = $(RUNTIME) $(mcs_topdir)/class/lib/net_2_0/ilasm.exe
 
 BENCHSRC=fib.cs random.cs nested-loops.cs ackermann.cs tight-loop.cs sieve.cs
@@ -44,7 +44,9 @@ STRESS_TESTS_SRC=     \
        monitor-stress.cs       \
        thread-stress.cs        \
        gc-stress.cs            \
-       exit-stress.cs
+       exit-stress.cs          \
+       process-stress.cs       \
+       assembly-load-stress.cs
 
 BASE_TEST_CS_SRC=              \
        array-init.cs           \
@@ -140,7 +142,6 @@ BASE_TEST_CS_SRC=           \
        iface4.cs               \
        iface-large.cs          \
        virtual-method.cs       \
-       virtual-sync.cs \
        intptrcast.cs           \
        indexer.cs              \
        stream.cs               \
@@ -159,6 +160,7 @@ BASE_TEST_CS_SRC=           \
        appdomain2.cs           \
        appdomain-client.cs     \
        appdomain-unload.cs \
+       appdomain-async-invoke.cs       \
        loader.cs       \
        pointer.cs              \
        hashcode.cs             \
@@ -194,6 +196,7 @@ BASE_TEST_CS_SRC=           \
        marshal7.cs             \
        marshal8.cs             \
        marshal9.cs             \
+       marshalbool.cs          \
        marshal-valuetypes.cs   \
        test-byval-in-struct.cs \
        thread.cs               \
@@ -247,7 +250,6 @@ BASE_TEST_CS_SRC=           \
        exists.cs               \
        handleref.cs    \
        transparentproxy.cs \
-       imt_big_iface_test.cs \
        dbnull-missing.cs       \
        test-type-ctor.cs       \
        soft-float-tests.cs     \
@@ -289,6 +291,7 @@ BASE_TEST_CS_SRC=           \
        generic-array-iface-set.2.cs    \
        generic-typedef.2.cs    \
        generic-marshalbyref.2.cs       \
+       generic-xdomain.2.cs    \
        bug-431413.2.cs \
        bug-459285.2.cs \
        generic-virtual-invoke.2.cs     \
@@ -304,6 +307,7 @@ BASE_TEST_CS_SRC=           \
        bug-479763.2.cs \
        bug-80392.2.cs          \
        dynamic-method-access.2.cs      \
+       dynamic-method-finalize.2.cs    \
        bug-82194.2.cs  \
        anonarray.2.cs  \
        ienumerator-interfaces.2.cs     \
@@ -346,7 +350,28 @@ BASE_TEST_CS_SRC=          \
        generic-unloading-sub.2.cs      \
        bug-467456.cs   \
        appdomain-unload-callback.cs    \
-       bug-472692.2.cs
+       bug-508538.cs   \
+       bug-472692.2.cs         \
+       gchandles.cs    \
+       interlocked-3.cs        \
+       interlocked-4.2.cs      \
+       finalizer-wait.cs       \
+       critical-finalizers.cs  \
+       appdomain-thread-abort.cs \
+       xdomain-threads.cs      \
+       w32message.cs   \
+       bug-544446.cs   \
+       gc-altstack.cs  \
+       large-gc-bitmap.cs      \
+       bug-561239.cs   \
+       bug-562150.cs   \
+       bug-575941.cs   \
+       bug-599469.cs
+
+TEST_CS_SRC_DIST=      \
+       $(BASE_TEST_CS_SRC)     \
+       async-exc-compilation.cs \
+       filter-stack.cs
 
 if AMD64
 TEST_CS_SRC = $(BASE_TEST_CS_SRC) async-exc-compilation.cs
@@ -359,7 +384,7 @@ endif
 endif
 
 if IA64
-TEST_CS_SRC+=async-exc-compilation.cs
+TEST_CS_SRC+=async-exc-compilation.cs filter-stack.cs
 # bug #319249
 PLATFORM_DISABLED_TESTS=exception17.exe
 PLATFORM_DISABLED_TESTS+=winx64structs.exe
@@ -367,7 +392,7 @@ endif
 
 if X86
 
-if PLATFORM_WIN32
+if HOST_WIN32
 PLATFORM_DISABLED_TESTS=async-exc-compilation.exe
 endif
 
@@ -378,11 +403,20 @@ if POWERPC
 PLATFORM_DISABLED_TESTS=finalizer-abort.exe finalizer-exception.exe finalizer-exit.exe
 endif
 
+if ARM
+PLATFORM_DISABLED_TESTS=filter-stack.exe
+endif
+
+# The two finalizer tests only work under sgen
 DISABLED_TESTS=                        \
        delegate-async-exception.exe    \
        bug-348522.2.exe        \
+       finalizer-wait.exe      \
+       critical-finalizers.exe \
        $(PLATFORM_DISABLED_TESTS)
 
+AOT_DISABLED_TESTS=constraints-load.exe
+
 # These only compile with MS CSC
 TEST_CSC_SRC=                  \
        vararg.cs
@@ -438,12 +472,18 @@ TEST_IL_SRC=                      \
        generic-valuetype-newobj2.2.il  \
        generic-valuetype-newobj.2.il   \
        generic-constrained.2.il        \
+       generic-type-load-exception.2.il        \
        bug-81466.il    \
        bug457574.il    \
        bug445361.il    \
        bug-463303.il   \
        bug469742.2.il  \
-       bug-481403.il
+       bug-528055.il   \
+       constraints-load.il     \
+       array_load_exception.il \
+       bug-481403.il   \
+       interface-with-static-method.il \
+       bug-515884.il
 
 #      bug-318677.il
 
@@ -461,7 +501,7 @@ TESTSI_IL=$(TEST_IL_SRC:.il=.exe)
 TESTBS=$(BENCHSRC:.cs=.exe)
 STRESS_TESTS=$(STRESS_TESTS_SRC:.cs=.exe)
 
-EXTRA_DIST=test-driver $(TEST_CS_SRC) $(TEST_IL_SRC) \
+EXTRA_DIST=test-driver $(TEST_CS_SRC_DIST) $(TEST_IL_SRC) \
        $(BENCHSRC) $(STRESS_TESTS_SRC) stress-runner.pl $(PREREQ_IL_SRC) $(PREREQ_CS_SRC)
 
 %.exe: %.il
@@ -472,24 +512,36 @@ EXTRA_DIST=test-driver $(TEST_CS_SRC) $(TEST_IL_SRC) \
 
 # mkbundle works on ppc, but the pkg-config POC doesn't when run with make test
 if POWERPC
-test_platform:
+test_platform: testbundle
 else
 # Can't use mkbundle on win32 since there is no static build there
 # Can't run test-unhandled-exception on Windows because of all the debug popups...
-if PLATFORM_WIN32
+if HOST_WIN32
 test_platform:
 else
-test_platform: testbundle test-iomap-regression
+# mkbundle uses the installed mono-2.pc so it won't work if there is no system mono
+#test_platform:        testbundle test-iomap-regression
+test_platform: test-iomap-regression
 endif
 endif
 
-if INSTALL_2_1
+#
+# Tests that the internals in mono/io-layer/messages.c are ok by triggering the 
+# code that checks that the table is properly sorted
+#
+test_messages: w32message.exe
+       > test_messages.zero
+       $(JITTEST_PROG_RUN) w32message.exe >& w32message.allout && cmp test_messages.zero w32message.allout
+
+if MOONLIGHT
 test_2_1 : test-coreclr-security
 else
 test_2_1 :
 endif
 
-test: assemblyresolve/test/asm.dll testjit test-type-load test-generic-sharing test_platform test_2_1
+# test_messages fails on the buildbots
+#test: assemblyresolve/test/asm.dll testjit test-type-load test-generic-sharing test_platform test_2_1 test_messages
+test: assemblyresolve/test/asm.dll testjit test-type-load test-generic-sharing test_platform test-runtime-invoke test-imt-big-iface test_2_1
 
 assemblyresolve/test/asm.dll:
        $(MAKE) -C assemblyresolve prereq
@@ -536,7 +588,7 @@ runtest: $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la $(PREREQSI_IL) $(PREREQS
        failed_tests="";\
        for i in $(TESTSI_CS) $(TESTBS) $(TESTSI_IL); do        \
                rm -f $${i}.so; \
-               if [ x$(AOT) = x1 ]; then $(with_mono_path) $(JITTEST_PROG_RUN) --aot --debug $${i} > /dev/null || exit 1; fi; \
+               if [ x$(AOT) = x1 ]; then if echo $(AOT_DISABLED_TESTS) | grep -v -q $${i}; then $(with_mono_path) $(JITTEST_PROG_RUN) --aot --debug $${i} > $${i}.aotlog 2>&1 || exit 1; fi; fi; \
                if $(srcdir)/test-driver '$(with_mono_path) $(JITTEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
                then \
                        passed=`expr $${passed} + 1`; \
@@ -554,7 +606,7 @@ runtest-managed: test-runner.exe $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la
        @$(RUNTIME) ./test-runner.exe -j a --disabled '$(DISABLED_TESTS)' $(TESTSI_CS) $(TESTBS) $(TESTSI_IL)
 
 testjit:
-       @$(MAKE) runtest
+       @if test x$(M) != x; then $(MAKE) runtest-managed; else $(MAKE) runtest; fi
 
 testaot:
        @$(MAKE) AOT=1 runtest
@@ -609,6 +661,21 @@ test-type-load: TestDriver.dll
        @echo "Testing load-exception.exe..."
        @$(RUNTIME) load-exceptions.exe > load-exceptions.exe.stdout 2> load-exceptions.exe.stderr
 
+# Generated tests for runtime invoke
+EXTRA_DIST += gen-runtime-invoke.cs
+test-runtime-invoke: TestDriver.dll gen-runtime-invoke.exe
+       @$(RUNTIME) gen-runtime-invoke.exe > runtime-invoke.gen.cs
+       @$(MCS) -out:runtime-invoke.gen.exe -r:TestDriver.dll runtime-invoke.gen.cs
+       @echo "Testing runtime-invoke.gen.exe..."
+       @$(RUNTIME) runtime-invoke.gen.exe > runtime-invoke.gen.exe.stdout 2> runtime-invoke.gen.exe.stderr
+
+EXTRA_DIST += make-imt-test.cs
+test-imt-big-iface: TestDriver.dll make-imt-test.exe
+       @$(RUNTIME) make-imt-test.exe > imt_big_iface_test.cs
+       @$(MCS) -out:imt_big_iface_test.exe -r:TestDriver.dll imt_big_iface_test.cs
+       @echo "Testing imt_big_iface_test.exe..."
+       @$(RUNTIME) imt_big_iface_test.exe > imt_big_iface_test.exe.stdout 2> imt_big_iface_test.exe.stderr
+
 EXTRA_DIST += test-inline-call-stack-library.cs test-inline-call-stack.cs
 test-inline-call-stack-library.dll: TestDriver.dll $(srcdir)/test-inline-call-stack-library.cs
        $(MCS) -t:library -out:test-inline-call-stack-library.dll $(srcdir)/test-inline-call-stack-library.cs
@@ -674,10 +741,6 @@ bug-324535-il.dll : bug-324535-il.il
 bug-324535.exe : bug-324535.cs bug-324535-il.dll
        $(MCS) -r:bug-324535-il.dll -out:bug-324535.exe $(srcdir)/bug-324535.cs
 
-EXTRA_DIST += make_imt_test.sh
-imt_big_iface_test.cs: $(srcdir)/make_imt_test.sh
-       $(srcdir)/make_imt_test.sh > imt_big_iface_test.cs
-
 EXTRA_DIST += custom-modifiers.2.cs custom-modifiers-lib.il
 custom-modifiers-lib.dll: custom-modifiers-lib.il
        $(ILASM) /dll /output:custom-modifiers-lib.dll $(srcdir)/custom-modifiers-lib.il
@@ -692,13 +755,13 @@ bug-382986.exe: bug-382986.cs bug-382986-lib.dll
 
 EXTRA_DIST += coreclr-security.cs
 
-if INSTALL_2_1
+if MOONLIGHT
 coreclr-security.exe : coreclr-security.cs
        $(SMCS) -out:coreclr-security.exe $(srcdir)/coreclr-security.cs
 
 test-coreclr-security : coreclr-security.exe
        @echo "Testing coreclr-security.exe..."
-       @$(RUNTIME21) --security=core-clr-test coreclr-security.exe
+       @$(RUNTIME_MOONLIGHT) --security=core-clr-test coreclr-security.exe
 endif
 
 EXTRA_DIST += generic-unboxing.2.il
@@ -728,7 +791,8 @@ gshared: test-generic-sharing
 gshared-aot:
        @$(MAKE) AOT=1 gshared
 
-test-generic-sharing : generics-sharing.2.exe shared-generic-methods.2.exe     \
+GSHARED_TESTS = \
+               generics-sharing.2.exe shared-generic-methods.2.exe     \
                shared-generic-synchronized.2.exe generic-initobj.2.exe         \
                generics-sharing-other-exc.2.exe generic-box.2.exe              \
                generic-unbox.2.exe generic-delegate.2.exe generic-sizeof.2.exe \
@@ -751,7 +815,10 @@ test-generic-sharing : generics-sharing.2.exe shared-generic-methods.2.exe \
                generic-sealed-virtual.2.exe generic-system-arrays.2.exe        \
                generic-stack-traces.2.exe generic-stack-traces2.2.exe          \
                bug-472600.2.exe bug-473482.2.exe bug-473999.2.exe              \
-               bug-479763.2.exe
+               bug-479763.2.exe generic-xdomain.2.exe                          \
+               generic-type-load-exception.2.exe
+
+test-generic-sharing-normal: $(GSHARED_TESTS)
        @for fn in $+ ; do      \
                echo "Testing $$fn ...";        \
                MONO_GENERIC_SHARING=all $(RUNTIME) -O=gshared                $$fn > $$fn.stdout || exit 1;     \
@@ -761,6 +828,12 @@ test-generic-sharing : generics-sharing.2.exe shared-generic-methods.2.exe \
                if [ x$(AOT) = x1 ]; then MONO_GENERIC_SHARING=all $(with_mono_path) $(JITTEST_PROG_RUN) --aot --debug $$fn > /dev/null || exit 1; MONO_GENERIC_SHARING=all $(RUNTIME) $$fn > $$fn.stdout || exit 1; fi; \
        done
 
+test-generic-sharing-managed: test-runner.exe $(GSHARED_TESTS)
+       @$(RUNTIME) ./test-runner.exe -j a --opt-sets "gshared gshared,shared gshared,-inline gshared,-inline,shared" $(GSHARED_TESTS)
+
+test-generic-sharing:
+       @if test x$(M) != x; then $(MAKE) test-generic-sharing-managed; else $(MAKE) test-generic-sharing-normal; fi
+
 EXTRA_DIST += async-exceptions.cs
 async-exceptions.exe : async-exceptions.cs
        $(MCS) -out:async-exceptions.exe $(srcdir)/async-exceptions.cs
@@ -771,9 +844,21 @@ test-async-exceptions : async-exceptions.exe
 EXTRA_DIST += modules.cs modules-m1.cs
 modules-m1.netmodule: modules-m1.cs
        $(MCS) -out:$@ /target:module $(srcdir)/modules-m1.cs
-modules.exe: modules.cs modules-m1.netmodule
+modules.exe: modules.cs modules-m1.netmodule TestDriver.dll
        $(MCS) -out:$@ /addmodule:modules-m1.netmodule -r:TestDriver.dll $(srcdir)/modules.cs
 
+EXTRA_DIST += dtest.cs dtest-app.cs
+
+dcheck: dtest.dll dtest-app.exe
+       @echo "Testing soft-debugger..."
+       @nunit-console2 -labels dtest.dll > dcheck.stdout 2> dcheck.stderr
+
+dtest.dll:
+       $(MCS) -r:Mono.Debugger.Soft.dll -pkg:mono-nunit /target:library -r:`pkg-config --variable Libraries cecil` /debug $(srcdir)/dtest.cs
+
+dtest-app.exe:
+       $(MCS) /debug /unsafe $(srcdir)/dtest-app.cs
+
 # Useful if mono is compiled with --enable-shared=no
 patch-libtool:
        cp "../../libtool" .
@@ -785,7 +870,7 @@ noinst_LTLIBRARIES = libtest.la
 
 INCLUDES = $(GLIB_CFLAGS) $(GMODULE_CFLAGS)
 
-if PLATFORM_WIN32
+if HOST_WIN32
 # gcc-3.4.4 emits incorrect code when making indirect calls to stdcall functions using a tail call
 # This shows up when compiling mono_test_marshal_delegate ()
 libtest_la_CFLAGS=-fno-optimize-sibling-calls
@@ -798,4 +883,4 @@ endif
 libtest_la_SOURCES = libtest.c
 libtest_la_LIBADD = $(glib_libs)
 
-CLEANFILES = $(TESTSI_CS) $(TESTSI_IL) $(STRESS_TESTS) *.dll *.stdout *.exe stest.dat
+CLEANFILES = $(TESTSI_CS) $(TESTSI_IL) $(STRESS_TESTS) *.dll *.stdout *.aotlog *.exe stest.dat