From: Alexander Kyte Date: Wed, 7 Jun 2017 18:43:58 +0000 (-0400) Subject: [runtime] Use mkbundle in BCL tests X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=mono.git;a=commitdiff_plain;h=f9152041163279c1a7735b5b064b0cf5116940d9 [runtime] Use mkbundle in BCL tests --- diff --git a/mcs/build/tests.make b/mcs/build/tests.make index 8ffa784a23a..39360851291 100644 --- a/mcs/build/tests.make +++ b/mcs/build/tests.make @@ -141,10 +141,27 @@ ifdef TEST_NUNITLITE_APP_CONFIG_RUNTIME sed -i -e "/__INSERT_CUSTOM_APP_CONFIG_RUNTIME__/r $(TEST_NUNITLITE_APP_CONFIG_RUNTIME)" $(NUNITLITE_CONFIG_FILE) endif +ifdef STATIC_AOT_BUNDLE + +TEST_HARNESS_EXEC = $(TEST_HARNESS).static +TEST_HARNESS_BIN = $(TEST_HARNESS_EXEC) +MKBUNDLE_EXE = $(topdir)/class/lib/$(PROFILE)/mkbundle.exe +BUNDLED_ASSEMBLIES := $(sort $(patsubst .//%,%,$(filter-out %.exe.static %.dll.dll %.exe.dll %bare% %plaincore% %secxml% %Facades% %ilasm%,$(filter %.dll %.exe,$(wildcard $(topdir)/class/lib/$(PROFILE)/*))))) + +$(MKBUNDLE_EXE): + make -C $(topdir)/tools/mkbundle + +$(TEST_HARNESS_BIN): $(MKBUNDLE_EXE) + $(TEST_RUNTIME) $(MKBUNDLE_EXE) -L $(topdir)/class/lib/$(PROFILE) -v --deps $(TEST_HARNESS) $(BUNDLED_ASSEMBLIES) -o $(TEST_HARNESS_BIN) --aot-mode $(STATIC_AOT_BUNDLE) --aot-runtime $(RUNTIME) + +else +TEST_HARNESS_EXEC = $(TEST_RUNTIME) $(RUNTIME_FLAGS) $(AOT_RUN_FLAGS) $(TEST_HARNESS) +endif + ## FIXME: i18n problem in the 'sed' command below -run-test-lib: test-local test-local-aot-compile patch-nunitlite-appconfig +run-test-lib: test-local test-local-aot-compile patch-nunitlite-appconfig $(TEST_HARNESS_BIN) ok=:; \ - PATH="$(TEST_RUNTIME_WRAPPERS_PATH):$(PATH)" MONO_REGISTRY_PATH="$(HOME)/.mono/registry" MONO_TESTS_IN_PROGRESS="yes" $(TEST_RUNTIME) $(RUNTIME_FLAGS) $(AOT_RUN_FLAGS) $(TEST_HARNESS) $(test_assemblies) $(NOSHADOW_FLAG) $(TEST_HARNESS_FLAGS) $(LOCAL_TEST_HARNESS_FLAGS) $(TEST_HARNESS_EXCLUDES) $(LABELS_ARG) -format:nunit2 -result:TestResult-$(PROFILE).xml $(FIXTURE_ARG) $(TESTNAME_ARG)|| ok=false; \ + PATH="$(TEST_RUNTIME_WRAPPERS_PATH):$(PATH)" MONO_REGISTRY_PATH="$(HOME)/.mono/registry" MONO_TESTS_IN_PROGRESS="yes" $(TEST_HARNESS_EXEC) $(test_assemblies) $(NOSHADOW_FLAG) $(TEST_HARNESS_FLAGS) $(LOCAL_TEST_HARNESS_FLAGS) $(TEST_HARNESS_EXCLUDES) $(LABELS_ARG) -format:nunit2 -result:TestResult-$(PROFILE).xml $(FIXTURE_ARG) $(TESTNAME_ARG)|| ok=false; \ if [ ! -f "TestResult-$(PROFILE).xml" ]; then echo "The test runner didn't produce a test result XML, probably due to a crash of the runtime. Check the log for more details." > TestResult-$(PROFILE).xml; fi; \ $$ok diff --git a/mcs/tools/mkbundle/mkbundle.cs b/mcs/tools/mkbundle/mkbundle.cs index dd19a7b2b21..a929ed237e6 100755 --- a/mcs/tools/mkbundle/mkbundle.cs +++ b/mcs/tools/mkbundle/mkbundle.cs @@ -369,6 +369,7 @@ class MakeBundle { var dedup_file = args [++i]; sources.Add (dedup_file); aot_dedup_assembly = sources.Count () - 1; + aot_compile = true; break; case "--aot-mode": if (i+1 == top) { @@ -377,7 +378,6 @@ class MakeBundle { } aot_mode = args [++i]; - if (aot_mode != "full" && aot_mode != "llvmonly") { Console.WriteLine ("Need string of aot mode (full, llvmonly). Omit for normal AOT."); return 1; @@ -1439,6 +1439,15 @@ void mono_register_config_for_assembly (const char* assembly_name, cons if (aot_runtime == null) aot_runtime = runtime; + if (aot_runtime == null || aot_runtime.Length == 0){ + if (IsUnix) + aot_runtime = Process.GetCurrentProcess().MainModule.FileName; + else { + Error ("You must specify at least one aot runtime with --runtime or --cross or --aot_runtime when AOT compiling"); + Environment.Exit (1); + } + } + var aot_mode_string = ""; if (aot_mode != null) aot_mode_string = "," + aot_mode; @@ -1463,6 +1472,9 @@ void mono_register_config_for_assembly (const char* assembly_name, cons all_assemblies.Append (" "); Execute (String.Format ("{0} --aot={1},outfile={2}{3}{4} {5}", aot_runtime, aot_args, outPath, aot_mode_string, dedup_mode_string, path)); + } else { + Execute (String.Format ("{0} --aot={1},outfile={2}{3} {4}", + aot_runtime, aot_args, outPath, aot_mode_string, path)); } } if (aot_dedup_assembly != null) {