Revert "UTF8 Marshaling APIs (#3736)"
[mono.git] / mono / tests / Makefile.am
index 0a97198acedbdad3ada0309237d431cf37f8be86..b33cb19ef982f9117fc10dc76898692456dda1f1 100644 (file)
@@ -6,7 +6,7 @@ else
 FEATUREFUL_RUNTIME_TEST = test-appdomain-unload
 endif
 
-check-local: assemblyresolve/test/asm.dll testjit test-generic-sharing test-type-load test-cattr-type-load test-reflection-load-with-context test_platform     \
+check-local: assemblyresolve/test/asm.dll testjit test-generic-sharing test-type-load test-multi-netmodule test-cattr-type-load test-reflection-load-with-context test_platform        \
                 test-console-output test-messages test-env-options test-unhandled-exception-2 $(FEATUREFUL_RUNTIME_TEST) test-process-stress rm-empty-logs
 check-full: test-sgen check-local
 check-parallel: compile-tests check-full
@@ -34,6 +34,8 @@ else
 TEST_RUNNER_ARGS=--config tests-config --runtime $(if $(MONO_EXECUTABLE),$(MONO_EXECUTABLE),mono)
 endif
 
+TEST_RUNNER_ARGS += $(if $(V), --verbose,)
+
 CLASS=$(mcs_topdir)/class/lib/$(DEFAULT_PROFILE)
 
 with_mono_path = MONO_PATH=$(CLASS)
@@ -83,57 +85,70 @@ STRESS_TESTS_SRC=   \
        assembly-load-stress.cs
 
 BASE_TEST_MOBILE_STATIC_NOT_SUPPORTED= \
