INVARIANT_AOT_OPTIONS=nimt-trampolines=2000,ntrampolines=8000,nrgctx-fetch-trampolines=256,ngsharedvt-trampolines=4000
-AOT_BUILD_ATTRS=$INVARIANT_AOT_OPTIONS
-
if test x$cross_compiling = xyes -o x$enable_mcs_build = xno; then
DISABLE_MCS_DOCS_default=yes
elif test x$with_runtime_preset = xnet_4_x; then
mono_feature_disable_appdomains='yes'
AOT_BUILD_FLAGS="--runtime=mobile -O=gsharedvt --aot=full,$INVARIANT_AOT_OPTIONS"
+
AOT_RUN_FLAGS="--runtime=mobile --full-aot"
- AOT_MODE="full"
elif test x$with_runtime_preset = xbitcode; then
DISABLE_MCS_DOCS_default=yes
with_testing_aot_full_default=yes
AOT_BUILD_FLAGS="--runtime=mobile --aot=llvmonly,$INVARIANT_AOT_OPTIONS"
AOT_RUN_FLAGS="--runtime=mobile --llvmonly"
- AOT_MODE="llvmonly"
elif test x$with_runtime_preset = xhybridaot; then
DISABLE_MCS_DOCS_default=yes
with_testing_aot_hybrid_default=yes
AOT_BUILD_FLAGS="--runtime=mobile --aot=full,$INVARIANT_AOT_OPTIONS"
AOT_RUN_FLAGS="--runtime=mobile --full-aot"
- AOT_MODE="llvmonly"
elif test x$with_runtime_preset = xorbis; then
DISABLE_MCS_DOCS_default=yes
with_orbis_default=yes
AOT_BUILD_FLAGS="--runtime=mobile --aot=full,$INVARIANT_AOT_OPTIONS"
AOT_RUN_FLAGS="--runtime=mobile --full-aot"
- AOT_MODE="full"
elif test x$with_runtime_preset = xunreal; then
DISABLE_MCS_DOCS_default=yes
with_unreal_default=yes
if test "x$AOT_BUILD_FLAGS" != "x" ; then
echo "AOT_RUN_FLAGS=$AOT_RUN_FLAGS" >> $srcdir/$mcsdir/build/config.make
echo "AOT_BUILD_FLAGS=$AOT_BUILD_FLAGS" >> $srcdir/$mcsdir/build/config.make
- echo "AOT_BUILD_ATTRS=$AOT_BUILD_ATTRS" >> $srcdir/$mcsdir/build/config.make
- fi
-
- if test "x$AOT_MODE" != "x" ; then
- echo "AOT_MODE=$AOT_MODE" >> $srcdir/$mcsdir/build/config.make
fi
if test "x$enable_btls" = "xyes"; then
.I "--local-targets"
Lists all of the available local cross compilation targets.
.TP
-.I "--cil-strip PATH"
-Provides a CIL stripper that mkbundle will use if able to.
-The intended use is to help reduce file size on AOT.
-.TP
-.I "--in-tree path/to/mono/source/root"
-Provides mkbundle with a mono source repository from which to pull the necessary headers for compilation.
-This allows mkbundle to run out of the project's source tree, useful for working with multiple runtimes and for
-testing without installing.
-.TP
-.I "--managed-linker PATH"
-Provides mkbundle access to a managed linker to preprocess the assemblies.
-.TP
.I "--machine-config FILE"
Uses the given FILE as the machine.config file for the generated
application.
Compresses the assemblies before embedding. This results in smaller
executable files, but increases startup time and requires zlib to be
installed on the target system.
-
-.SH AOT Options
-These options support an mkbundle using AOT compilation with static linking. A native compiler
-toolchain is required.
-.TP
-.I "--aot-runtime PATH"
-Provide the path to the mono runtime to use for AOTing assemblies.
-.TP
-.I "--aot-dedup"
-(Experimental) Deduplicate AOT'ed methods based on a unique mangling of method names.
-.TP
-.I "--aot-mode MODE"
-MODE can be either "full" or "llvmonly" at this time.
-Currently, mkbundle supports three AOT modes. The default mode (this option unset)
-will AOT methods but will fall back on runtime codegen where it is much faster or offers
-a more full compatibility profile. The "full" setting will generate the necessary stubs to
-not require runtime code generation. The "llvmonly" setting does the same, but forces all codegen
-to go through the llvm backend.
-
.SH WINDOWS
If you are using the old embedding on Windows systems, it it necessary
to have Unix-like toolchain to be installed for \fImkbundle\fP to
test_assemblies :=
-test_lib_dir = $(topdir)/class/lib/$(PROFILE)/tests
-
-test_lib_output = $(topdir)/class/lib/$(PROFILE)/tests/$(test_lib)
-
ifdef HAVE_CS_TESTS
-test_assemblies += $(test_lib_output)
+test_assemblies += $(test_lib)
endif
ifdef test_assemblies
endif
ifdef ALWAYS_AOT
-test-local-aot-compile: $(topdir)/build/deps/nunit-$(PROFILE).stamp $(test_assemblies)
- make -C $(topdir)/class aot-all-profile
+test-local-aot-compile: $(topdir)/build/deps/nunit-$(PROFILE).stamp
+ PATH="$(TEST_RUNTIME_WRAPPERS_PATH):$(PATH)" MONO_REGISTRY_PATH="$(HOME)/.mono/registry" MONO_TESTS_IN_PROGRESS="yes" $(TEST_RUNTIME) $(RUNTIME_FLAGS) $(AOT_BUILD_FLAGS) $(test_assemblies)
else
test-local-aot-compile: $(topdir)/build/deps/nunit-$(PROFILE).stamp
sed -i -e "/__INSERT_CUSTOM_APP_CONFIG_RUNTIME__/r $(TEST_NUNITLITE_APP_CONFIG_RUNTIME)" $(NUNITLITE_CONFIG_FILE)
endif
-ifdef PLATFORM_AOT_SUFFIX
-
-DEDUP_DUMMY_CS=$(topdir)/class/lib/$(PROFILE)/DummyInflated.cs
-DEDUP_DUMMY=$(topdir)/class/lib/$(PROFILE)/DummyInflated.dll
-
-$(DEDUP_DUMMY):
- echo " // Empty Assembly \n\n" > $(DEDUP_DUMMY_CS)
- $(CSCOMPILE) -t:library -out:$(DEDUP_DUMMY) $(DEDUP_DUMMY_CS)
- rm $(DEDUP_DUMMY_CS)
-
-MKBUNDLE_TEST_BIN = $(TEST_HARNESS).static
-MKBUNDLE_EXE = $(topdir)/class/lib/$(PROFILE)/mkbundle.exe
-# Pattern based on the one in AOT_PROFILE_ASSEMBLIES
-# It's easier if you read it backwards.
-# What we do here is get the files in the profile directory that end in "test.dll" or are prefixed with nunit (filter)
-# and then strip out everything that we expect to live outside the top level (filter-out)
-TEST_ASSEMBLIES:=$(sort $(patsubst .//%,%,$(filter-out %.exe.static %.dll.dll %.exe.dll %bare% %plaincore% %secxml% %Facades% %ilasm%,$(filter %.dll,$(wildcard $(topdir)/class/lib/$(PROFILE)/tests/*)))))
-
-$(MKBUNDLE_EXE): $(topdir)/tools/mkbundle/mkbundle.cs
- make -C $(topdir)/tools/mkbundle
-
-mkbundle-all-tests:
- $(Q_AOT) $(MAKE) -C $(topdir)/class do-test
- $(Q_AOT) $(MAKE) -C $(topdir)/tools/mkbundle
- $(Q_AOT) $(MAKE) $(MKBUNDLE_TEST_BIN) # recursive make re-computes variables for TEST_ASSEMBLIES
-
-ifdef MKBUNDLE_DEDUP
-MKBUNDLE_DEDUP_COND := $(DEDUP_DUMMY)
-DEDUP_ARGS=--aot-dedup $(DEDUP_DUMMY)
-endif
-
-$(MKBUNDLE_TEST_BIN): $(TEST_ASSEMBLIES) $(TEST_HARNESS) $(MKBUNDLE_EXE) $(MKBUNDLE_DEDUP_COND)
- $(Q_AOT) MONO_PATH="$(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)" PKG_CONFIG_PATH="$(topdir)/../data" $(RUNTIME) $(RUNTIME_FLAGS) $(MKBUNDLE_EXE) -L $(topdir)/class/lib/$(PROFILE) -v --deps $(TEST_HARNESS) $(TEST_ASSEMBLIES) -o $(MKBUNDLE_TEST_BIN) --aot-mode $(AOT_MODE) --aot-runtime $(RUNTIME) --aot-args $(AOT_BUILD_ATTRS) --in-tree $(topdir)/.. --managed-linker $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/monolinker.exe --config $(topdir)/../data/config --i18n all $(DEDUP_ARGS) --keeptemp
-
-endif # PLATFORM_AOT_SUFFIX
-
-ifneq ($(wildcard $(MKBUNDLE_TEST_BIN)),)
-TEST_HARNESS_EXEC=$(MKBUNDLE_TEST_BIN)
-TEST_HARNESS_EXCLUDES:=$(TEST_HARNESS_EXCLUDES),StaticLinkedAotNotWorking
-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
ok=:; \
- 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; \
+ 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; \
if [ ! -f "TestResult-$(PROFILE).xml" ]; then echo "<?xml version='1.0' encoding='utf-8'?><test-results failures='1' total='1' not-run='0' name='bcl-tests' date='$$(date +%F)' time='$$(date +%T)'><test-suite name='$(strip $(test_assemblies))' success='False' time='0'><results><test-case name='crash' executed='True' success='False' time='0'><failure><message>The test runner didn't produce a test result XML, probably due to a crash of the runtime. Check the log for more details.</message><stack-trace></stack-trace></failure></test-case></results></test-suite></test-results>" > TestResult-$(PROFILE).xml; fi; \
$$ok
ifdef HAVE_CS_TESTS
-$(test_lib_dir):
- mkdir -p $@
-
-$(test_lib_output): $(the_assembly) $(test_response) $(test_nunit_dep) $(test_lib_dir)
+$(test_lib): $(the_assembly) $(test_response) $(test_nunit_dep)
$(TEST_COMPILE) $(LIBRARY_FLAGS) -target:library -out:$@ $(test_flags) $(LOCAL_TEST_COMPILER_ONDOTNET_FLAGS) @$(test_response)
test_response_preprocessed = $(test_response)_preprocessed
-include $(test_makefrag)
-build-test-lib: $(test_lib_output)
+build-test-lib: $(test_lib)
@echo Building testing lib
endif
$(TEST_RESX_RESOURCES): %.resources: %.resx
$(RESGEN) $< || cp $@.prebuilt $@
-$(test_lib_output): $(TEST_RESX_RESOURCES) $(test_lib_dir)
+$(test_lib): $(TEST_RESX_RESOURCES)
var xml = XmlReader.Create (new StringReader (empty_project_xml), null, "file:///foo.xml");
// This creator does not fill FullPath...
var root = ProjectRootElement.Create (xml);
-
- // Expected to run from mcs/class/lib/profile
- var dir_name = Path.GetDirectoryName (new Uri (GetType ().Assembly.CodeBase).LocalPath);
- var namespace_path = Path.Combine (Directory.GetParent (dir_name).Parent.FullName, "Microsoft.Build");
-
Assert.IsNull (root.FullPath, "#2");
- Assert.AreEqual (namespace_path, root.DirectoryPath, "#3");
+ Assert.AreEqual (Path.GetDirectoryName (new Uri (GetType ().Assembly.CodeBase).LocalPath), root.DirectoryPath, "#3");
}
[Test]
{
var root = ProjectRootElement.Create ();
root.FullPath = "test" + Path.DirectorySeparatorChar + "foo.xml";
-
- // Expected to run from mcs/class/lib/profile
- var dir_name = Path.GetDirectoryName (new Uri (GetType ().Assembly.CodeBase).LocalPath);
- var namespace_path = Path.Combine (Directory.GetParent (dir_name).Parent.FullName, "Microsoft.Build");
- var full = Path.Combine (namespace_path, "test", "foo.xml");
+ var full = Path.Combine (Path.GetDirectoryName (new Uri (GetType ().Assembly.CodeBase).LocalPath), "test", "foo.xml");
Assert.AreEqual (full, root.FullPath, "#1");
Assert.AreEqual (Path.GetDirectoryName (full), root.DirectoryPath, "#1");
}
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
-ifdef MOBILE_PROFILE
-NO_TEST = yes
-endif
-
EXTRA_DISTFILES = \
Test/Resources/test.cer \
Test/Resources/test_neg_serial.cer \
RESX_RESOURCE_STRING = ../../../external/corefx/src/System.Security.Cryptography.Xml/src/Resources/Strings.resx
-ifdef MOBILE_PROFILE
-NO_TEST = yes
-endif
-
include ../../build/library.make
$(build_lib): $(secxml_libdir)/System.dll $(MONO_SECURITY_DLL)
if (!name.EndsWith (".xml"))
name = name + ".xml";
var uri = new Uri (asm.CodeBase);
- // Run from mcs/class/lib/<profile>
var path = Path.GetDirectoryName (uri.AbsolutePath);
- path = Directory.GetParent (path).Parent.FullName;
- path = Path.Combine (path, "System.ServiceModel");
path = Path.Combine (path, "Test");
path = Path.Combine (path, "MetadataTests");
path = Path.Combine (path, "Resources");
name = name + ".config";
var uri = new Uri (asm.CodeBase);
var path = Path.GetDirectoryName (uri.AbsolutePath);
- path = Directory.GetParent (path).Parent.FullName;
- path = Path.Combine (path, "System.ServiceModel");
path = Path.Combine (path, "Test");
path = Path.Combine (path, "MetadataTests");
path = Path.Combine (path, "Resources");
static CacheItemPriorityQueueTest ()
{
- // Assumes this is compiled into mcs/class/lib/<profile>
- string class_dir = Directory.GetParent (Path.GetDirectoryName (Assembly.GetExecutingAssembly ().Location)).Parent.FullName;
- string system_web_dir = Path.Combine (class_dir, "System.Web", "Test", "System.Web.Caching");
- dataDir = Path.Combine (system_web_dir, DATA_DIR);
+ dataDir =
+ Path.Combine (
+ Path.Combine (
+ Path.Combine (Path.GetDirectoryName (Assembly.GetExecutingAssembly ().Location), "Test"),
+ "System.Web.Caching"),
+ DATA_DIR);
}
void RunTest (string testsFileName, string listFileName)
}\r
\r
[Test]\r
- [Category ("StaticLinkedAotNotWorking")] // Can't find .dll files when bundled in .exe\r
public void TestAsync ()\r
{\r
var loc = Assembly.GetExecutingAssembly ().Location;\r
$(build_lib): $(CYCLIC_DEP_FILES)
-$(test_lib_output): $(TEST_RESOURCES) $(test_lib_dir)
+$(test_lib): $(TEST_RESOURCES)
CLEAN_FILES = $(test_lib).config $(bare_libdir)/System.dll $(secxml_libdir)/System.dll $(bare_libdir)/System.dll.mdb $(secxml_libdir)/System.dll.mdb
[Test]
[ExpectedException (typeof (ArgumentNullException))]
- [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
public void Constructor_Null ()
{
DeflateStream ds = new DeflateStream (null, CompressionMode.Compress);
[Test]
[ExpectedException (typeof (ArgumentException))]
- [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
public void Constructor_InvalidCompressionMode ()
{
DeflateStream ds = new DeflateStream (new MemoryStream (), (CompressionMode)Int32.MinValue);
}
[Test]
- [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
public void CheckCompressDecompress ()
{
byte [] data = new byte[100000];
}
[Test]
- [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
public void CheckDecompress ()
{
MemoryStream backing = new MemoryStream (compressed_data);
// https://bugzilla.xamarin.com/show_bug.cgi?id=22346
[Test]
- [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
public void CheckEmptyRead ()
{
byte [] dummy = new byte[1];
}
[Test]
- [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
[ExpectedException (typeof (ArgumentNullException))]
public void CheckNullRead ()
{
}
[Test]
- [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
[ExpectedException (typeof (InvalidOperationException))]
public void CheckCompressingRead ()
{
}
[Test]
- [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
[ExpectedException (typeof (ArgumentException))]
public void CheckRangeRead ()
{
#if !MOBILE
[Test]
- [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
[Category("NotWorking")]
[ExpectedException (typeof (InvalidDataException))]
public void CheckInvalidDataRead ()
#endif
[Test]
- [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
[ExpectedException (typeof (ObjectDisposedException))]
public void CheckClosedRead ()
{
}
[Test]
- [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
[ExpectedException (typeof (ObjectDisposedException))]
public void CheckClosedFlush ()
{
}
[Test]
- [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
[ExpectedException (typeof (NotSupportedException))]
public void CheckSeek ()
{
}
[Test]
- [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
[ExpectedException (typeof (NotSupportedException))]
public void CheckSetLength ()
{
}
[Test]
- [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
public void CheckGetCanSeekProp ()
{
MemoryStream backing = new MemoryStream (compressed_data);
}
[Test]
- [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
public void CheckGetCanReadProp ()
{
MemoryStream backing = new MemoryStream (compressed_data);
}
[Test]
- [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
public void CheckGetCanWriteProp ()
{
MemoryStream backing = new MemoryStream ();
}
[Test]
- [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
[ExpectedException (typeof (NotSupportedException))]
public void CheckSetLengthProp ()
{
}
[Test]
- [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
[ExpectedException (typeof (NotSupportedException))]
public void CheckGetLengthProp ()
{
}
[Test]
- [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
[ExpectedException (typeof (NotSupportedException))]
public void CheckGetPositionProp ()
{
}
[Test]
- [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
public void DisposeTest ()
{
MemoryStream backing = new MemoryStream (compressed_data);
[Test]
- [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
public void JunkAtTheEnd ()
{
// Write a deflated stream, then some additional data...
}
[Test]
- [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
public void Bug19313 ()
{
byte [] buffer = new byte [512];
}
[Test]
- [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
public void CheckNet45Overloads () // Xambug #21982
{
MemoryStream dataStream = GenerateStreamFromString("Hello");
}
[Test]
- [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
[ExpectedException (typeof (ArgumentException))]
public void CheckBufferOverrun ()
{
}
[Test]
- [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
public void Bug28777_EmptyFlush ()
{
MemoryStream backing = new MemoryStream ();
}
[Test]
- [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
public void Bug28777_DoubleFlush ()
{
byte[] buffer = new byte [4096];
}
[Test]
- [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
public void Bug34916_Inflate ()
{
var base64String = @"H4sIAAAAAAAAA6yVu27bQBBF/4VtZGHeD3ZJmhTp5C5IIUiEIcCWDEUugiD/nmEQwYRNURFAsuFwd2exZ++d+farud89davT+um5aRsC1DuEO+R7lJayRV9m5gegFqBZNB83m5fjevOzadGWUPHjaXd62XYVEy3Z04wiMTKIX0dfV0G/6FO3Pu72D/+iL916W9GbOV/X58SaS6zEKKyoGUA1eNg/nLfF2jUEBBNMtT4Wzeq567Z9HkZkE1Osf93msN/+WO32m+7zsavsh30/BUU8fy+uUCC+QIHpPQW1RAXkEGWUmSnUy2iUYSMYOGpARYViiIHcqY5kExS8rg2vY8gLGEjeYsClBVE4ORQHz3kxsEF4iS01xzBIZkgYQcYQQ7C54LQaIrxWn5+4ioT1BiRQN8Fh6MrOPjOS9Eh3M8YRJJQMZioJkUODFA8RNJ9AYuYBNyGJW5D0oi3/EpZ3dWYk5X5PN81RJGJgDATMQ5X02nFS1imVlMGvu0XwBg5/K1hY1U8tecxcNDy1/FAnG+OAQSi9PliHRaNUiuoxQYFB6T8oyAUKEu9LJ6oipbr1spyZArhWX6qbi7EOUrs7SCAoDNVgzKagMlUz+q6DQ4N8/yM=";
}
[Test]
- [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
public void Bug44994_Inflate()
{
var base64String = @"7cWxCQAgDACwpeBjgqsgXiHU0fd9QzBLErX1EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADepcxcuU/atm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm37zy8=";
}
[Test]
- [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
[Category ("MobileNotWorking")]
public void Bug44994_InflateByteByByte()
{
}
[Test]
- [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
[ExpectedException (typeof (ArgumentNullException))]
public void Constructor_Null ()
{
}
[Test]
- [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
[ExpectedException (typeof (ArgumentException))]
public void Constructor_InvalidCompressionMode ()
{
}
[Test]
- [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
public void CheckCompressDecompress ()
{
byte [] data = new byte[100000];
}
[Test]
- [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
public void CheckDecompress ()
{
byte [] data = {0x1f, 0x8b, 0x08, 0x08, 0x70, 0xbb, 0x5d, 0x41, 0x00, 0x03, 0x74, 0x65, 0x73, 0x74, 0x00, 0xf3, 0x48, 0xcd, 0xc9, 0xc9, 0xe7, 0x02, 0x00, 0x16, 0x35, 0x96, 0x31, 0x06, 0x00, 0x00, 0x00 };
}
[Test]
- [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
[ExpectedException (typeof (ArgumentNullException))]
public void CheckNullRead ()
{
}
[Test]
- [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
[ExpectedException (typeof (InvalidOperationException))]
public void CheckCompressingRead ()
{
}
[Test]
- [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
[ExpectedException (typeof (ArgumentException))]
public void CheckRangeRead ()
{
#if !MOBILE
[Test]
- [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
[Category("NotWorking")]
public void CheckInvalidDataRead ()
{
#endif
[Test]
- [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
public void CheckClosedRead ()
{
byte [] dummy = new byte[20];
}
[Test]
- [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
[ExpectedException (typeof (ObjectDisposedException))]
public void CheckClosedFlush ()
{
}
[Test]
- [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
[ExpectedException (typeof (NotSupportedException))]
public void CheckSeek ()
{
}
[Test]
- [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
[ExpectedException (typeof (NotSupportedException))]
public void CheckSetLength ()
{
}
[Test]
- [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
public void CheckGetCanSeekProp ()
{
MemoryStream backing = new MemoryStream (compressed_data);
}
[Test]
- [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
public void CheckGetCanReadProp ()
{
MemoryStream backing = new MemoryStream (compressed_data);
}
[Test]
- [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
public void CheckGetCanWriteProp ()
{
MemoryStream backing = new MemoryStream (compressed_data);
}
[Test]
- [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
[ExpectedException (typeof (NotSupportedException))]
public void CheckSetLengthProp ()
{
}
[Test]
- [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
[ExpectedException (typeof (NotSupportedException))]
public void CheckGetLengthProp ()
{
}
[Test]
- [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
[ExpectedException (typeof (NotSupportedException))]
public void CheckGetPositionProp ()
{
}
[Test]
- [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
public void DisposeTest ()
{
MemoryStream backing = new MemoryStream (compressed_data);
}
[Test]
- [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
public void DisposeOrderTest ()
{
var fs = new MemoryStream();
}
[Test]
- [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
public void CheckNet45Overloads () // Xambug #21982
{
MemoryStream dataStream = GenerateStreamFromString("Hello");
[Test]
- [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
#if FEATURE_NO_BSD_SOCKETS
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
satellite_assembly1 = es-ES/$(patsubst %.dll,%.resources.dll,$(test_lib))
satellite_assembly2 = nn-NO/$(patsubst %.dll,%.resources.dll,$(test_lib))
-$(test_lib_output): $(TEST_RESOURCES) $(satellite_assembly1) $(satellite_assembly2) $(test_lib_dir)
+$(test_lib): $(TEST_RESOURCES) $(satellite_assembly1) $(satellite_assembly2)
$(satellite_assembly1): Test/resources/culture-es-ES.cs Test/resources/Resources.es-ES.resources
@mkdir -p es-ES
[Test]
[Category ("AndroidNotWorking")] // Accessing assemblies by asm.Location is not supported
- [Category ("StaticLinkedAotNotWorking")] // Can't find .dll files when bundled in .exe
public void GetAssemblyName_CodeBase ()
{
Assembly execAssembly = Assembly.GetExecutingAssembly ();
[Test]
[Category ("AndroidNotWorking")] // Assemblies in Xamarin.Android cannot be accessed as FileStream
- [Category ("StaticLinkedAotNotWorking")] // Can't find .dll files when bundled in .exe
public void GetFiles_False ()
{
Assembly corlib = typeof (int).Assembly;
[Test]
[Category ("AndroidNotWorking")] // Assemblies in Xamarin.Android cannot be accessed as FileStream
- [Category ("StaticLinkedAotNotWorking")] // Can't find .dll files when bundled in .exe
public void GetFiles_True ()
{
Assembly corlib = typeof (int).Assembly;
[Category ("MobileNotWorking")]
public void Bug415628 ()
{
- DirectoryInfo bcl_output_dir = Directory.GetParent (Path.GetDirectoryName (Assembly.GetExecutingAssembly ().Location));
- string namespace_dir = Path.Combine (bcl_output_dir.Parent.FullName, "corlib");
- using (var f = File.Open (Path.Combine (namespace_dir, "Test/resources/415628.bin"), FileMode.Open)) {
+ using (var f = File.Open (Path.Combine (Path.GetDirectoryName (Assembly.GetExecutingAssembly ().Location), "Test/resources/415628.bin"), FileMode.Open)) {
BinaryReader br = new BinaryReader (f);
byte [] buf = br.ReadBytes (8000);
Encoding.UTF8.GetString(buf);
mono-symbolicate \
linker-analyzer
-build_SUBDIRS = resgen gacutil security culevel cil-stringreplacer commoncryptogenerator resx2sr linker cil-strip
+build_SUBDIRS = resgen gacutil security culevel cil-stringreplacer commoncryptogenerator resx2sr linker
net_4_5_SUBDIRS = gacutil
net_4_x_SUBDIRS = gacutil
net_4_5_PARALLEL_SUBDIRS = $(net_4_5_dirs)
static string output = "a.out";
static string object_out = null;
static List<string> link_paths = new List<string> ();
- static List<string> aot_paths = new List<string> ();
- static List<string> aot_names = new List<string> ();
static Dictionary<string,string> libraries = new Dictionary<string,string> ();
static bool autodeps = false;
- static string in_tree = null;
static bool keeptemp = false;
static bool compile_only = false;
static bool static_link = false;
static string fetch_target = null;
static bool custom_mode = true;
static string embedded_options = null;
-
- static string runtime_bin = null;
-
- static string runtime {
- get {
- if (runtime_bin == null && IsUnix)
- runtime_bin = Process.GetCurrentProcess().MainModule.FileName;
- return runtime_bin;
- }
-
- set { runtime_bin = value; }
- }
-
- static bool aot_compile = false;
- static string aot_args = "static";
- static DirectoryInfo aot_temp_dir = null;
- static string aot_mode = "";
- static string aot_runtime = null;
- static string aot_dedup_assembly = null;
- static string cil_strip_path = null;
- static string managed_linker_path = null;
+ static string runtime = null;
static string sdk_path = null;
static string lib_path = null;
static Dictionary<string,string> environment = new Dictionary<string,string>();
case "--bundled-header":
bundled_header = true;
break;
- case "--in-tree":
- if (i+1 == top) {
- Console.WriteLine ("Usage: --in-tree <path/to/headers> ");
- return 1;
- }
- in_tree = args [++i];
- break;
- case "--managed-linker":
- if (i+1 == top) {
- Console.WriteLine ("Usage: --managed-linker <path/to/exe> ");
- return 1;
- }
- managed_linker_path = args [++i];
- break;
- case "--cil-strip":
- if (i+1 == top) {
- Console.WriteLine ("Usage: --cil-strip <path/to/exe> ");
- return 1;
- }
- cil_strip_path = args [++i];
- break;
- case "--aot-runtime":
- if (i+1 == top) {
- Console.WriteLine ("Usage: --aot-runtime <path/to/runtime> ");
- return 1;
- }
- aot_runtime = args [++i];
- aot_compile = true;
- static_link = true;
- break;
- case "--aot-dedup":
- if (i+1 == top) {
- Console.WriteLine ("Usage: --aot-dedup <container_dll> ");
- return 1;
- }
- var rel_path = args [++i];
- var asm = LoadAssembly (rel_path);
- if (asm != null)
- aot_dedup_assembly = new Uri(asm.CodeBase).LocalPath;
-
- sources.Add (rel_path);
- aot_compile = true;
- static_link = true;
- break;
- case "--aot-mode":
- if (i+1 == top) {
- Console.WriteLine ("Need string of aot mode (full, llvmonly). Omit for normal AOT.");
- return 1;
- }
-
- 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;
- }
-
- aot_compile = true;
- static_link = true;
- break;
- case "--aot-args":
- if (i+1 == top) {
- Console.WriteLine ("AOT arguments are passed as a comma-delimited list");
- return 1;
- }
- if (args [i + 1].Contains ("outfile")) {
- Console.WriteLine ("Per-aot-output arguments (ex: outfile, llvm-outfile) cannot be given");
- return 1;
- }
- aot_args = String.Format("static,{0}", args [++i]);
- aot_compile = true;
- static_link = true;
- break;
default:
sources.Add (args [i]);
break;
foreach (string file in assemblies)
if (!QueueAssembly (files, file))
return 1;
-
- PreprocessAssemblies (assemblies, files);
-
- if (aot_compile)
- AotCompile (files);
-
if (custom_mode)
GenerateBundles (files);
else
Console.WriteLine ("At {0:x} with input {1}", package.Position, fileStream.Length);
fileStream.CopyTo (package);
package.Position = package.Position + (align - (package.Position % align));
+
return (int) ret;
}
}
{
var p = package.Position;
var size = AddFile (fname);
+
locations [entry] = Tuple.Create(p, size);
}
static bool GeneratePackage (List<string> files)
{
if (runtime == null){
- Error ("You must specify at least one runtime with --runtime or --cross");
- Environment.Exit (1);
+ if (IsUnix)
+ runtime = Process.GetCurrentProcess().MainModule.FileName;
+ else {
+ Error ("You must specify at least one runtime with --runtime or --cross");
+ Environment.Exit (1);
+ }
}
if (!File.Exists (runtime)){
Error ($"The specified runtime at {runtime} does not exist");
} else {
tc.WriteLine ("#include <mono/metadata/mono-config.h>");
tc.WriteLine ("#include <mono/metadata/assembly.h>\n");
-
- if (in_tree != null)
- tc.WriteLine ("#include <mono/mini/jit.h>\n");
- else
- tc.WriteLine ("#include <mono/jit/jit.h>\n");
}
if (compress) {
}
ts.Close ();
- // Managed assemblies baked in
if (compress)
tc.WriteLine ("\nstatic const CompressedAssembly *compressed [] = {");
else
tc.WriteLine ("\t&{0},", c);
}
tc.WriteLine ("\tNULL\n};\n");
-
-
- // AOT baked in plus loader
- foreach (string asm in aot_names){
- tc.WriteLine ("\textern const void *mono_aot_module_{0}_info;", asm);
- }
-
- tc.WriteLine ("\nstatic void install_aot_modules (void) {\n");
- foreach (string asm in aot_names){
- tc.WriteLine ("\tmono_aot_register_module (mono_aot_module_{0}_info);\n", asm);
- }
-
- string enum_aot_mode;
- switch (aot_mode) {
- case "full":
- enum_aot_mode = "MONO_AOT_MODE_FULL";
- break;
- case "llvmonly":
- enum_aot_mode = "MONO_AOT_MODE_LLVMONLY";
- break;
- case "":
- enum_aot_mode = "MONO_AOT_MODE_NORMAL";
- break;
- default:
- throw new Exception ("Unsupported AOT mode");
- }
- tc.WriteLine ("\tmono_jit_set_aot_mode ({0});", enum_aot_mode);
-
- tc.WriteLine ("\n}\n");
-
-
tc.WriteLine ("static char *image_name = \"{0}\";", prog);
if (ctor_func != null) {
debugging = "-ggdb";
if (static_link)
{
- string platform_libs;
string smonolib;
- if (style == "osx") {
+ if (style == "osx")
smonolib = "`pkg-config --variable=libdir mono-2`/libmono-2.0.a ";
- platform_libs = "-liconv -framework Foundation ";
- } else {
+ else
smonolib = "-Wl,-Bstatic -lmono-2.0 -Wl,-Bdynamic ";
- platform_libs = "";
- }
-
- string in_tree_include = "";
-
- if (in_tree != null) {
- smonolib = String.Format ("{0}/mono/mini/.libs/libmonosgen-2.0.a", in_tree);
- in_tree_include = String.Format (" -I{0} ", in_tree);
- }
-
- cmd = String.Format("{4} -o '{2}' -Wall `pkg-config --cflags mono-2` {7} {0} {3} " +
- "`pkg-config --libs-only-L mono-2` {5} {6} " + platform_libs +
- "`pkg-config --libs-only-l mono-2 | sed -e \"s/\\-lmono-2.0 //\"` {1} -g ",
- temp_c, temp_o, output, zlib, cc, smonolib, String.Join (" ", aot_paths), in_tree_include);
+ cmd = String.Format("{4} -o '{2}' -Wall `pkg-config --cflags mono-2` {0} {3} " +
+ "`pkg-config --libs-only-L mono-2` " + smonolib +
+ "`pkg-config --libs-only-l mono-2 | sed -e \"s/\\-lmono-2.0 //\"` {1}",
+ temp_c, temp_o, output, zlib, cc);
}
else
{
if (!compile_only){
File.Delete (temp_c);
}
- if (aot_temp_dir != null)
- aot_temp_dir.Delete (true);
File.Delete (temp_s);
}
}
}
}
-
- static string EncodeAotSymbol (string symbol)
- {
- var sb = new StringBuilder ();
- /* This mimics what the aot-compiler does */
- foreach (var b in System.Text.Encoding.UTF8.GetBytes (symbol)) {
- char c = (char) b;
- if ((c >= '0' && c <= '9') ||
- (c >= 'a' && c <= 'z') ||
- (c >= 'A' && c <= 'Z')) {
- sb.Append (c);
- continue;
- }
- sb.Append ('_');
- }
- return sb.ToString ();
- }
-
- static void AotCompile (List<string> files)
- {
- if (aot_runtime == null)
- aot_runtime = runtime;
-
- if (aot_runtime == null) {
- 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;
-
- var dedup_mode_string = "";
- StringBuilder all_assemblies = null;
- if (aot_dedup_assembly != null) {
- dedup_mode_string = ",dedup-skip";
- all_assemblies = new StringBuilder("");
- }
-
- Console.WriteLine ("Aoting files:");
-
- for (int i=0; i < files.Count; i++) {
- var file_name = files [i];
- string path = LocateFile (new Uri (file_name).LocalPath);
- string outPath = String.Format ("{0}.aot_out", path);
- aot_paths.Add (outPath);
- var name = System.Reflection.Assembly.LoadFrom(path).GetName().Name;
- aot_names.Add (EncodeAotSymbol (name));
-
- if (aot_dedup_assembly != null) {
- all_assemblies.Append (path);
- all_assemblies.Append (" ");
- Execute (String.Format ("MONO_PATH={0} {1} --aot={2},outfile={3}{4}{5} {6}",
- Path.GetDirectoryName (path), aot_runtime, aot_args, outPath, aot_mode_string, dedup_mode_string, path));
- } else {
- Execute (String.Format ("MONO_PATH={0} {1} --aot={2},outfile={3}{4} {5}",
- Path.GetDirectoryName (path), aot_runtime, aot_args, outPath, aot_mode_string, path));
- }
- }
- if (aot_dedup_assembly != null) {
- var filePath = new Uri (aot_dedup_assembly).LocalPath;
- string path = LocateFile (filePath);
- dedup_mode_string = String.Format (",dedup-include={0}", Path.GetFileName(filePath));
- string outPath = String.Format ("{0}.aot_out", path);
- Execute (String.Format ("MONO_PATH={7} {0} --aot={1},outfile={2}{3}{4} {5} {6}",
- aot_runtime, aot_args, outPath, aot_mode_string, dedup_mode_string, path, all_assemblies.ToString (), Path.GetDirectoryName (path)));
- }
-
- if ((aot_mode == "full" || aot_mode == "llvmonly") && cil_strip_path != null) {
- for (int i=0; i < files.Count; i++) {
- var in_name = new Uri (files [i]).LocalPath;
- var cmd = String.Format ("{0} {1} {2}", aot_runtime, cil_strip_path, in_name);
- Execute (cmd);
- }
- }
- }
-
- static void LinkManaged (List <string> files, string outDir)
- {
- if (managed_linker_path == null)
- return;
-
- var paths = new StringBuilder ("");
- foreach (var file in files) {
- paths.Append (" -a ");
- paths.Append (new Uri (file).LocalPath);
- }
-
- var cmd = String.Format ("{0} {1} -b true -out {2} {3} -c link -p copy ", runtime, managed_linker_path, outDir, paths.ToString ());
- Execute (cmd);
- }
-
- static void PreprocessAssemblies (List <string> chosenFiles, List <string> files)
- {
- if (aot_mode == "" || (cil_strip_path == null && managed_linker_path == null))
- return;
-
- var temp_dir_name = Path.Combine(Directory.GetCurrentDirectory(), "temp_assemblies");
- aot_temp_dir = new DirectoryInfo (temp_dir_name);
- if (aot_temp_dir.Exists) {
- Console.WriteLine ("Removing previous build cache at {0}", temp_dir_name);
- aot_temp_dir.Delete (true);
- }
- aot_temp_dir.Create ();
-
- //if (managed_linker_path != null) {
- //LinkManaged (chosenFiles, temp_dir);
-
- //// Replace list with new list of files
- //files.Clear ();
- //Console.WriteLine ("Iterating {0}", temp_dir);
- //aot_temp_dir = new DirectoryInfo (temp_dir);
- //foreach (var file in aot_temp_dir.GetFiles ()) {
- //files.Append (String.Format ("file:///{0}", file));
- //Console.WriteLine (String.Format ("file:///{0}", file));
- //}
- //return;
- //}
-
- // Fix file references
- for (int i=0; i < files.Count; i++) {
- var in_name = new Uri (files [i]).LocalPath;
- var out_name = Path.Combine (temp_dir_name, Path.GetFileName (in_name));
- File.Copy (in_name, out_name);
- files [i] = out_name;
- if (in_name == aot_dedup_assembly)
- aot_dedup_assembly = out_name;
- }
- }
-
-
static void Execute (string cmdLine)
{
if (IsUnix) {
{
install_dll_config_files ();
mono_register_bundled_assemblies(bundled);
-
- install_aot_modules ();
}
#!/bin/bash -e
-if test -n "${MONO_STATIC_AOT}";
-then
-${TESTCMD} --label=mkbundle --timeout=25m make -j 4 -w -C mcs/class/corlib -k mkbundle-all-tests
-fi
-
if test -n "${MONO_LLVMONLY}";
then
${TESTCMD} --label=mini --timeout=25m make -j 4 -w -C mono/mini -k llvmonlycheck