[io-layer] Extract socket (#4241)
[mono.git] / mono / tests / Makefile.am
index a80cd07e119941c41050adb154584ffb3bf9cad2..14d9edc4c526fddb4c75531473b4012ed096801f 100644 (file)
@@ -1,6 +1,6 @@
 SUBDIRS = assemblyresolve gc-descriptors
 
-if INSTALL_MOBILE_STATIC
+if INSTALL_TESTING_AOT_FULL
 FEATUREFUL_RUNTIME_TEST =  
 else
 FEATUREFUL_RUNTIME_TEST = test-appdomain-unload
@@ -41,16 +41,21 @@ CLASS=$(mcs_topdir)/class/lib/$(DEFAULT_PROFILE)
 with_mono_path = MONO_PATH=$(CLASS)
 
 RUNTIME = $(with_mono_path) $(top_builddir)/runtime/mono-wrapper
+TOOLS_RUNTIME = MONO_PATH=$(mcs_topdir)/class/lib/build $(top_builddir)/runtime/mono-wrapper --aot-path=$(mcs_topdir)/class/lib/build
 
 MKBUNDLE = \
        PKG_CONFIG_PATH=$(top_builddir):$(PKG_CONFIG_PATH) \
        $(RUNTIME) $(CLASS)/mkbundle.exe
 
-if INSTALL_MOBILE_STATIC
-PROFILE_MCS_FLAGS = -d:MOBILE,MOBILE_STATIC,MOBILE_LEGACY 
+if INSTALL_TESTING_AOT_FULL
+PROFILE_MCS_FLAGS = -d:MOBILE,MOBILE_LEGACY,FULL_AOT_DESKTOP 
 endif
 
-MCS_NO_LIB = $(RUNTIME) $(mcs_topdir)/class/lib/build/mcs.exe -unsafe -debug \
+if INSTALL_TESTING_AOT_HYBRID
+PROFILE_MCS_FLAGS = -d:MOBILE,MOBILE_LEGACY 
+endif
+
+MCS_NO_LIB = $(TOOLS_RUNTIME) $(CSC) -unsafe -debug:portable \
        -noconfig -nologo \
        -nowarn:0162 -nowarn:0168 -nowarn:0219 -nowarn:0414 -nowarn:0618 \
        -nowarn:0169 -nowarn:1690 -nowarn:0649 -nowarn:0612 -nowarn:3021 \
@@ -58,9 +63,9 @@ MCS_NO_LIB = $(RUNTIME) $(mcs_topdir)/class/lib/build/mcs.exe -unsafe -debug \
 
 MCS = $(MCS_NO_LIB) -lib:$(CLASS)
 
-ILASM = $(RUNTIME) $(CLASS)/ilasm.exe
+ILASM = $(TOOLS_RUNTIME) $(mcs_topdir)/class/lib/build/ilasm.exe
 
-if INSTALL_MOBILE_STATIC
+if INSTALL_TESTING_AOT_FULL
 TEST_RUNNER = ./test-runner.exe --runtime $(top_builddir)/runtime/mono-wrapper --mono-path "$(CLASS)" --aot-run-flags "$(AOT_RUN_FLAGS)" --aot-build-flags "$(AOT_BUILD_FLAGS)"
 else
 TEST_RUNNER = ./test-runner.exe --runtime $(top_builddir)/runtime/mono-wrapper --mono-path "$(CLASS)"
@@ -472,7 +477,8 @@ BASE_TEST_CS_SRC=           \
        generic-unloading.2.cs  \
        namedmutex-destroy-race.cs      \
        thread6.cs      \
-       appdomain-threadpool-unload.cs
+       appdomain-threadpool-unload.cs  \
+       process-unref-race.cs
 
 TEST_CS_SRC_DIST=      \
        $(BASE_TEST_CS_SRC)     \
@@ -583,7 +589,7 @@ if X86
 
 if HOST_WIN32
 PLATFORM_DISABLED_TESTS=async-exc-compilation.exe finally_guard.exe finally_block_ending_in_dead_bb.exe \
-       bug-18026.exe monitor.exe threadpool-exceptions5.exe
+       bug-18026.exe monitor.exe threadpool-exceptions5.exe process-unref-race.exe
 endif
 
 endif
@@ -708,7 +714,7 @@ endif
 
 PROFILE_DISABLED_TESTS=
 
-if INSTALL_MOBILE_STATIC
+if INSTALL_TESTING_AOT_FULL
 # Tests which rely on TypeLoadExceptions
 # In full-aot mode, these cause the relevant methods to be not AOTed.
 PROFILE_DISABLED_TESTS += \
@@ -747,7 +753,7 @@ PROFILE_DISABLED_TESTS += \
        thunks.exe
 
 # Tests which load assemblies which are not
-# in the mobile_static profile
+# in the testing_aot_full profile
 PROFILE_DISABLED_TESTS += \
        assembly-load-remap.exe
 
@@ -835,17 +841,21 @@ PROFILE_DISABLED_TESTS += \
        bug-515884.exe
 endif
 
+if INSTALL_TESTING_AOT_HYBRID
+PROFILE_DISABLED_TESTS += \
+       bug-80307.exe \
+       namedmutex-destroy-race.exe
+endif
+
 AOT_DISABLED_TESTS= \
        constraints-load.exe
 
 CI_DISABLED_TESTS = \
        main-returns-background-resetabort.exe \
        main-returns-background-abort-resetabort.exe    \
-       thread6.exe     \
        assemblyresolve_event3.exe \
        delegate2.exe   \
        finally_guard.exe \
-       gc-altstack.exe \
        generic-xdomain.2.exe
 
 # failing tests which we temporarily disable for PRs
@@ -854,6 +864,12 @@ CI_PR_DISABLED_TESTS = \
        appdomain-threadpool-unload.exe \
        appdomain-thread-abort.exe
 
+# appdomain-threadpool-unload.exe creates 100 appdomains, takes too long with llvm
+LLVM_DISABLED_TESTS = \
+       appdomain-threadpool-unload.exe
+
+LLVM = $(filter --llvm, $(MONO_ENV_OPTIONS))
+
 # 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
@@ -876,7 +892,8 @@ DISABLED_TESTS=                     \
        $(PROFILE_DISABLED_TESTS) \
        $(if $(AOT),$(AOT_DISABLED_TESTS)) \
        $(if $(CI),$(CI_DISABLED_TESTS)) \
-       $(if $(CI_PR),$CI_PR_DISABLED_TESTS)
+       $(if $(CI_PR),$CI_PR_DISABLED_TESTS) \
+       $(if $(LLVM),$(LLVM_DISABLED_TESTS))
 
 # pre-requisite test sources: files that are not test themselves
 # but that need to be compiled
@@ -905,11 +922,13 @@ EXTRA_DIST=test-driver test-runner.cs $(TEST_CS_SRC_DIST) $(TEST_IL_SRC) \
 %.exe: %.il
        $(ILASM) -out:$@ $<
 
-if !INSTALL_MOBILE_STATIC
+if !INSTALL_TESTING_AOT_FULL
+if !INSTALL_TESTING_AOT_HYBRID
 TEST_DRIVER_HARD_KILL_FEATURE=-r:Mono.Posix.dll
 endif
+endif
 
-if INSTALL_MOBILE_STATIC
+if INSTALL_TESTING_AOT_FULL
 TEST_DRIVER_DEPEND=TestDriver.dll$(PLATFORM_AOT_SUFFIX)
 else
 TEST_DRIVER_DEPEND=TestDriver.dll
@@ -962,7 +981,7 @@ bug-81466-lib.dll$(PLATFORM_AOT_SUFFIX)     \
 TestingReferenceAssembly.dll$(PLATFORM_AOT_SUFFIX)     \
 TestingReferenceReferenceAssembly.dll$(PLATFORM_AOT_SUFFIX)
 
-if INSTALL_MOBILE_STATIC
+if INSTALL_TESTING_AOT_FULL
 prereqs: $(PREREQSI_IL_AOT) $(PREREQSI_CS_AOT) $(AOT_EXTRA_LIBS)
 else
 prereqs: $(PREREQSI_IL) $(PREREQSI_CS)
@@ -1007,7 +1026,7 @@ test-sgen : sgen-tests
 # Precompile the test assemblies in parallel
 compile-tests:
        $(MAKE) -j4 $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la $(PREREQSI_IL) $(PREREQSI_CS)
-if INSTALL_MOBILE_STATIC
+if INSTALL_TESTING_AOT_FULL
        $(MAKE) $(PREREQSI_IL_AOT) $(PREREQSI_CS_AOT) $(AOT_EXTRA_LIBS)
 endif
 
@@ -1216,7 +1235,7 @@ SGEN_REGULAR_TESTS_SRC =  \
 
 SGEN_REGULAR_DISABLED_TESTS=
 
-if INSTALL_MOBILE_STATIC
+if INSTALL_TESTING_AOT_FULL
 SGEN_REGULAR_DISABLED_TESTS += \
        sgen-domain-unload.exe  \
        sgen-domain-unload-2.exe
@@ -1387,7 +1406,7 @@ test-aot:
        passed=0; \
        failed_tests="";\
        profile=$(DEFAULT_PROFILE);     \
-       tmpfile=`mktemp -t mono_aot_output` || exit 1;  \
+       tmpfile=`mktemp -t mono_aot_outputXXXXXX` || exit 1;    \
        rm -f test-aot-$${name}.stdout test-aot-$${name}.stderr; \
        for assembly in $(mcs_topdir)/class/lib/$$profile/*.dll ; do    \
                asm_name=`basename $$assembly`; \
@@ -1426,7 +1445,7 @@ imt_big_iface_test.exe: $(TEST_DRIVER_DEPEND) make-imt-test.exe
 EXTRA_DIST += test-inline-call-stack-library.cs test-inline-call-stack.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
+if INSTALL_TESTING_AOT_FULL
        $(RUNTIME) $(AOT_BUILD_FLAGS) $@
 endif
 
@@ -1473,7 +1492,7 @@ bug-81673.exe bug-81673-interface.dll: $(srcdir)/bug-81673.cs $(srcdir)/bug-8167
        $(MCS) -target:library -out:bug-81673-interface.dll $(srcdir)/bug-81673-interface.cs
        $(MCS) -out:bug-81673.exe -r:bug-81673-interface.dll $(srcdir)/bug-81673.cs
        $(MCS) -define:WITH_STOP -target:library -out:bug-81673-interface.dll $(srcdir)/bug-81673-interface.cs
-if INSTALL_MOBILE_STATIC
+if INSTALL_TESTING_AOT_FULL
        $(RUNTIME) $(AOT_BUILD_FLAGS) $@
 endif
 
@@ -1482,7 +1501,7 @@ bug-36848.exe bug-36848-a.dll: $(srcdir)/bug-36848.cs $(srcdir)/bug-36848-a.cs
        $(MCS) -target:library -out:bug-36848-a.dll $(srcdir)/bug-36848-a.cs
        $(MCS) -r:bug-36848-a.dll -out:bug-36848.exe $(srcdir)/bug-36848.cs
        $(MCS) -target:library -out:bug-36848-a.dll $(srcdir)/bug-36848-a.cs /define:WITH_STOP
-if INSTALL_MOBILE_STATIC
+if INSTALL_TESTING_AOT_FULL
        $(RUNTIME) $(AOT_BUILD_FLAGS) $@
 endif
 
@@ -1497,7 +1516,7 @@ bug-81691.exe: bug-81691-b.dll
 EXTRA_DIST += bug-81466-lib.il
 bug-81466-lib.dll: bug-81466-lib.il
        $(ILASM) /dll /output:bug-81466-lib.dll $(srcdir)/bug-81466-lib.il
-if INSTALL_MOBILE_STATIC
+if INSTALL_TESTING_AOT_FULL
        $(RUNTIME) $(AOT_BUILD_FLAGS) $@
 endif
 bug-81466.exe: bug-81466.il bug-81466-lib.dll
@@ -1506,7 +1525,7 @@ bug-81466.exe: bug-81466.il bug-81466-lib.dll
 EXTRA_DIST += bug-324535-il.il
 bug-324535-il.dll : bug-324535-il.il
        $(ILASM) /dll /output:bug-324535-il.dll $(srcdir)/bug-324535-il.il
-if INSTALL_MOBILE_STATIC
+if INSTALL_TESTING_AOT_FULL
        $(RUNTIME) $(AOT_BUILD_FLAGS) $@
 endif
 bug-324535.exe : bug-324535.cs bug-324535-il.dll
@@ -1515,7 +1534,7 @@ bug-324535.exe : bug-324535.cs bug-324535-il.dll
 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
-if INSTALL_MOBILE_STATIC
+if INSTALL_TESTING_AOT_FULL
        $(RUNTIME) $(AOT_BUILD_FLAGS) $@
 endif
 custom-modifiers.2.exe: custom-modifiers.2.cs custom-modifiers-lib.dll
@@ -1524,7 +1543,7 @@ custom-modifiers.2.exe: custom-modifiers.2.cs custom-modifiers-lib.dll
 EXTRA_DIST += bug-382986-lib.cs
 bug-382986-lib.dll: bug-382986-lib.cs
        $(MCS) -target:library -out:$@ $(srcdir)/bug-382986-lib.cs
-if INSTALL_MOBILE_STATIC
+if INSTALL_TESTING_AOT_FULL
        $(RUNTIME) $(AOT_BUILD_FLAGS) $@
 endif
 
@@ -1551,14 +1570,14 @@ test-coreclr-security : coreclr-security.exe
 EXTRA_DIST += generic-unboxing.2.il
 generic-unboxing.2.dll : generic-unboxing.2.il
        $(ILASM) /dll /output:generic-unboxing.2.dll $(srcdir)/generic-unboxing.2.il
-if INSTALL_MOBILE_STATIC
+if INSTALL_TESTING_AOT_FULL
        $(RUNTIME) $(AOT_BUILD_FLAGS) $@
 endif
 
 EXTRA_DIST += generic-boxing.2.il
 generic-boxing.2.dll : generic-boxing.2.il generic-unboxing.2.dll
        $(ILASM) /dll /output:generic-boxing.2.dll $(srcdir)/generic-boxing.2.il
-if INSTALL_MOBILE_STATIC
+if INSTALL_TESTING_AOT_FULL
        $(RUNTIME) $(AOT_BUILD_FLAGS) $@
 endif
 
@@ -1573,7 +1592,7 @@ generic-box.2.exe : generic-box.2.cs generic-unboxing.2.dll generic-boxing.2.dll
 EXTRA_DIST += generic-delegate2.2.cs generic-delegate2-lib.2.il
 generic-delegate2-lib.2.dll : generic-delegate2-lib.2.il
        $(ILASM) /dll /output:$@ $(srcdir)/generic-delegate2-lib.2.il
-if INSTALL_MOBILE_STATIC
+if INSTALL_TESTING_AOT_FULL
        $(RUNTIME) $(AOT_BUILD_FLAGS) $@
 endif
 generic-delegate2.2.exe : generic-delegate2.2.cs generic-delegate2-lib.2.dll
@@ -1644,7 +1663,7 @@ GSHARED_TESTS_SRC = \
 
 GSHARED_DISABLED_TESTS=
 
-if INSTALL_MOBILE_STATIC
+if INSTALL_TESTING_AOT_FULL
 GSHARED_DISABLED_TESTS += \
        generic-type-builder.2.exe
 endif
@@ -1775,6 +1794,11 @@ test-process-stress: $(PROCESS_STRESS_TESTS) test-runner.exe
 coreclr-gcstress:
        $(MAKE) -C $(mono_build_root)/acceptance-tests coreclr-gcstress
 
+# Tests for the Mono lldb plugin
+EXTRA_DIST += test_lldb.py test-lldb.cs
+test-lldb: test-lldb.exe
+       python test_lldb.py $(JITTEST_PROG)
+
 noinst_LTLIBRARIES = libtest.la
 
 AM_CPPFLAGS = $(GLIB_CFLAGS)