-       bug-47295.cs            \
-       thread6.cs              \
-       loader.cs       \
-       pinvoke2.cs             \
-       generic-type-builder.2.cs       \
-       assemblyresolve_event2.2.cs     \
-       dynamic-generic-size.cs \
-       cominterop.cs   \
-       dynamic-method-access.2.cs      \
-       dynamic-method-finalize.2.cs    \
-       dynamic-method-stack-traces.cs  \
-       generic_type_definition.2.cs    \
-       bug-333798-tb.2.cs      \
-       bug-335131.2.cs \
-       bug-322722_patch_bx.2.cs        \
-       bug-322722_dyn_method_throw.2.cs        \
-       bug-389886-2.cs \
-       bug-349190.2.cs \
-       bug-389886-sre-generic-interface-instances.cs   \
-       bug-462592.cs   \
-       cross-domain.cs         \
-       generic-unloading.2.cs  \
-       generic-unloading-sub.2.cs      \
-       appdomain.cs        \
-       appdomain1.cs           \
-       appdomain2.cs           \
-       appdomain-client.cs     \
-       appdomain-unload.cs \
-       appdomain-async-invoke.cs       \
-       appdomain-thread-abort.cs       \
-       appdomain-exit.cs       \
-       appdomain-unload-callback.cs    \
-       appdomain-unload-doesnot-raise-pending-events.cs        \
-       unload-appdomain-on-shutdown.cs \
-       generic-xdomain.2.cs    \
-       monitor.cs      \
-       bug-48015.cs            \
-       xdomain-threads.cs      \
-       remoting4.cs            \
-       marshal-valuetypes.cs   \
-       bug-575941.cs   \
-       bug-389886-3.cs \
-       dynamic-method-resurrection.cs  \
-       bug-80307.cs    \
-       delegate9.cs            \
-       create-instance.cs      \
-       assembly_append_ordering.cs
+       remoting4.cs            # Needs remoting support \
+       remoting1.cs            # Needs remoting support \
+       remoting2.cs            # Needs remoting support \
+       remoting3.cs            # Needs remoting support \
+       remoting5.cs            # Needs remoting support \
+       appdomain.cs        # Needs appdomain support \
+       appdomain-client.cs     # Needs appdomain support \
+       appdomain-unload.cs # Needs appdomain support \
+       appdomain-async-invoke.cs       # Needs appdomain support \
+       appdomain-thread-abort.cs       # Needs appdomain support \
+       appdomain1.cs           # Needs appdomain support \
+       appdomain2.cs           # Needs appdomain support \
+       appdomain-exit.cs       # Needs appdomain support \
+       assemblyresolve_event2.2.cs     # Needs appdomain support \
+       appdomain-unload-callback.cs    # Needs appdomain support \
+       appdomain-unload-doesnot-raise-pending-events.cs        # Needs appdomain support \
+       unload-appdomain-on-shutdown.cs # Needs appdomain support \
+       bug-47295.cs # Needs SRE \
+       loader.cs # Needs SRE \
+       pinvoke2.cs # Needs SRE \
+       generic-type-builder.2.cs       # Needs SRE \
+       dynamic-generic-size.cs # Needs SRE \
+       cominterop.cs   # Needs COM \
+       dynamic-method-access.2.cs      # Need SRE \
+       dynamic-method-finalize.2.cs    # Need SRE \
+       dynamic-method-stack-traces.cs # Need SRE\
+       generic_type_definition.2.cs    # Need SRE \
+       bug-333798-tb.2.cs      # Need SRE \
+       bug-335131.2.cs # Need SRE \
+       bug-322722_patch_bx.2.cs        # Need SRE\
+       bug-322722_dyn_method_throw.2.cs        # Need SRE \
+       bug-389886-2.cs # Need SRE \
+       bug-349190.2.cs # Need SRE \
+       bug-389886-sre-generic-interface-instances.cs   # Need SRE \
+       bug-462592.cs   # Need SRE \
+       bug-575941.cs   # Need SRE \
+       bug-389886-3.cs # Need SRE \
+       constant-division.cs    # Need SRE \
+       dynamic-method-resurrection.cs  # Need SRE \
+       bug-80307.cs    # Need System.Web \
+       assembly_append_ordering.cs # Need SRE \
+       bug-544446.cs   # Needs AppDomains / TranparentProxy \
+       bug-36848.cs   # Needs AppDomains / TranparentProxy \
+       generic-marshalbyref.2.cs # Needs AppDomains \
+       stackframes-async.2.cs # Needs AppDomains \
+       transparentproxy.cs # Needs AppDomains / TranparentProxy \
+       bug-48015.cs # Needs AppDomains / TranparentProxy \
+       delegate9.cs # Needs AppDomains \
+       marshal-valuetypes.cs   # Needs AppDomains \
+       xdomain-threads.cs      # Needs AppDomains \
+       monitor.cs # Needs AppDomains \
+       generic-xdomain.2.cs # Needs AppDomains \
+       threadpool-exceptions7.cs # Needs AppDomains \
+       cross-domain.cs # Needs AppDomains \
+       generic-unloading.2.cs # Needs AppDomains \
+       namedmutex-destroy-race.cs # needs named Mutex \
+       thread6.cs # On MOBILE, ThreadAbortException doesn't have necessary field for this test
 
 # Disabled until ?mcs is fixed
 #      bug-331958.cs
+# Note: only add tests that are compatible with mobile_static to this category
 BASE_TEST_CS_SRC_UNIVERSAL=            \
+       generic-unloading-sub.2.cs      \
+       create-instance.cs      \
        bug-2907.cs             \
        array-init.cs           \
        arraylist.cs            \
@@ -257,10 +272,6 @@ BASE_TEST_CS_SRC_UNIVERSAL=                \
        delegate11.cs           \
        delegate12.cs           \
        delegate13.cs           \
-       remoting1.cs            \
-       remoting2.cs            \
-       remoting3.cs            \
-       remoting5.cs            \
        largeexp.cs             \
        largeexp2.cs            \
        marshalbyref1.cs        \
@@ -303,7 +314,6 @@ BASE_TEST_CS_SRC_UNIVERSAL=         \
        threadpool-exceptions4.cs \
        threadpool-exceptions5.cs \
        threadpool-exceptions6.cs \
-       threadpool-exceptions7.cs \
        base-definition.cs      \
        bug-27420.cs            \
        bug-46781.cs            \
@@ -335,7 +345,6 @@ BASE_TEST_CS_SRC_UNIVERSAL=         \
        desweak.cs              \
        exists.cs               \
        handleref.cs    \
-       transparentproxy.cs \
        dbnull-missing.cs       \
        test-type-ctor.cs       \
        soft-float-tests.cs     \
@@ -348,7 +357,6 @@ BASE_TEST_CS_SRC_UNIVERSAL=         \
        catch-generics.2.cs     \
        event-get.2.cs          \
        safehandle.2.cs         \
-       stackframes-async.2.cs          \
        module-cctor-loader.2.cs        \
        generics-invoke-byref.2.cs      \
        generic-signature-compare.2.cs  \
@@ -374,7 +382,6 @@ BASE_TEST_CS_SRC_UNIVERSAL=         \
        generic-delegate-ctor.2.cs      \
        generic-array-iface-set.2.cs    \
        generic-typedef.2.cs    \
-       generic-marshalbyref.2.cs       \
        bug-431413.2.cs \
        bug-459285.2.cs \
        generic-virtual-invoke.2.cs     \
@@ -409,7 +416,6 @@ BASE_TEST_CS_SRC_UNIVERSAL=         \
        bug-324535.cs   \
        modules.cs      \
        bug-81673.cs    \
-       bug-36848.cs    \
        bug-81691.cs    \
        bug-415577.cs   \
        filter-stack.cs \
@@ -426,7 +432,6 @@ BASE_TEST_CS_SRC_UNIVERSAL=         \
        interlocked-3.cs        \
        interlocked-4.2.cs      \
        w32message.cs   \
-       bug-544446.cs   \
        gc-altstack.cs  \
        large-gc-bitmap.cs      \
        bug-561239.cs   \
@@ -462,7 +467,9 @@ BASE_TEST_CS_SRC_UNIVERSAL=         \
        pinvoke_ppcf.cs \
        pinvoke_ppcd.cs \
        bug-29585.cs    \
-       priority.cs
+       priority.cs     \
+       abort-cctor.cs  \
+       thread-native-exit.cs
 
 if INSTALL_MOBILE_STATIC
 BASE_TEST_CS_SRC= \
@@ -626,6 +633,52 @@ else
 COOP_DISABLED_TESTS= 
 endif
 
+if INSTALL_MOBILE_STATIC
+# Tests which rely on TypeLoadExceptions
+# In full-aot mode, these cause the relevant methods to be not AOTed.
+PROFILE_DISABLED_TESTS = \
+       typeload-unaligned.exe \
+       field-access.exe \
+       invalid_generic_instantiation.exe \
+       bug-481403.exe \
+       array_ldelema.exe \
+       array_load_exception.exe \
+       bug445361.exe \
+       generic-type-load-exception.2.exe \
+       invalid-token.exe \
+       call_missing_method.exe \
+       call_missing_class.exe \
+       ldfld_missing_field.exe \
+       ldfld_missing_class.exe \
+       vt-sync-method.exe
+
+# Tests which rely on remoting
+PROFILE_DISABLED_TESTS += \
+       context-static.exe \
+       bug-415577.exe \
+       generic-marshalbyref.2.exe \
+       unhandled-exception-7.exe
+
+# Tests which use unsupported pinvoke+full aot
+# functionality
+PROFILE_DISABLED_TESTS += \
+       marshal.exe \
+       marshal2.exe \
+       marshal6.exe \
+       marshal7.exe \
+       marshal8.exe \
+       pinvoke-2.2.exe \
+       pinvoke3.exe \
+       thunks.exe
+
+# Tests which load assemblies which are not
+# in the mobile_static profile
+PROFILE_DISABLED_TESTS += \
+       assembly-load-remap.exe
+else
+PROFILE_DISABLED_TESTS=
+endif
+
 # The two finalizer tests only work under sgen
 # gc-altstack.exe fails under boehm because it has no support for altstack
 # bug-459094.exe creates an extremely deep directory tree
@@ -640,7 +693,8 @@ DISABLED_TESTS=                     \
        bug-Xamarin-5278.exe \
        $(PLATFORM_DISABLED_TESTS) \
        $(EXTRA_DISABLED_TESTS) \
-       $(COOP_DISABLED_TESTS)
+       $(COOP_DISABLED_TESTS) \
+       $(PROFILE_DISABLED_TESTS)
 
 DISABLED_TESTS_WRENCH= \
        $(DISABLED_TESTS)       \
@@ -660,6 +714,9 @@ AOT_DISABLED_TESTS=constraints-load.exe
 TEST_CSC_SRC=                  \
        vararg.cs
 
+# constraints-load.il: 
+# Failed to load method 0x6000007 from '..../mono/tests/constraints-load.exe' due to 
+# Could not resolve type with token 01000002 assembly:mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 type:System.BrokenIComparable`1 member:<none>.
 IL_SRC_MOBILE_STATIC_NOT_SUPPORTED=    \
        constraints-load.il \
        bug-515884.il
@@ -768,7 +825,13 @@ if !INSTALL_MOBILE_STATIC
 TEST_DRIVER_HARD_KILL_FEATURE=-r:Mono.Posix.dll
 endif
 
-%.exe: %.cs TestDriver.dll
+if INSTALL_MOBILE_STATIC
+TEST_DRIVER_DEPEND=TestDriver.dll$(PLATFORM_AOT_SUFFIX)
+else
+TEST_DRIVER_DEPEND=TestDriver.dll
+endif
+
+%.exe: %.cs $(TEST_DRIVER_DEPEND)
        $(MCS) -r:System.dll -r:System.Xml.dll -r:System.Core.dll -r:TestDriver.dll $(TEST_DRIVER_HARD_KILL_FEATURE) -out:$@ $<
 
 %.exe$(PLATFORM_AOT_SUFFIX): %.exe 
@@ -800,13 +863,12 @@ endif
 endif
 
 AOT_EXTRA_LIBS =       \
-bug-382986-lib.dll.$(PLATFORM_AOT_SUFFIX)      \
-bug-324535-il.dll.$(PLATFORM_AOT_SUFFIX)       \
-bug-36848-a.dll.$(PLATFORM_AOT_SUFFIX) \
-bug-81691-b.dll.$(PLATFORM_AOT_SUFFIX) \
-bug-327438.2.exe.$(PLATFORM_AOT_SUFFIX)        \
-bug-81466-lib.dll.$(PLATFORM_AOT_SUFFIX)       \
-constraints-load.exe.$(PLATFORM_AOT_SUFFIX)
+bug-382986-lib.dll$(PLATFORM_AOT_SUFFIX)       \
+bug-324535-il.dll$(PLATFORM_AOT_SUFFIX)        \
+bug-36848-a.dll$(PLATFORM_AOT_SUFFIX)  \
+bug-81691-b.dll$(PLATFORM_AOT_SUFFIX)  \
+bug-327438.2.exe$(PLATFORM_AOT_SUFFIX) \
+bug-81466-lib.dll$(PLATFORM_AOT_SUFFIX)
 
 if INSTALL_MOBILE_STATIC
 prereqs: $(PREREQSI_IL_AOT) $(PREREQSI_CS_AOT) $(AOT_EXTRA_LIBS)
@@ -860,17 +922,13 @@ endif
 # Remove empty .stdout and .stderr files for wrench
 rm-empty-logs:
        @echo "Removing empty logs..."
-       @find . '(' -name "*.stdout" -o -name "*.stderr" ')' -empty -exec rm {} \;
+       find . '(' -name "*.stdout" -o -name "*.stderr" ')' -size 0 -exec rm {} \;
 
 assemblyresolve/test/asm.dll:
        $(MAKE) -C assemblyresolve prereq
 
-
 TestDriver.dll:
-       $(MCS) -target:library -out:$@ $(srcdir)/../mini/TestDriver.cs
-if INSTALL_MOBILE_STATIC
-       $(RUNTIME) $(AOT_BUILD_FLAGS) $@
-endif
+       $(MCS) -target:library -out:$@ $(srcdir)/../mini/TestDriver.cs $(srcdir)/../mini/TestHelpers.cs
 
 test_cs: $(TEST_PROG) $(TESTSI_CS) libtest.la
        @failed=0; \
@@ -1001,7 +1059,7 @@ testbundle: console.exe
        @- rm -rf a.out
 
 EXTRA_DIST += load-missing.il t-missing.cs load-exceptions.cs
-test-type-load: TestDriver.dll
+test-type-load: $(TEST_DRIVER_DEPEND)
        @$(ILASM) /dll /output:load-missing.dll $(srcdir)/load-missing.il > /dev/null
        @$(MCS) -t:library -out:t.dll -d:FOUND $(srcdir)/t-missing.cs
        @$(MCS) -r:TestDriver.dll -r:load-missing.dll -r:t.dll -out:load-exceptions.exe $(srcdir)/load-exceptions.cs
@@ -1009,8 +1067,16 @@ test-type-load: TestDriver.dll
        @echo "Testing load-exception.exe..."
        @$(RUNTIME) load-exceptions.exe > load-exceptions.exe.stdout 2> load-exceptions.exe.stderr
 
+EXTRA_DIST += test-multi-netmodule-1-netmodule.cs test-multi-netmodule-2-dll1.cs test-multi-netmodule-3-dll2.cs test-multi-netmodule-4-exe.cs
+test-multi-netmodule:
+       @$(MCS) -t:module test-multi-netmodule-1-netmodule.cs
+       @$(MCS) -addmodule:test-multi-netmodule-1-netmodule.netmodule -t:library test-multi-netmodule-2-dll1.cs
+       @$(MCS) -addmodule:test-multi-netmodule-1-netmodule.netmodule -t:library test-multi-netmodule-3-dll2.cs
+       @$(MCS) -r:test-multi-netmodule-2-dll1.dll test-multi-netmodule-4-exe.cs
+       $(RUNTIME) test-multi-netmodule-4-exe.exe > test-multi-netmodule-4-exe.exe.stdout 2> test-multi-netmodule-4-exe.exe.stderr
+
 EXTRA_DIST += custom-attr-errors.cs custom-attr-errors-lib.cs
-test-cattr-type-load: TestDriver.dll custom-attr-errors.cs custom-attr-errors-lib.cs
+test-cattr-type-load: $(TEST_DRIVER_DEPEND) custom-attr-errors.cs custom-attr-errors-lib.cs
        $(MCS) -D:WITH_MEMBERS /t:library $(srcdir)/custom-attr-errors-lib.cs
        $(MCS) -r:TestDriver.dll -r:custom-attr-errors-lib.dll  $(srcdir)/custom-attr-errors.cs
        $(MCS) /t:library $(srcdir)/custom-attr-errors-lib.cs
@@ -1071,31 +1137,31 @@ SGEN_REGULAR_TESTS= \
 endif
 
 sgen-regular-tests: $(SGEN_REGULAR_TESTS)
-       $(MAKE) sgen-regular-tests-plain
+       $(MAKE) sgen-regular-tests-ms
        $(MAKE) sgen-regular-tests-ms-conc
        $(MAKE) sgen-regular-tests-ms-conc-split
        $(MAKE) sgen-regular-tests-ms-split
-       $(MAKE) sgen-regular-tests-ms-split-95
-       $(MAKE) sgen-regular-tests-plain-clear-at-gc
+       $(MAKE) sgen-regular-tests-ms-conc-split-95
+       $(MAKE) sgen-regular-tests-ms-clear-at-gc
        $(MAKE) sgen-regular-tests-ms-conc-clear-at-gc
-       $(MAKE) sgen-regular-tests-ms-split-clear-at-gc
+       $(MAKE) sgen-regular-tests-ms-conc-split-clear-at-gc
 
-sgen-regular-tests-plain: $(SGEN_REGULAR_TESTS) test-runner.exe
-       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="" MONO_GC_PARAMS="" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_REGULAR_TESTS)
+sgen-regular-tests-ms: $(SGEN_REGULAR_TESTS) test-runner.exe
+       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="" MONO_GC_PARAMS="major=marksweep" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_REGULAR_TESTS)
 sgen-regular-tests-ms-conc: $(SGEN_REGULAR_TESTS) test-runner.exe
        MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="" MONO_GC_PARAMS="major=marksweep-conc" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_REGULAR_TESTS)
 sgen-regular-tests-ms-conc-split: $(SGEN_REGULAR_TESTS) test-runner.exe
        MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="" MONO_GC_PARAMS="major=marksweep-conc,minor=split" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_REGULAR_TESTS)
 sgen-regular-tests-ms-split: $(SGEN_REGULAR_TESTS) test-runner.exe
-       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="" MONO_GC_PARAMS="minor=split" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_REGULAR_TESTS)
-sgen-regular-tests-ms-split-95: $(SGEN_REGULAR_TESTS) test-runner.exe
-       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="" MONO_GC_PARAMS="minor=split,alloc-ratio=95" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_REGULAR_TESTS)
-sgen-regular-tests-plain-clear-at-gc: $(SGEN_REGULAR_TESTS) test-runner.exe
-       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="clear-at-gc" MONO_GC_PARAMS="" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_REGULAR_TESTS)
+       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="" MONO_GC_PARAMS="major=marksweep,minor=split" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_REGULAR_TESTS)
+sgen-regular-tests-ms-conc-split-95: $(SGEN_REGULAR_TESTS) test-runner.exe
+       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="" MONO_GC_PARAMS="major=marksweep-conc,minor=split,alloc-ratio=95" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_REGULAR_TESTS)
+sgen-regular-tests-ms-clear-at-gc: $(SGEN_REGULAR_TESTS) test-runner.exe
+       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="clear-at-gc" MONO_GC_PARAMS="major=marksweep" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_REGULAR_TESTS)
 sgen-regular-tests-ms-conc-clear-at-gc: $(SGEN_REGULAR_TESTS) test-runner.exe
        MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="clear-at-gc" MONO_GC_PARAMS="major=marksweep-conc" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_REGULAR_TESTS)
-sgen-regular-tests-ms-split-clear-at-gc: $(SGEN_REGULAR_TESTS) test-runner.exe
-       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="clear-at-gc" MONO_GC_PARAMS="minor=split" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_REGULAR_TESTS)
+sgen-regular-tests-ms-conc-split-clear-at-gc: $(SGEN_REGULAR_TESTS) test-runner.exe
+       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="clear-at-gc" MONO_GC_PARAMS="major=marksweep-conc,minor=split" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_REGULAR_TESTS)
 
 SGEN_TOGGLEREF_TESTS=  \
        sgen-toggleref.exe
@@ -1260,23 +1326,23 @@ test-aot:
 
 # Generated tests for runtime invoke
 EXTRA_DIST += gen-runtime-invoke.cs
-runtime-invoke.gen.exe: TestDriver.dll gen-runtime-invoke.exe
+runtime-invoke.gen.exe: $(TEST_DRIVER_DEPEND) 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
 
 EXTRA_DIST += make-imt-test.cs
-imt_big_iface_test.exe: TestDriver.dll make-imt-test.exe
+imt_big_iface_test.exe: $(TEST_DRIVER_DEPEND) 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
 
 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
+test-inline-call-stack-library.dll: $(TEST_DRIVER_DEPEND) $(srcdir)/test-inline-call-stack-library.cs
        $(MCS) -t:library -out:test-inline-call-stack-library.dll $(srcdir)/test-inline-call-stack-library.cs
 if INSTALL_MOBILE_STATIC
        $(RUNTIME) $(AOT_BUILD_FLAGS) $@
 endif
 
-test-inline-call-stack.exe: TestDriver.dll test-inline-call-stack-library.dll $(srcdir)/test-inline-call-stack.cs
+test-inline-call-stack.exe: $(TEST_DRIVER_DEPEND) test-inline-call-stack-library.dll $(srcdir)/test-inline-call-stack.cs
        $(MCS) -r:TestDriver.dll -r:test-inline-call-stack-library.dll -out:test-inline-call-stack.exe $(srcdir)/test-inline-call-stack.cs
 
 EXTRA_DIST += unhandled-exception-base-configuration.config
@@ -1484,7 +1550,7 @@ test-generic-sharing-normal: $(GSHARED_TESTS)
        done
 
 test-generic-sharing-managed: test-runner.exe $(GSHARED_TESTS)
-       @$(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) -j a --testsuite-name "gshared" --opt-sets "gshared gshared,shared gshared,-inline gshared,-inline,shared" $(GSHARED_TESTS)
+       @$(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) -j a --testsuite-name "gshared" --disabled "$(DISABLED_TESTS)" --opt-sets "gshared gshared,shared gshared,-inline gshared,-inline,shared" $(GSHARED_TESTS)
 
 if NACL_CODEGEN
 test-generic-sharing:
@@ -1503,7 +1569,7 @@ 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 TestDriver.dll
+modules.exe: modules.cs modules-m1.netmodule $(TEST_DRIVER_DEPEND) 
        $(MCS) -out:$@ /addmodule:modules-m1.netmodule -r:TestDriver.dll $(srcdir)/modules.cs
 
 # Useful if mono is compiled with --enable-shared=no
@@ -1561,13 +1627,13 @@ test-unhandled-exception-2: $(UNHANDLED_EXCEPTION_1_TESTS) $(UNHANDLED_EXCEPTION
        $(MAKE) test-unhandled-exception-2-255-without-managed-handler
 
 test-unhandled-exception-2-1-with-managed-handler: $(UNHANDLED_EXCEPTION_1_TESTS) test-runner.exe
-       $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) -j a --testsuite-name $@ --expected-exit-code 1 $(UNHANDLED_EXCEPTION_1_TESTS)
+       $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) -j a --testsuite-name $@ --disabled "$(DISABLED_TESTS)" --expected-exit-code 1 $(UNHANDLED_EXCEPTION_1_TESTS)
 test-unhandled-exception-2-1-without-managed-handler: $(UNHANDLED_EXCEPTION_1_TESTS) test-runner.exe
-       TEST_UNHANDLED_EXCEPTION_HANDLER=1 $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) -j a --testsuite-name $@ --expected-exit-code 1 $(UNHANDLED_EXCEPTION_1_TESTS)
+       TEST_UNHANDLED_EXCEPTION_HANDLER=1 $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) -j a --testsuite-name $@ --disabled "$(DISABLED_TESTS)" --expected-exit-code 1 $(UNHANDLED_EXCEPTION_1_TESTS)
 test-unhandled-exception-2-255-with-managed-handler: $(UNHANDLED_EXCEPTION_255_TESTS) test-runner.exe
-       $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) -j a --testsuite-name $@ --expected-exit-code 255 $(UNHANDLED_EXCEPTION_255_TESTS)
+       $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) -j a --testsuite-name $@ --disabled "$(DISABLED_TESTS)" --expected-exit-code 255 $(UNHANDLED_EXCEPTION_255_TESTS)
 test-unhandled-exception-2-255-without-managed-handler: $(UNHANDLED_EXCEPTION_255_TESTS) test-runner.exe
-       TEST_UNHANDLED_EXCEPTION_HANDLER=1 $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) -j a --testsuite-name $@ --expected-exit-code 255 $(UNHANDLED_EXCEPTION_255_TESTS)
+       TEST_UNHANDLED_EXCEPTION_HANDLER=1 $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) -j a --testsuite-name $@ --disabled "$(DISABLED_TESTS)" --expected-exit-code 255 $(UNHANDLED_EXCEPTION_255_TESTS)
 
 endif