Merge remote-tracking branch 'origin/master' into mono-2018-10
This commit is contained in:
Коммит
c6653167b9
|
@ -43,5 +43,5 @@
|
|||
# line changed in git).
|
||||
#
|
||||
|
||||
IOS_PACKAGE_VERSION=12.6.0.$(IOS_COMMIT_DISTANCE)
|
||||
MAC_PACKAGE_VERSION=5.6.0.$(MAC_COMMIT_DISTANCE)
|
||||
IOS_PACKAGE_VERSION=12.7.0.$(IOS_COMMIT_DISTANCE)
|
||||
MAC_PACKAGE_VERSION=5.7.0.$(MAC_COMMIT_DISTANCE)
|
||||
|
|
2
Makefile
2
Makefile
|
@ -108,7 +108,7 @@ $(MAC_DESTDIR)/$(MAC_FRAMEWORK_CURRENT_DIR)/Version: Make.config.inc
|
|||
|
||||
$(MAC_DESTDIR)/$(MAC_FRAMEWORK_CURRENT_DIR)/Versions.plist: Versions-mac.plist.in Makefile $(TOP)/Make.config versions-check.csharp
|
||||
$(Q) ./versions-check.csharp $< "$(MIN_IOS_SDK_VERSION)" "$(IOS_SDK_VERSION)" "$(MIN_TVOS_SDK_VERSION)" "$(TVOS_SDK_VERSION)" "$(MIN_WATCH_OS_VERSION)" "$(WATCH_SDK_VERSION)" "$(MIN_OSX_SDK_VERSION)" "$(OSX_SDK_VERSION)"
|
||||
$(Q_GEN) sed -e 's/@XCODE_VERSION@/$(XCODE_VERSION)/g' -e "s/@MONO_VERSION@/$(MONO_VERSION)/g" $< > $@
|
||||
$(Q_GEN) sed -e 's/@XCODE_VERSION@/$(XCODE_VERSION)/g' -e "s/@MONO_VERSION@/$(MONO_VERSION)/g" -e "s/@MIN_XM_MONO_VERSION@/$(MIN_XM_MONO_VERSION)/g" $< > $@
|
||||
|
||||
ifdef INCLUDE_MAC
|
||||
TARGETS += $(MAC_TARGETS)
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
<dict>
|
||||
<key>MonoVersion</key>
|
||||
<string>@MONO_VERSION@</string>
|
||||
<key>MinimumSystemMono</key>
|
||||
<string>@MIN_XM_MONO_VERSION@</string>
|
||||
<key>KnownVersions</key>
|
||||
<dict>
|
||||
<key>macOS</key>
|
||||
|
|
|
@ -1473,7 +1473,7 @@ managed exceptions.
|
|||
|
||||
Currently only a few `objc_msgSend` signatures are supported (you will find out
|
||||
if a signature isn't supported when native linking of an app that uses the
|
||||
binding fails with a missing monotouch_*_objc_msgSend* symbol), but more can be
|
||||
binding fails with a missing xamarin_*_objc_msgSend* symbol), but more can be
|
||||
added at request.
|
||||
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 49a17b1cbb85a23cbcf46c3fdfa57d4f82afa158
|
||||
Subproject commit 2029b1703e3a9a976b8368a26cdedc284516d9b7
|
|
@ -1 +1 @@
|
|||
Subproject commit 4ad781f981ebc1f34f09b7877bcb52009e4dbea2
|
||||
Subproject commit eb0779c34abf46b9af940323484c6a49f2e3581e
|
|
@ -545,13 +545,16 @@ timestamps {
|
|||
stage ('Publish builds to GitHub') {
|
||||
currentStage = "${STAGE_NAME}"
|
||||
utils = load ("${workspace}/xamarin-macios/jenkins/utils.groovy")
|
||||
def packagesMessage = ""
|
||||
if (xiPackageFilename != null) {
|
||||
xiPackageUrl = "${packagePrefix}/${xiPackageFilename}"
|
||||
utils.reportGitHubStatus (gitHash, 'PKG-Xamarin.iOS', "${xiPackageUrl}", 'SUCCESS', "${xiPackageFilename}")
|
||||
packagesMessage += "[${xiPackageFilename}](${xiPackageUrl}) "
|
||||
}
|
||||
if (xmPackageFilename != null) {
|
||||
xmPackageUrl = "${packagePrefix}/${xmPackageFilename}"
|
||||
utils.reportGitHubStatus (gitHash, 'PKG-Xamarin.Mac', "${xmPackageUrl}", 'SUCCESS', "${xmPackageFilename}")
|
||||
packagesMessage += "[${xmPackageFilename}](${xmPackageUrl})"
|
||||
}
|
||||
if (manifestFilename != null) {
|
||||
def manifestUrl = "${packagePrefix}/${manifestFilename}"
|
||||
|
@ -569,6 +572,9 @@ timestamps {
|
|||
def msbuildZipUrl = "${packagePrefix}/${msbuildZipFilename}"
|
||||
utils.reportGitHubStatus (gitHash, "msbuild.zip", "${msbuildZipUrl}", 'SUCCESS', "${msbuildZipFilename}")
|
||||
}
|
||||
|
||||
if (packagesMessage != "")
|
||||
appendFileComment ("✅ Packages: ${packagesMessage}\n")
|
||||
}
|
||||
|
||||
dir ('xamarin-macios') {
|
||||
|
@ -697,9 +703,7 @@ timestamps {
|
|||
}
|
||||
} catch (err) {
|
||||
currentStage = "Running XM tests on '10.${macOS}'"
|
||||
def msg = err.getMessage ();
|
||||
if (msg == "")
|
||||
msg = "Xamarin.Mac tests on 10.${macOS} failed"
|
||||
def msg = "Xamarin.Mac tests on 10.${macOS} failed: " + err.getMessage ();
|
||||
appendFileComment ("🔥 [${msg}](${env.RUN_DISPLAY_URL}) 🔥\n")
|
||||
failedStages.add (currentStage)
|
||||
throw err
|
||||
|
|
|
@ -38,8 +38,10 @@ else
|
|||
sed 's/^/ /' .tmp-files || true
|
||||
if grep 'external/mono' .tmp-files > /dev/null; then
|
||||
echo "Enabling device build because mono was bumped."
|
||||
ENABLE_DEVICE_BUILD=1
|
||||
elif grep 'external/llvm' .tmp-files > /dev/null; then
|
||||
echo "Enabling device build because llvm was bumped."
|
||||
ENABLE_DEVICE_BUILD=1
|
||||
else
|
||||
echo "Not enabling device build; neither mono nor llvm was bumped."
|
||||
fi
|
||||
|
@ -64,6 +66,7 @@ make reset
|
|||
make git-clean-all
|
||||
make print-versions
|
||||
|
||||
echo "Configuring the build with: $CONFIGURE_FLAGS"
|
||||
# shellcheck disable=SC2086
|
||||
./configure $CONFIGURE_FLAGS
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ MSBUILD_DIRECTORIES =
|
|||
MSBUILD_SYMLINKS =
|
||||
MSBUILD_TASK_ASSEMBLIES =
|
||||
|
||||
ALL_SOURCES:= $(shell git ls-files | sed 's/ /\\ /g')
|
||||
ALL_SOURCES:= $(shell git ls-files | sed 's/ /\\ /g') $(wildcard $(XAMARIN_MACDEV_PATH)/Xamarin.MacDev/*.cs) $(wildcard $(XAMARIN_MACDEV_PATH)/Xamarin.MacDev/*.csproj)
|
||||
CONFIG = Debug
|
||||
|
||||
##
|
||||
|
|
|
@ -10,6 +10,8 @@ namespace Xamarin.MacDev.Tasks
|
|||
{
|
||||
public abstract class UnpackLibraryResourcesTaskBase : Task
|
||||
{
|
||||
List<ITaskItem> unpackedResources = new List<ITaskItem> ();
|
||||
|
||||
#region Inputs
|
||||
|
||||
public string SessionId { get; set; }
|
||||
|
@ -36,6 +38,9 @@ namespace Xamarin.MacDev.Tasks
|
|||
[Output]
|
||||
public ITaskItem[] BundleResourcesWithLogicalNames { get; set; }
|
||||
|
||||
[Output]
|
||||
public ITaskItem[] UnpackedResources { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
public override bool Execute ()
|
||||
|
@ -78,6 +83,7 @@ namespace Xamarin.MacDev.Tasks
|
|||
}
|
||||
|
||||
BundleResourcesWithLogicalNames = results.ToArray ();
|
||||
UnpackedResources = unpackedResources.ToArray ();
|
||||
|
||||
return !Log.HasLoggedErrors;
|
||||
}
|
||||
|
@ -117,6 +123,10 @@ namespace Xamarin.MacDev.Tasks
|
|||
var path = Path.Combine (intermediatePath, rpath);
|
||||
var file = new FileInfo (path);
|
||||
|
||||
var item = new TaskItem (path);
|
||||
item.SetMetadata ("LogicalName", rpath);
|
||||
item.SetMetadata ("Optimize", "false");
|
||||
|
||||
if (file.Exists && file.LastWriteTimeUtc >= asmWriteTime) {
|
||||
Log.LogMessage (" Up to date: {0}", rpath);
|
||||
} else {
|
||||
|
@ -128,11 +138,9 @@ namespace Xamarin.MacDev.Tasks
|
|||
using (var resource = embedded.Open ())
|
||||
resource.CopyTo (stream);
|
||||
}
|
||||
}
|
||||
|
||||
var item = new TaskItem (path);
|
||||
item.SetMetadata ("LogicalName", rpath);
|
||||
item.SetMetadata ("Optimize", "false");
|
||||
unpackedResources.Add (item);
|
||||
}
|
||||
|
||||
yield return item;
|
||||
}
|
||||
|
|
|
@ -180,6 +180,9 @@ namespace Xamarin.iOS.Tasks
|
|||
[Output]
|
||||
public ITaskItem NativeExecutable { get; set; }
|
||||
|
||||
[Output]
|
||||
public ITaskItem[] CopiedFrameworks { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
public PlatformFramework Framework {
|
||||
|
@ -681,7 +684,28 @@ namespace Xamarin.iOS.Tasks
|
|||
|
||||
Directory.CreateDirectory (AppBundleDir);
|
||||
|
||||
return base.Execute ();
|
||||
var result = base.Execute ();
|
||||
|
||||
CopiedFrameworks = GetCopiedFrameworks ();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
ITaskItem[] GetCopiedFrameworks ()
|
||||
{
|
||||
var copiedFrameworks = new List<ITaskItem> ();
|
||||
var frameworksDir = Path.Combine (AppBundleDir, "Frameworks");
|
||||
|
||||
if (Directory.Exists (frameworksDir)) {
|
||||
foreach (var dir in Directory.EnumerateDirectories (frameworksDir, "*.framework")) {
|
||||
var framework = Path.Combine (dir, Path.GetFileNameWithoutExtension (dir));
|
||||
|
||||
if (File.Exists (framework))
|
||||
copiedFrameworks.Add (new TaskItem (framework));
|
||||
}
|
||||
}
|
||||
|
||||
return copiedFrameworks.ToArray ();
|
||||
}
|
||||
|
||||
string ResolveFrameworkFile (string fullName)
|
||||
|
|
|
@ -46,10 +46,12 @@
|
|||
<Kind>Framework</Kind>
|
||||
<Link>XStaticObjectTest.framework</Link>
|
||||
<LinkerFlags>-lz</LinkerFlags>
|
||||
<Frameworks>Foundation ModelIO</Frameworks>
|
||||
</NativeReference>
|
||||
<NativeReference Include="..\..\..\tests\test-libraries\.libs\ios\XStaticArTest.framework">
|
||||
<Kind>Framework</Kind>
|
||||
<Link>XStaticArTest.framework</Link>
|
||||
<Frameworks>Foundation ModelIO</Frameworks>
|
||||
</NativeReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
|
|
@ -76,7 +76,7 @@ namespace Xamarin.iOS.Tasks
|
|||
appexDsymTimestamps = Directory.EnumerateFiles (appexDsymDir, "*.*", SearchOption.AllDirectories).ToDictionary (file => file, file => GetLastModified (file));
|
||||
}
|
||||
|
||||
Thread.Sleep (1000);
|
||||
EnsureFilestampChange ();
|
||||
|
||||
// Rebuild w/ no changes
|
||||
BuildProject ("MyTabbedApplication", Platform, config, clean: false);
|
||||
|
@ -130,7 +130,7 @@ namespace Xamarin.iOS.Tasks
|
|||
|
||||
AssertProperlyCodesigned (expectedCodesignResults);
|
||||
|
||||
Thread.Sleep (1000);
|
||||
EnsureFilestampChange ();
|
||||
|
||||
// replace "bool imageFound = false;" with "bool imageFound = true;" so that we force the appex to get rebuilt
|
||||
text = text.Replace ("bool imageFound = false;", "bool imageFound = true;");
|
||||
|
@ -160,7 +160,7 @@ namespace Xamarin.iOS.Tasks
|
|||
|
||||
AssertProperlyCodesigned (expectedCodesignResults);
|
||||
|
||||
Thread.Sleep (1000);
|
||||
EnsureFilestampChange ();
|
||||
|
||||
// Rebuild w/ no changes
|
||||
BuildProject ("MyWatch2Container", Platform, config, clean: false);
|
||||
|
@ -183,7 +183,7 @@ namespace Xamarin.iOS.Tasks
|
|||
|
||||
AssertProperlyCodesigned (expectedCodesignResults);
|
||||
|
||||
Thread.Sleep (1000);
|
||||
EnsureFilestampChange ();
|
||||
|
||||
// replace "bool imageFound = false;" with "bool imageFound = true;" so that we force the appex to get rebuilt
|
||||
text = text.Replace ("{0} awake with context", "{0} The Awakening...");
|
||||
|
|
|
@ -38,7 +38,7 @@ namespace Xamarin.iOS.Tasks
|
|||
|
||||
AssertCompiledModelExists ("SqueezeNet");
|
||||
|
||||
Thread.Sleep (1000);
|
||||
EnsureFilestampChange ();
|
||||
|
||||
// Rebuild w/ no changes
|
||||
BuildProject ("MyCoreMLApp", Platform, "Debug", clean: false);
|
||||
|
|
|
@ -98,13 +98,13 @@ namespace Xamarin.iOS.Tasks
|
|||
// Touching the binding project should
|
||||
Touch (bindingLib.ProjectCSProjPath);
|
||||
BuildProjectNoEmbedding (bindingLib, clean: false);
|
||||
Assert.True (GetMessages ().Contains (CreatePackageString), "Bindng project build did not create package?");
|
||||
Assert.True (GetMessages ().Contains (CreatePackageString), "Binding project build did not create package?");
|
||||
ClearMessages ();
|
||||
|
||||
// Touching the binding file should
|
||||
Touch (Path.Combine (Path.GetDirectoryName (bindingLib.ProjectCSProjPath), @"../../../tests/bindings-framework-test/ApiDefinition.cs"));
|
||||
BuildProjectNoEmbedding (bindingLib, clean: false);
|
||||
Assert.True (GetMessages ().Contains (CreatePackageString), "Bindng file build did not create package?");
|
||||
Assert.True (GetMessages ().Contains (CreatePackageString), "Binding file build did not create package?");
|
||||
ClearMessages ();
|
||||
|
||||
// No change build should not
|
||||
|
@ -115,7 +115,7 @@ namespace Xamarin.iOS.Tasks
|
|||
// Touching native library should
|
||||
Touch (Path.Combine (Path.GetDirectoryName (bindingLib.ProjectCSProjPath), @"../../../tests/test-libraries/.libs/ios/XTest.framework/XTest"));
|
||||
BuildProjectNoEmbedding (bindingLib, clean: false);
|
||||
Assert.True (GetMessages ().Contains (CreatePackageString), "Bindng build did not create package?");
|
||||
Assert.True (GetMessages ().Contains (CreatePackageString), "Binding build did not create package?");
|
||||
}
|
||||
|
||||
[TestCase (true)]
|
||||
|
|
|
@ -33,7 +33,7 @@ namespace Xamarin.iOS.Tasks
|
|||
var timestamps = Directory.EnumerateFiles (AppBundlePath, "*.*", SearchOption.AllDirectories).ToDictionary (file => file, file => GetLastModified (file));
|
||||
var dsymTimestamps = Directory.EnumerateFiles (dsymDir, "*.*", SearchOption.AllDirectories).ToDictionary (file => file, file => GetLastModified (file));
|
||||
|
||||
Thread.Sleep (1000);
|
||||
EnsureFilestampChange ();
|
||||
|
||||
// Rebuild w/ no changes
|
||||
BuildProject ("MyReleaseBuild", Platform, "Release", clean: false);
|
||||
|
@ -47,7 +47,7 @@ namespace Xamarin.iOS.Tasks
|
|||
foreach (var file in dsymTimestamps.Keys)
|
||||
Assert.AreEqual (dsymTimestamps[file], newDSymTimestamps[file], "#2: " + file);
|
||||
|
||||
Thread.Sleep (1000);
|
||||
EnsureFilestampChange ();
|
||||
|
||||
// Rebuild after changing MtouchUseLlvm
|
||||
File.Copy (csproj, bak, true);
|
||||
|
|
|
@ -270,11 +270,11 @@ namespace Xamarin.iOS.Tasks
|
|||
// all the input files into the temporary directory. This means that any timestamps modified as
|
||||
// part of the original build will definitely be newer than the timestamps written during the
|
||||
// execution of the test fixture 'setup' method.
|
||||
Thread.Sleep (1000);
|
||||
EnsureFilestampChange ();
|
||||
RunTarget (MonoTouchProject, TargetName.Build);
|
||||
var timestamps = Directory.EnumerateFiles (AppBundlePath, "*.*", SearchOption.AllDirectories).ToDictionary (file => file, file => GetLastModified (file));
|
||||
|
||||
Thread.Sleep (1000);
|
||||
EnsureFilestampChange ();
|
||||
RunTarget (MonoTouchProject, TargetName.Build);
|
||||
var newTimestamps = Directory.EnumerateFiles (AppBundlePath, "*.*", SearchOption.AllDirectories).ToDictionary (file => file, file => GetLastModified (file));
|
||||
|
||||
|
@ -304,7 +304,7 @@ namespace Xamarin.iOS.Tasks
|
|||
RunTarget (LibraryProject, TargetName.Build);
|
||||
var timestamp = GetLastModified (libraryPath);
|
||||
|
||||
Thread.Sleep (1000);
|
||||
EnsureFilestampChange ();
|
||||
RunTarget (LibraryProject, TargetName.Build);
|
||||
Assert.AreEqual (timestamp, GetLastModified (libraryPath));
|
||||
}
|
||||
|
@ -496,7 +496,7 @@ namespace Xamarin.iOS.Tasks
|
|||
projectInstance = project.CreateProjectInstance ();
|
||||
|
||||
// Put a thread.sleep so that we get noticeable timestamps.
|
||||
Thread.Sleep (1000);
|
||||
EnsureFilestampChange ();
|
||||
|
||||
// Re-save the original plist (adding app icon).
|
||||
plistCopy.Save (path, true);
|
||||
|
|
|
@ -4,6 +4,7 @@ using System.Collections.Generic;
|
|||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using Microsoft.Build.Evaluation;
|
||||
using Microsoft.Build.Execution;
|
||||
using Microsoft.Build.Utilities;
|
||||
|
@ -331,7 +332,29 @@ namespace Xamarin.iOS.Tasks
|
|||
{
|
||||
if (!File.Exists (file))
|
||||
Assert.Fail ("Expected file '{0}' did not exist", file);
|
||||
EnsureFilestampChange ();
|
||||
File.SetLastWriteTimeUtc (file, DateTime.UtcNow);
|
||||
EnsureFilestampChange ();
|
||||
}
|
||||
|
||||
static bool? is_apfs;
|
||||
public static bool IsAPFS {
|
||||
get {
|
||||
if (!is_apfs.HasValue) {
|
||||
var exit_code = ExecutionHelper.Execute ("/bin/df", "-t apfs /", out var output, TimeSpan.FromSeconds (10));
|
||||
if (exit_code != 0)
|
||||
throw new Exception ($"Could not determine whether / is APFS or not. 'df -t apfs /' returned {exit_code} and said: {output}");
|
||||
is_apfs = output.Trim ().Split ('\n').Length >= 2;
|
||||
}
|
||||
return is_apfs.Value;
|
||||
}
|
||||
}
|
||||
|
||||
public static void EnsureFilestampChange ()
|
||||
{
|
||||
if (IsAPFS)
|
||||
return;
|
||||
Thread.Sleep (1000);
|
||||
}
|
||||
|
||||
public void RunTarget (Project project, string target, int expectedErrorCount = 0)
|
||||
|
|
|
@ -1104,12 +1104,11 @@ print_exception (MonoObject *exc, bool is_inner, NSMutableString *msg)
|
|||
char *trace = fetch_exception_property_string (exc, "get_StackTrace", true);
|
||||
char *message = fetch_exception_property_string (exc, "get_Message", true);
|
||||
|
||||
if (!is_inner) {
|
||||
[msg appendString:@"Unhandled managed exception:\n"];
|
||||
} else {
|
||||
if (is_inner)
|
||||
[msg appendString:@" --- inner exception ---\n"];
|
||||
}
|
||||
[msg appendFormat: @"%s (%s)\n%s\n", message, type_name, trace];
|
||||
[msg appendFormat: @"%s (%s)\n", message, type_name];
|
||||
if (trace)
|
||||
[msg appendFormat: @"%s\n", trace];
|
||||
|
||||
if (unhandled_exception_func && !is_inner)
|
||||
unhandled_exception_func (exc, type_name, message, trace);
|
||||
|
@ -1170,7 +1169,7 @@ xamarin_process_managed_exception_gchandle (guint32 gchandle)
|
|||
void
|
||||
xamarin_unhandled_exception_handler (MonoObject *exc, gpointer user_data)
|
||||
{
|
||||
PRINT ("%@", print_all_exceptions (exc));
|
||||
PRINT ("Unhandled managed exception: %@", print_all_exceptions (exc));
|
||||
|
||||
abort ();
|
||||
}
|
||||
|
@ -2392,7 +2391,7 @@ xamarin_process_managed_exception (MonoObject *exception)
|
|||
mono_gchandle_free (handle);
|
||||
|
||||
if (exception_gchandle != 0) {
|
||||
PRINT (PRODUCT ": Got an exception while executing the MarshalManagedCException event (this exception will be ignored):");
|
||||
PRINT (PRODUCT ": Got an exception while executing the MarshalManagedException event (this exception will be ignored):");
|
||||
PRINT ("%@", print_all_exceptions (mono_gchandle_get_target (exception_gchandle)));
|
||||
mono_gchandle_free (exception_gchandle);
|
||||
exception_gchandle = 0;
|
||||
|
@ -2484,7 +2483,7 @@ xamarin_process_managed_exception (MonoObject *exception)
|
|||
}
|
||||
case MarshalManagedExceptionModeAbort:
|
||||
default:
|
||||
xamarin_assertion_message ("Aborting due to:\n%s\n", [print_all_exceptions (exception) UTF8String]);
|
||||
xamarin_assertion_message ("Aborting due to trying to marshal managed exception:\n%s\n", [print_all_exceptions (exception) UTF8String]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ namespace AppKit {
|
|||
public static void Init ()
|
||||
{
|
||||
if (initialized) {
|
||||
throw new InvalidOperationException ("Init has already be be invoked; it can only be invoke once");
|
||||
throw new InvalidOperationException ("Init has already been invoked; it can only be invoked once");
|
||||
}
|
||||
|
||||
Runtime.EnsureInitialized ();
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using Foundation;
|
||||
using ObjCRuntime;
|
||||
|
||||
namespace AppKit
|
||||
{
|
||||
public partial class NSOpenPanel
|
||||
{
|
||||
[Export ("openPanel")]
|
||||
public static NSOpenPanel OpenPanel {
|
||||
get {
|
||||
// [NSOpenPanel openPanel] will always create a new instance, so there's no need to check if there already is
|
||||
// a managed object with the same pointer.
|
||||
IntPtr ptr = Messaging.IntPtr_objc_msgSend (Class.GetHandle ("NSOpenPanel"), Selector.GetHandle ("openPanel"));
|
||||
return new NSOpenPanel (ptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using Foundation;
|
||||
using ObjCRuntime;
|
||||
|
||||
namespace AppKit
|
||||
{
|
||||
public partial class NSSavePanel
|
||||
{
|
||||
[Export ("savePanel")]
|
||||
public static NSSavePanel SavePanel {
|
||||
get {
|
||||
// [NSSavePanel savePanel] will always create a new instance, so there's no need to check if there already is
|
||||
// a managed object with the same pointer.
|
||||
IntPtr ptr = Messaging.IntPtr_objc_msgSend (Class.GetHandle ("NSSavePanel"), Selector.GetHandle ("savePanel"));
|
||||
return new NSSavePanel (ptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -33,6 +33,7 @@ namespace MonoMac {
|
|||
public const string Version = "@VERSION@";
|
||||
internal const string Revision = "@REVISION@";
|
||||
public const string SdkVersion = "@OSX_SDK_VERSION@";
|
||||
internal const string MinMonoVersion = "@MIN_XM_MONO_VERSION@";
|
||||
|
||||
public const string AddressBookLibrary = "/System/Library/Frameworks/AddressBook.framework/AddressBook";
|
||||
public const string AppKitLibrary = "/System/Library/Frameworks/AppKit.framework/AppKit";
|
||||
|
|
|
@ -37,9 +37,9 @@ namespace CoreText {
|
|||
|
||||
#region Run Delegate Callbacks
|
||||
delegate void CTRunDelegateDeallocateCallback (IntPtr refCon);
|
||||
delegate float CTRunDelegateGetAscentCallback (IntPtr refCon);
|
||||
delegate float CTRunDelegateGetDescentCallback (IntPtr refCon);
|
||||
delegate float CTRunDelegateGetWidthCallback (IntPtr refCon);
|
||||
delegate nfloat CTRunDelegateGetAscentCallback (IntPtr refCon);
|
||||
delegate nfloat CTRunDelegateGetDescentCallback (IntPtr refCon);
|
||||
delegate nfloat CTRunDelegateGetWidthCallback (IntPtr refCon);
|
||||
|
||||
[StructLayout (LayoutKind.Sequential)]
|
||||
class CTRunDelegateCallbacks {
|
||||
|
@ -88,6 +88,22 @@ namespace CoreText {
|
|||
}
|
||||
#endif
|
||||
|
||||
#if XAMCORE_4_0
|
||||
public virtual nfloat GetAscent ()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public virtual nfloat GetDescent ()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public virtual nfloat GetWidth ()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
public virtual float GetAscent ()
|
||||
{
|
||||
return 0.0f;
|
||||
|
@ -102,6 +118,7 @@ namespace CoreText {
|
|||
{
|
||||
return 0.0f;
|
||||
}
|
||||
#endif
|
||||
|
||||
internal CTRunDelegateCallbacks GetCallbacks ()
|
||||
{
|
||||
|
@ -151,30 +168,30 @@ namespace CoreText {
|
|||
}
|
||||
|
||||
[MonoPInvokeCallback (typeof (CTRunDelegateGetAscentCallback))]
|
||||
static float GetAscent (IntPtr refCon)
|
||||
static nfloat GetAscent (IntPtr refCon)
|
||||
{
|
||||
var self = GetOperations (refCon);
|
||||
if (self == null)
|
||||
return 0.0f;
|
||||
return self.GetAscent ();
|
||||
return 0;
|
||||
return (nfloat) self.GetAscent ();
|
||||
}
|
||||
|
||||
[MonoPInvokeCallback (typeof (CTRunDelegateGetDescentCallback))]
|
||||
static float GetDescent (IntPtr refCon)
|
||||
static nfloat GetDescent (IntPtr refCon)
|
||||
{
|
||||
var self = GetOperations (refCon);
|
||||
if (self == null)
|
||||
return 0.0f;
|
||||
return self.GetDescent ();
|
||||
return 0;
|
||||
return (nfloat) self.GetDescent ();
|
||||
}
|
||||
|
||||
[MonoPInvokeCallback (typeof (CTRunDelegateGetWidthCallback))]
|
||||
static float GetWidth (IntPtr refCon)
|
||||
static nfloat GetWidth (IntPtr refCon)
|
||||
{
|
||||
var self = GetOperations (refCon);
|
||||
if (self == null)
|
||||
return 0.0f;
|
||||
return self.GetWidth ();
|
||||
return 0;
|
||||
return (nfloat) self.GetWidth ();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -121,7 +121,18 @@ namespace Foundation {
|
|||
readonly Dictionary<NSUrlSessionTask, InflightData> inflightRequests;
|
||||
readonly object inflightRequestsLock = new object ();
|
||||
|
||||
public NSUrlSessionHandler () : this (NSUrlSessionConfiguration.DefaultSessionConfiguration)
|
||||
static NSUrlSessionConfiguration CreateConfig ()
|
||||
{
|
||||
// modifying the configuration does not affect future calls
|
||||
var config = NSUrlSessionConfiguration.DefaultSessionConfiguration;
|
||||
// but we want, by default, the timeout from HttpClient to have precedence over the one from NSUrlSession
|
||||
// Double.MaxValue does not work, so default to 24 hours
|
||||
config.TimeoutIntervalForRequest = 24 * 60 * 60;
|
||||
config.TimeoutIntervalForResource = 24 * 60 * 60;
|
||||
return config;
|
||||
}
|
||||
|
||||
public NSUrlSessionHandler () : this (CreateConfig ())
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -413,6 +413,7 @@ $(MAC_BUILD_DIR)/Constants.cs: Constants.mac.cs.in Makefile $(TOP)/Make.config.i
|
|||
-e "s/@VERSION@/$(MAC_PACKAGE_VERSION_MAJOR).$(MAC_PACKAGE_VERSION_MINOR).$(MAC_PACKAGE_VERSION_REV)/g" \
|
||||
-e 's/@REVISION@/$(MAC_COMMIT_DISTANCE) ($(CURRENT_BRANCH_SED_ESCAPED): $(shell git log -1 --pretty=%h))/g' \
|
||||
-e "s/@OSX_SDK_VERSION@/$(OSX_SDK_VERSION)/g" \
|
||||
-e "s/@MIN_XM_MONO_VERSION@/$(MIN_XM_MONO_VERSION)/g" \
|
||||
$< > $@
|
||||
|
||||
$(PROJECT_DIR)/xammac.csproj: xammac.tmpl.csproj Makefile $(wildcard $(TOP)/src/*.sources)
|
||||
|
|
|
@ -114,10 +114,45 @@ namespace ObjCRuntime {
|
|||
if (GC.MaxGeneration <= 0)
|
||||
throw ErrorHelper.CreateError (8017, "The Boehm garbage collector is not supported. Please use SGen instead.");
|
||||
|
||||
VerifyMonoVersion ();
|
||||
|
||||
LookupInternalFunction<set_bool_func> ("xamarin_set_is_unified") (IsUnifiedBuild);
|
||||
LookupInternalFunction<initialize_func> ("xamarin_initialize") ();
|
||||
}
|
||||
|
||||
static void VerifyMonoVersion ()
|
||||
{
|
||||
// Verify that the system mono we're running against is of a supported version.
|
||||
// Only verify if we're able to get the mono version (we don't want to fail if the Mono.Runtime type was linked away for instance).
|
||||
var type = Type.GetType ("Mono.Runtime");
|
||||
if (type == null)
|
||||
return;
|
||||
|
||||
var displayName = type.GetMethod ("GetDisplayName", BindingFlags.NonPublic | BindingFlags.Static);
|
||||
if (displayName == null)
|
||||
return;
|
||||
|
||||
var actual = displayName.Invoke (null, null) as string;
|
||||
if (string.IsNullOrEmpty (actual))
|
||||
return;
|
||||
// The version string looks something like this:
|
||||
// "5.16.0.209 (2018-06/709b46e3338 Wed Oct 31 09:14:07 EDT 2018)"
|
||||
// We only want the first part up until the first space.
|
||||
var spaceIndex = actual.IndexOf (' ');
|
||||
if (spaceIndex > 0)
|
||||
actual = actual.Substring (0, spaceIndex);
|
||||
if (!Version.TryParse (actual, out var actual_version))
|
||||
return;
|
||||
|
||||
if (!Version.TryParse (Constants.MinMonoVersion, out var required_version))
|
||||
return;
|
||||
|
||||
if (required_version <= actual_version)
|
||||
return;
|
||||
|
||||
throw new NotSupportedException ($"This version of Xamarin.Mac requires Mono {required_version}, but found Mono {actual_version}.");
|
||||
}
|
||||
|
||||
unsafe static void InitializePlatform (InitializationOptions* options)
|
||||
{
|
||||
// BaseDirectory may not be set in some Mono embedded environments
|
||||
|
|
|
@ -8643,7 +8643,17 @@ namespace AppKit {
|
|||
}
|
||||
|
||||
[BaseType (typeof (NSSavePanel))]
|
||||
[DisableDefaultCtor]
|
||||
interface NSOpenPanel {
|
||||
[Static]
|
||||
[Export ("openPanel")]
|
||||
[ForcedType] // different type used inside a sandbox
|
||||
NSOpenPanel OpenPanel { get; }
|
||||
|
||||
[Advice ("You must use 'OpenPanel' method if the application is sandboxed.")]
|
||||
[Export ("init")]
|
||||
IntPtr Constructor ();
|
||||
|
||||
[Export ("URLs")]
|
||||
NSUrl [] Urls { get; }
|
||||
|
||||
|
@ -12896,7 +12906,17 @@ namespace AppKit {
|
|||
delegate void NSSavePanelComplete (nint result);
|
||||
|
||||
[BaseType (typeof (NSPanel), Delegates=new string [] { "Delegate" }, Events=new Type [] { typeof (NSOpenSavePanelDelegate)})]
|
||||
[DisableDefaultCtor]
|
||||
interface NSSavePanel {
|
||||
[Static]
|
||||
[Export ("savePanel")]
|
||||
[ForcedType] // different type used inside a sandbox
|
||||
NSSavePanel SavePanel { get; }
|
||||
|
||||
[Advice ("You must use 'SavePanel' method if the application is sandboxed.")]
|
||||
[Export ("init")]
|
||||
IntPtr Constructor ();
|
||||
|
||||
[Export ("URL")]
|
||||
NSUrl Url { get; }
|
||||
|
||||
|
|
37
src/arkit.cs
37
src/arkit.cs
|
@ -710,10 +710,17 @@ namespace ARKit {
|
|||
[Export ("isSupported")]
|
||||
bool IsSupported { get; }
|
||||
|
||||
#if !XAMCORE_4_0
|
||||
// even if static - it's abstract
|
||||
[iOS (11,3)]
|
||||
[Static]
|
||||
[Export ("supportedVideoFormats")]
|
||||
ARVideoFormat[] SupportedVideoFormats { get; }
|
||||
[Obsolete ("This is an abstract static method. You need to call 'GetSupportedVideoFormats ()' from a subclass to get results.")]
|
||||
ARVideoFormat[] SupportedVideoFormats {
|
||||
// avoid the native exception leading to a crash
|
||||
[Wrap ("Array.Empty<ARVideoFormat> ()")]
|
||||
get;
|
||||
}
|
||||
#endif
|
||||
|
||||
[iOS (11,3)]
|
||||
[Export ("videoFormat", ArgumentSemantic.Strong)]
|
||||
|
@ -734,6 +741,11 @@ namespace ARKit {
|
|||
[BaseType (typeof (ARConfiguration))]
|
||||
interface ARWorldTrackingConfiguration {
|
||||
|
||||
[iOS (11,3)]
|
||||
[Static]
|
||||
[Export ("supportedVideoFormats")]
|
||||
ARVideoFormat[] GetSupportedVideoFormats ();
|
||||
|
||||
[iOS (11,3)]
|
||||
[Export ("autoFocusEnabled")]
|
||||
bool AutoFocusEnabled { [Bind ("isAutoFocusEnabled")] get; set; }
|
||||
|
@ -766,6 +778,12 @@ namespace ARKit {
|
|||
[NoWatch, NoTV, NoMac]
|
||||
[BaseType (typeof(ARConfiguration))]
|
||||
interface AROrientationTrackingConfiguration {
|
||||
|
||||
[iOS (11,3)]
|
||||
[Static]
|
||||
[Export ("supportedVideoFormats")]
|
||||
ARVideoFormat[] GetSupportedVideoFormats ();
|
||||
|
||||
[iOS (11,3)]
|
||||
[Export ("autoFocusEnabled")]
|
||||
bool AutoFocusEnabled { [Bind ("isAutoFocusEnabled")] get; set; }
|
||||
|
@ -795,7 +813,12 @@ namespace ARKit {
|
|||
[iOS (11,0)]
|
||||
[NoWatch, NoTV, NoMac]
|
||||
[BaseType (typeof(ARConfiguration))]
|
||||
interface ARFaceTrackingConfiguration {}
|
||||
interface ARFaceTrackingConfiguration {
|
||||
[iOS (11,3)]
|
||||
[Static]
|
||||
[Export ("supportedVideoFormats")]
|
||||
ARVideoFormat[] GetSupportedVideoFormats ();
|
||||
}
|
||||
|
||||
[iOS (11,0)]
|
||||
[NoWatch, NoTV, NoMac]
|
||||
|
@ -1225,6 +1248,10 @@ namespace ARKit {
|
|||
[NoWatch, NoTV, NoMac]
|
||||
[BaseType (typeof(ARConfiguration))]
|
||||
interface ARImageTrackingConfiguration {
|
||||
[Static]
|
||||
[Export ("supportedVideoFormats")]
|
||||
ARVideoFormat[] GetSupportedVideoFormats ();
|
||||
|
||||
[Export ("autoFocusEnabled")]
|
||||
bool AutoFocusEnabled { [Bind ("isAutoFocusEnabled")] get; set; }
|
||||
|
||||
|
@ -1239,6 +1266,10 @@ namespace ARKit {
|
|||
[NoWatch, NoTV, NoMac]
|
||||
[BaseType (typeof(ARConfiguration))]
|
||||
interface ARObjectScanningConfiguration {
|
||||
[Static]
|
||||
[Export ("supportedVideoFormats")]
|
||||
ARVideoFormat[] GetSupportedVideoFormats ();
|
||||
|
||||
[Export ("autoFocusEnabled")]
|
||||
bool AutoFocusEnabled { [Bind ("isAutoFocusEnabled")] get; set; }
|
||||
|
||||
|
|
|
@ -138,8 +138,6 @@ APPKIT_SOURCES = \
|
|||
AppKit/NSTouch.cs \
|
||||
AppKit/NSTreeController.cs \
|
||||
AppKit/NSWindow.cs \
|
||||
AppKit/NSOpenPanel.cs \
|
||||
AppKit/NSSavePanel.cs \
|
||||
AppKit/NSWorkspace.cs \
|
||||
AppKit/NSCollectionView.cs \
|
||||
AppKit/NSCollectionViewDelegate.cs \
|
||||
|
|
|
@ -1,84 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{D2EE02C0-9BFD-477D-AC92-4DE2D8490790}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>src</RootNamespace>
|
||||
<AssemblyName>bgen</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>True</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>False</Optimize>
|
||||
<OutputPath>build\common</OutputPath>
|
||||
<DefineConstants>DEBUG;BGENERATOR;NET_4_0;NO_AUTHENTICODE;STATIC;NO_SYMBOL_WRITER</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(RunConfiguration)' == 'Default' ">
|
||||
<StartAction>Project</StartAction>
|
||||
<StartArguments/>
|
||||
<StartWorkingDirectory>$(ProjectDir)</StartWorkingDirectory>
|
||||
<EnvironmentVariables>
|
||||
<Variable name="MD_MTOUCH_SDK_ROOT" value="../_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git"/>
|
||||
<Variable name="XamarinMacFrameworkRoot" value="../_mac-build/Library/Frameworks/Xamarin.Mac.framework/Versions/Current"/>
|
||||
</EnvironmentVariables>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(RunConfiguration)' == 'ios' ">
|
||||
<StartAction>Project</StartAction>
|
||||
<StartArguments>@$(RunConfiguration).rsp</StartArguments>
|
||||
<StartWorkingDirectory>$(ProjectDir)</StartWorkingDirectory>
|
||||
<EnvironmentVariables>
|
||||
<Variable name="MD_MTOUCH_SDK_ROOT" value="../_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git"/>
|
||||
</EnvironmentVariables>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(RunConfiguration)' == 'tvos' ">
|
||||
<StartAction>Project</StartAction>
|
||||
<StartArguments>@$(RunConfiguration).rsp</StartArguments>
|
||||
<StartWorkingDirectory>$(ProjectDir)</StartWorkingDirectory>
|
||||
<EnvironmentVariables>
|
||||
<Variable name="MD_MTOUCH_SDK_ROOT" value="../_ios-build//Library/Frameworks/Xamarin.iOS.framework/Versions/git"/>
|
||||
</EnvironmentVariables>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(RunConfiguration)' == 'watchos' ">
|
||||
<StartAction>Project</StartAction>
|
||||
<StartArguments>@$(RunConfiguration).rsp</StartArguments>
|
||||
<StartWorkingDirectory>$(ProjectDir)</StartWorkingDirectory>
|
||||
<EnvironmentVariables>
|
||||
<Variable name="MD_MTOUCH_SDK_ROOT" value="../_ios-build//Library/Frameworks/Xamarin.iOS.framework/Versions/git"/>
|
||||
</EnvironmentVariables>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(RunConfiguration)' == 'mac-mobile' ">
|
||||
<StartAction>Project</StartAction>
|
||||
<StartArguments>@$(RunConfiguration).rsp</StartArguments>
|
||||
<StartWorkingDirectory>$(ProjectDir)</StartWorkingDirectory>
|
||||
<EnvironmentVariables>
|
||||
<Variable name="XamarinMacFrameworkRoot" value="../_mac-build/Library/Frameworks/Xamarin.Mac.framework/Versions/Current"/>
|
||||
</EnvironmentVariables>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(RunConfiguration)' == 'mac-full' ">
|
||||
<StartAction>Project</StartAction>
|
||||
<StartArguments>@$(RunConfiguration).rsp</StartArguments>
|
||||
<StartWorkingDirectory>$(ProjectDir)</StartWorkingDirectory>
|
||||
<EnvironmentVariables>
|
||||
<Variable name="XamarinMacFrameworkRoot" value="../_mac-build/Library/Frameworks/Xamarin.Mac.framework/Versions/Current"/>
|
||||
</EnvironmentVariables>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<ItemGroup>
|
||||
<None Include="..\docs\website\generator-errors.md">
|
||||
<Link>generator-errors.md</Link>
|
||||
</None>
|
||||
<!--%IKVM_FILES%-->
|
||||
<!--%FILES%-->
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -100,9 +100,9 @@ namespace MapKit {
|
|||
[Export ("initWithAnnotation:reuseIdentifier:")]
|
||||
[PostGet ("Annotation")]
|
||||
#if XAMCORE_2_0
|
||||
IntPtr Constructor (IMKAnnotation annotation, [NullAllowed] string reuseIdentifier);
|
||||
IntPtr Constructor ([NullAllowed] IMKAnnotation annotation, [NullAllowed] string reuseIdentifier);
|
||||
#else
|
||||
IntPtr Constructor (NSObject annotation, [NullAllowed] string reuseIdentifier);
|
||||
IntPtr Constructor ([NullAllowed] NSObject annotation, [NullAllowed] string reuseIdentifier);
|
||||
#endif
|
||||
|
||||
[Export ("initWithFrame:")]
|
||||
|
@ -815,9 +815,9 @@ namespace MapKit {
|
|||
|
||||
[Export ("initWithAnnotation:reuseIdentifier:")]
|
||||
#if XAMCORE_2_0
|
||||
IntPtr Constructor ([NullAllowed] IMKAnnotation annotation, string reuseIdentifier);
|
||||
IntPtr Constructor ([NullAllowed] IMKAnnotation annotation, [NullAllowed] string reuseIdentifier);
|
||||
#else
|
||||
IntPtr Constructor ([NullAllowed] NSObject annotation, string reuseIdentifier);
|
||||
IntPtr Constructor ([NullAllowed] NSObject annotation, [NullAllowed] string reuseIdentifier);
|
||||
#endif
|
||||
|
||||
[NoTV]
|
||||
|
@ -1916,7 +1916,7 @@ namespace MapKit {
|
|||
// inlined from base type
|
||||
[Export ("initWithAnnotation:reuseIdentifier:")]
|
||||
[PostGet ("Annotation")]
|
||||
IntPtr Constructor (IMKAnnotation annotation, [NullAllowed] string reuseIdentifier);
|
||||
IntPtr Constructor ([NullAllowed] IMKAnnotation annotation, [NullAllowed] string reuseIdentifier);
|
||||
|
||||
[Export ("titleVisibility", ArgumentSemantic.Assign)]
|
||||
MKFeatureVisibility TitleVisibility { get; set; }
|
||||
|
|
|
@ -92,6 +92,7 @@ test.config: Makefile $(TOP)/Make.config
|
|||
@echo "JENKINS_RESULTS_DIRECTORY=$(abspath $(JENKINS_RESULTS_DIRECTORY))" >> $@
|
||||
@echo "INCLUDE_DEVICE=$(INCLUDE_DEVICE)" >> $@
|
||||
@echo "XCODE_DEVELOPER_ROOT=$(XCODE_DEVELOPER_ROOT)" >> $@
|
||||
@echo "MONO_SDK_DESTDIR=$(MONO_SDK_DESTDIR)" >> $@
|
||||
|
||||
test-system.config:
|
||||
@rm -f $@
|
||||
|
@ -194,8 +195,6 @@ $(TOP)/tools/mtouch/SdkVersions.cs: $(TOP)/tools/common/SdkVersions.cs.in
|
|||
@touch $@
|
||||
|
||||
.stamp-build-mono-unit-tests: $(TOP)/.git/modules/external/mono/HEAD
|
||||
make -j8 -C $(TOP)/external/mono/mcs/class -i do-test PROFILE=MONOTOUCH # TODO: This should not be needed and we should get the dlls from the SDK.
|
||||
make -j8 -C $(TOP)/external/mono/mcs/class -i do-xunit-test PROFILE=MONOTOUCH # TODO: This should not be needed and we should get the dlls from the SDK.
|
||||
make -j8 -C $(TOP)/external/mono/mcs/class -i do-test PROFILE=xammac_net_4_5 # TODO: This should not be needed and we should get the dlls from the SDK.
|
||||
make -j8 -C $(TOP)/external/mono/mcs/class -i do-xunit-test PROFILE=xammac_net_4_5 # TODO: This should not be needed and we should get the dlls from the SDK.
|
||||
nuget restore bcl-test/BCLTests/BCLTests.csproj
|
||||
|
|
|
@ -142,6 +142,9 @@
|
|||
<Compile Include="templates\common\TestRunner.NUnit\ClassOrNamespaceFilter.cs">
|
||||
<Link>TestRunner.NUnit\ClassOrNamespaceFilter.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="templates\common\TestRunner.NUnit\TestMethodFilter.cs">
|
||||
<Link>TestRunner.NUnit\TestMethodFilter.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="templates\common\TestRunner.Core\Extensions.Bool.cs">
|
||||
<Link>TestRunner.Core\Extensions.Bool.cs</Link>
|
||||
</Compile>
|
||||
|
@ -190,6 +193,9 @@
|
|||
<Compile Include="templates\common\ApplicationOptions.cs">
|
||||
<Link>ApplicationOptions.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="templates\common\IgnoreFileParser.cs">
|
||||
<Link>IgnoreFileParser.cs</Link>
|
||||
</Compile>
|
||||
%REGISTER TYPE%
|
||||
<Compile Include="templates\macOS\MacTestMain.cs">
|
||||
<Link>MacTestMain.cs</Link>
|
||||
|
@ -202,6 +208,7 @@
|
|||
<EmbeddedResource Include="templates\common\TestRunner.xUnit\NUnitXml.xslt">
|
||||
<Link>TestRunner.xUnit\NUnitXml.xslt</Link>
|
||||
</EmbeddedResource>
|
||||
%CONTENT RESOURCES%
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Mac\Xamarin.Mac.CSharp.targets" />
|
||||
<Import Project="..\..\..\packages\NETStandard.Library.2.0.0\build\netstandard2.0\NETStandard.Library.targets" Condition="Exists('..\..\..\packages\NETStandard.Library.2.0.0\build\netstandard2.0\NETStandard.Library.targets')" />
|
||||
|
|
|
@ -133,6 +133,9 @@
|
|||
<Reference Include="nunitlite">
|
||||
<HintPath>..\..\..\external\mono\mcs\class\lib\monotouch\nunitlite.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xunit.NetCore.Extensions">
|
||||
<HintPath>..\..\..\external\mono\external\xunit-binaries\Xunit.NetCore.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions">
|
||||
<HintPath>..\..\..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
|
@ -213,6 +216,9 @@
|
|||
<Compile Include="templates\common\TestRunner.NUnit\ClassOrNamespaceFilter.cs">
|
||||
<Link>TestRunner.NUnit\ClassOrNamespaceFilter.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="templates\common\TestRunner.NUnit\TestMethodFilter.cs">
|
||||
<Link>TestRunner.NUnit\TestMethodFilter.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="templates\common\TestRunner.Core\Extensions.Bool.cs">
|
||||
<Link>TestRunner.Core\Extensions.Bool.cs</Link>
|
||||
</Compile>
|
||||
|
@ -261,6 +267,9 @@
|
|||
<Compile Include="templates\common\ApplicationOptions.cs">
|
||||
<Link>ApplicationOptions.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="templates\common\IgnoreFileParser.cs">
|
||||
<Link>IgnoreFileParser.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="templates\tvOSApp\AppDelegate.cs">
|
||||
<Link>AppDelegate.cs</Link>
|
||||
</Compile>
|
||||
|
@ -280,6 +289,7 @@
|
|||
<EmbeddedResource Include="templates\common\TestRunner.xUnit\NUnitXml.xslt">
|
||||
<Link>TestRunner.xUnit\NUnitXml.xslt</Link>
|
||||
</EmbeddedResource>
|
||||
%CONTENT RESOURCES%
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\TVOS\Xamarin.TVOS.CSharp.targets" />
|
||||
<Import Project="..\..\..\packages\NETStandard.Library.2.0.0\build\netstandard2.0\NETStandard.Library.targets" Condition="Exists('..\..\..\packages\NETStandard.Library.2.0.0\build\netstandard2.0\NETStandard.Library.targets')" />
|
||||
|
|
|
@ -92,6 +92,9 @@
|
|||
<Reference Include="nunitlite">
|
||||
<HintPath>..\..\..\external\mono\mcs\class\lib\monotouch\nunitlite.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xunit.NetCore.Extensions">
|
||||
<HintPath>..\..\..\external\mono\external\xunit-binaries\Xunit.NetCore.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions">
|
||||
<HintPath>..\..\..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
|
@ -196,6 +199,9 @@
|
|||
<Compile Include="templates\common\TestRunner.NUnit\ClassOrNamespaceFilter.cs">
|
||||
<Link>TestRunner.NUnit\ClassOrNamespaceFilter.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="templates\common\TestRunner.NUnit\TestMethodFilter.cs">
|
||||
<Link>TestRunner.NUnit\TestMethodFilter.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="templates\common\TestRunner.xUnit\XUnitFilter.cs">
|
||||
<Link>TestRunner.xUnit\XUnitFilter.cs</Link>
|
||||
</Compile>
|
||||
|
@ -211,12 +217,16 @@
|
|||
<Compile Include="templates\common\ApplicationOptions.cs">
|
||||
<Link>ApplicationOptions.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="templates\common\IgnoreFileParser.cs">
|
||||
<Link>IgnoreFileParser.cs</Link>
|
||||
</Compile>
|
||||
%REGISTER TYPE%
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="templates\common\TestRunner.xUnit\NUnitXml.xslt">
|
||||
<Link>TestRunner.xUnit\NUnitXml.xslt</Link>
|
||||
</EmbeddedResource>
|
||||
%CONTENT RESOURCES%
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="TestRunner.Core\" />
|
||||
|
|
|
@ -379,6 +379,12 @@
|
|||
<Link>ViewController.designer.cs</Link>
|
||||
<DependentUpon>ViewController.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="templates\common\TestRunner.NUnit\TestMethodFilter.cs">
|
||||
<Link>TestRunner.NUnit\TestMethodFilter.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="templates\common\IgnoreFileParser.cs">
|
||||
<Link>IgnoreFileParser.cs</Link>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="templates\common\TestRunner.xUnit\NUnitXml.xslt">
|
||||
|
|
|
@ -145,6 +145,9 @@
|
|||
<Reference Include="nunitlite">
|
||||
<HintPath>..\..\..\external\mono\mcs\class\lib\monotouch\nunitlite.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xunit.NetCore.Extensions">
|
||||
<HintPath>..\..\..\external\mono\external\xunit-binaries\Xunit.NetCore.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions">
|
||||
<HintPath>..\..\..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
|
@ -225,6 +228,9 @@
|
|||
<Compile Include="templates\common\TestRunner.NUnit\ClassOrNamespaceFilter.cs">
|
||||
<Link>TestRunner.NUnit\ClassOrNamespaceFilter.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="templates\common\TestRunner.NUnit\TestMethodFilter.cs">
|
||||
<Link>TestRunner.NUnit\TestMethodFilter.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="templates\common\TestRunner.Core\Extensions.Bool.cs">
|
||||
<Link>TestRunner.Core\Extensions.Bool.cs</Link>
|
||||
</Compile>
|
||||
|
@ -273,6 +279,9 @@
|
|||
<Compile Include="templates\common\ApplicationOptions.cs">
|
||||
<Link>ApplicationOptions.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="templates\common\IgnoreFileParser.cs">
|
||||
<Link>IgnoreFileParser.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="templates\iOSApp\AppDelegate.cs">
|
||||
<Link>AppDelegate.cs</Link>
|
||||
</Compile>
|
||||
|
@ -292,6 +301,7 @@
|
|||
<EmbeddedResource Include="templates\common\TestRunner.xUnit\NUnitXml.xslt">
|
||||
<Link>TestRunner.xUnit\NUnitXml.xslt</Link>
|
||||
</EmbeddedResource>
|
||||
%CONTENT RESOURCES%
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
|
||||
<Import Project="..\..\..\packages\NETStandard.Library.2.0.0\build\netstandard2.0\NETStandard.Library.targets" Condition="Exists('..\..\..\packages\NETStandard.Library.2.0.0\build\netstandard2.0\NETStandard.Library.targets')" />
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
# No exception was thrown when System.Reflection.TargetInvocationException was expected
|
||||
System.Data.Tests.DataTableReadXmlSchemaTest.XsdSchemaDeserializationOnFullFrameworkStillHasBug
|
||||
|
||||
# Expected error message A network-related or instance-specific error occurred while establishing a connection to SQL Server., but received: The method or operation is not implemented.
|
||||
System.Data.SqlClient.Tests.TcpDefaultForAzureTest.AzureNpConnectionTest
|
||||
|
||||
# Expected error message A network-related or instance-specific error occurred while establishing a connection to SQL Server., but received: Snix_Connect (provider: SNI_PN7, error: 35 - SNI_ERROR_35)
|
||||
System.Data.SqlClient.Tests.TcpDefaultForAzureTest.NonAzureTcpConnectionTest
|
||||
|
||||
# Expected error message A network-related or instance-specific error occurred while establishing a connection to SQL Server., but received: Snix_Connect (provider: SNI_PN7, error: 35 - SNI_ERROR_35)
|
||||
System.Data.SqlClient.Tests.TcpDefaultForAzureTest.AzureTcpConnectionTest
|
||||
|
||||
# Expected error message A network-related or instance-specific error occurred while establishing a connection to SQL Server., but received: Snix_Connect (provider: SNI_PN7, error: 35 - SNI_ERROR_35)
|
||||
System.Data.SqlClient.Tests.TcpDefaultForAzureTest.NonAzureNoProtocolConnectionTest
|
||||
|
||||
# Expected error message A network-related or instance-specific error occurred while establishing a connection to SQL Server., but received: Snix_Connect (provider: SNI_PN7, error: 35 - SNI_ERROR_35)
|
||||
System.Data.SqlClient.Tests.TcpDefaultForAzureTest.AzureNoProtocolConnectionTest
|
||||
|
||||
# Expected error message A network-related or instance-specific error occurred while establishing a connection to SQL Server., but received: The method or operation is not implemented.
|
||||
System.Data.SqlClient.Tests.TcpDefaultForAzureTest.NonAzureNpConnectionTest
|
|
@ -0,0 +1,17 @@
|
|||
# The following ignores have been reported in the issue:
|
||||
# issue https://github.com/xamarin/maccore/issues/1137
|
||||
|
||||
# An unexpected exception type was thrown
|
||||
MonoTests.System.ServiceModel.Description.JsonQueryStringConverterTest.ConvertStringToValueInvalidCast2
|
||||
|
||||
# An unexpected exception type was thrown
|
||||
MonoTests.System.ServiceModel.Description.QueryStringConverterTest.ConvertStringToValueInvalidCast2
|
||||
|
||||
# Should result in invalid operation
|
||||
MonoTests.System.ServiceModel.Description.WebHttpBehaviorTest.MultipleParameters2
|
||||
|
||||
# System.ArgumentException : baseAddress scheme must be either http or https.
|
||||
MonoTests.System.UriTemplateTest.BindByNameFileUriBaseAddress
|
||||
|
||||
# System.ArgumentException : baseAddress scheme must be either http or https.
|
||||
MonoTests.System.UriTemplateTest.BindByPositionFileUriBaseAddress
|
|
@ -0,0 +1,91 @@
|
|||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using System.Reflection;
|
||||
using System;
|
||||
|
||||
namespace BCLTests {
|
||||
|
||||
/// <summary>
|
||||
/// Class that can parser a file/stream with the ignored tests and will
|
||||
/// return a list of the ignored tests.
|
||||
/// </summary>
|
||||
public static class IgnoreFileParser {
|
||||
|
||||
static string ParseLine (string line)
|
||||
{
|
||||
// we have to make sure of several things, first, lets
|
||||
// remove any char after the first # which would mean
|
||||
// we have comments:
|
||||
var pos = line.IndexOf ('#');
|
||||
if (pos > -1) {
|
||||
line = line.Remove (pos);
|
||||
}
|
||||
line = line.Trim ();
|
||||
return line;
|
||||
}
|
||||
public static async Task<IEnumerable<string>> ParseStreamAsync (TextReader textReader)
|
||||
{
|
||||
var ignoredMethods = new List<string> ();
|
||||
string line;
|
||||
while ((line = await textReader.ReadLineAsync()) != null) {
|
||||
// we have to make sure of several things, first, lets
|
||||
// remove any char after the first # which would mean
|
||||
// we have comments:
|
||||
line = ParseLine (line);
|
||||
if (string.IsNullOrEmpty (line))
|
||||
continue;
|
||||
ignoredMethods.Add (line);
|
||||
}
|
||||
return ignoredMethods;
|
||||
}
|
||||
|
||||
public static async Task<IEnumerable<string>> ParseAssemblyResourcesAsync (Assembly asm)
|
||||
{
|
||||
var ignoredTests = new List<string> ();
|
||||
// the project generator added the required resources,
|
||||
// we extract them, parse them and add the result
|
||||
foreach (var resourceName in asm.GetManifestResourceNames ()) {
|
||||
if (resourceName.EndsWith (".ignore", StringComparison.Ordinal)) {
|
||||
using (var stream = asm.GetManifestResourceStream (resourceName))
|
||||
using (var reader = new StreamReader (stream)) {
|
||||
var ignored = await ParseStreamAsync (reader);
|
||||
// we could have more than one file, lets add them
|
||||
ignoredTests.AddRange (ignored);
|
||||
}
|
||||
}
|
||||
}
|
||||
return ignoredTests;
|
||||
}
|
||||
|
||||
public static async Task<IEnumerable<string>> ParseContentFilesAsync (string contentDir)
|
||||
{
|
||||
var ignoredTests = new List<string> ();
|
||||
foreach (var f in Directory.GetFiles (contentDir, "*.ignore")) {
|
||||
using (var reader = new StreamReader (f)) {
|
||||
var ignored = await ParseStreamAsync (reader);
|
||||
ignoredTests.AddRange (ignored);
|
||||
}
|
||||
}
|
||||
return ignoredTests;
|
||||
}
|
||||
|
||||
public static IEnumerable<string> ParseContentFiles (string contentDir)
|
||||
{
|
||||
var ignoredTests = new List<string> ();
|
||||
foreach (var f in Directory.GetFiles (contentDir, "*.ignore")) {
|
||||
using (var reader = new StreamReader (f)) {
|
||||
string line;
|
||||
while ((line = reader.ReadLine ()) != null) {
|
||||
|
||||
line = ParseLine (line);
|
||||
if (string.IsNullOrEmpty (line))
|
||||
continue;
|
||||
ignoredTests.Add (line);
|
||||
}
|
||||
}
|
||||
}
|
||||
return ignoredTests;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -33,6 +33,7 @@ namespace Xamarin.iOS.UnitTests
|
|||
public abstract void Run (IList <TestAssemblyInfo> testAssemblies);
|
||||
public abstract string WriteResultsToFile ();
|
||||
public abstract void WriteResultsToFile (TextWriter writer);
|
||||
public abstract void SkipTests (IEnumerable<string> tests);
|
||||
|
||||
protected void OnError (string message)
|
||||
{
|
||||
|
|
|
@ -169,7 +169,6 @@ namespace Xamarin.iOS.UnitTests.NUnit
|
|||
sb.Append ("\t[INFO] ");
|
||||
break;
|
||||
}
|
||||
TotalTests++;
|
||||
sb.Append (result.Test.FixtureType.Name);
|
||||
sb.Append (".");
|
||||
sb.Append (result.Test.Name);
|
||||
|
@ -243,5 +242,13 @@ namespace Xamarin.iOS.UnitTests.NUnit
|
|||
var resultsXml = new NUnit2XmlOutputWriter (DateTime.UtcNow);
|
||||
resultsXml.WriteResultFile (results, writer);
|
||||
}
|
||||
|
||||
public override void SkipTests (IEnumerable<string> tests)
|
||||
{
|
||||
// grab the tests and create a filter for them
|
||||
if (tests.Any ()) {
|
||||
Filter = new TestMethodFilter (tests);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,69 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using NUnit.Framework.Api;
|
||||
using NUnit.Framework.Internal;
|
||||
using NUnit.Framework.Internal.Filters;
|
||||
|
||||
namespace Xamarin.iOS.UnitTests.NUnit
|
||||
{
|
||||
public class TestMethodFilter : TestFilter
|
||||
{
|
||||
HashSet <string> methods = new HashSet<string> ();
|
||||
|
||||
public TestMethodFilter (string method)
|
||||
{
|
||||
if (string.IsNullOrEmpty (method))
|
||||
throw new ArgumentException (nameof (method));
|
||||
Add (method);
|
||||
}
|
||||
|
||||
public TestMethodFilter (IEnumerable<string> methods)
|
||||
{
|
||||
if (methods == null)
|
||||
throw new ArgumentNullException (nameof (methods));
|
||||
|
||||
AddRange (methods);
|
||||
}
|
||||
|
||||
public void Add (string method)
|
||||
{
|
||||
if (string.IsNullOrEmpty (method))
|
||||
throw new ArgumentException ("must not be null or empty", nameof (method));
|
||||
|
||||
methods.Add (method);
|
||||
}
|
||||
|
||||
public void AddRange (IEnumerable<string> ignoredMethods)
|
||||
{
|
||||
if (methods == null)
|
||||
throw new ArgumentNullException (nameof (ignoredMethods));
|
||||
foreach (var m in ignoredMethods)
|
||||
methods.Add (m);
|
||||
}
|
||||
|
||||
public override bool Match (ITest test)
|
||||
{
|
||||
if (test == null || methods == null || methods.Count == 0)
|
||||
return false;
|
||||
|
||||
if (test.FixtureType == null)
|
||||
return false; // It's probably an assembly name, all tests will have a fixture
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool Pass (ITest test)
|
||||
{
|
||||
if (test == null || methods == null || methods.Count == 0)
|
||||
return false;
|
||||
|
||||
if (test.FixtureType == null)
|
||||
return false; // It's probably an assembly name, all tests will have a fixture
|
||||
|
||||
// if the method is not present, execute the test
|
||||
return !methods.Contains (test.FullName);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -18,7 +18,7 @@ namespace Xamarin.iOS.UnitTests.XUnit
|
|||
readonly TestMessageSink messageSink;
|
||||
|
||||
XElement assembliesElement;
|
||||
List<XUnitFilter> filters;
|
||||
List<XUnitFilter> filters = new List<XUnitFilter> ();
|
||||
bool runAssemblyByDefault;
|
||||
|
||||
public XUnitResultFileFormat ResultFileFormat { get; set; } = XUnitResultFileFormat.NUnit;
|
||||
|
@ -1005,5 +1005,15 @@ namespace Xamarin.iOS.UnitTests.XUnit
|
|||
return !filter.Exclude;
|
||||
}
|
||||
}
|
||||
|
||||
public override void SkipTests (IEnumerable<string> tests)
|
||||
{
|
||||
if (tests.Any ()) {
|
||||
// create a single filter per test
|
||||
foreach (var t in tests) {
|
||||
filters.Add (XUnitFilter.CreateSingleFilter (t, true));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,6 +9,10 @@ using Xamarin.iOS.UnitTests;
|
|||
using Xamarin.iOS.UnitTests.NUnit;
|
||||
using BCLTests.TestRunner.Core;
|
||||
using Xamarin.iOS.UnitTests.XUnit;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using System.Linq;
|
||||
using Foundation;
|
||||
|
||||
namespace BCLTests {
|
||||
public partial class ViewController : UIViewController {
|
||||
|
@ -56,7 +60,7 @@ namespace BCLTests {
|
|||
}
|
||||
#endif
|
||||
|
||||
public override void ViewDidLoad ()
|
||||
public async override void ViewDidLoad ()
|
||||
{
|
||||
base.ViewDidLoad ();
|
||||
var options = ApplicationOptions.Current;
|
||||
|
@ -75,7 +79,13 @@ namespace BCLTests {
|
|||
runner = new XUnitTestRunner (logger);
|
||||
else
|
||||
runner = new NUnitTestRunner (logger);
|
||||
|
||||
|
||||
var skippedTests = await IgnoreFileParser.ParseContentFilesAsync (NSBundle.MainBundle.BundlePath);
|
||||
if (skippedTests.Any ()) {
|
||||
// ensure that we skip those tests that have been passed via the ignore files
|
||||
runner.SkipTests (skippedTests);
|
||||
}
|
||||
|
||||
runner.Run ((IList<TestAssemblyInfo>)testAssemblies);
|
||||
if (options.EnableXml) {
|
||||
runner.WriteResultsToFile (writer);
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
@ -9,6 +10,9 @@ using Xamarin.iOS.UnitTests;
|
|||
using Xamarin.iOS.UnitTests.NUnit;
|
||||
using BCLTests.TestRunner.Core;
|
||||
using Xamarin.iOS.UnitTests.XUnit;
|
||||
using System.Threading.Tasks;
|
||||
using System.IO;
|
||||
using Foundation;
|
||||
|
||||
namespace BCLTests {
|
||||
public partial class ViewController : UIViewController {
|
||||
|
@ -54,7 +58,7 @@ namespace BCLTests {
|
|||
}
|
||||
#endif
|
||||
|
||||
public override void ViewDidLoad ()
|
||||
public async override void ViewDidLoad ()
|
||||
{
|
||||
base.ViewDidLoad ();
|
||||
var options = ApplicationOptions.Current;
|
||||
|
@ -73,7 +77,13 @@ namespace BCLTests {
|
|||
runner = new XUnitTestRunner (logger);
|
||||
else
|
||||
runner = new NUnitTestRunner (logger);
|
||||
|
||||
|
||||
var skippedTests = await IgnoreFileParser.ParseContentFilesAsync (NSBundle.MainBundle.BundlePath);
|
||||
if (skippedTests.Any ()) {
|
||||
// ensure that we skip those tests that have been passed via the ignore files
|
||||
runner.SkipTests (skippedTests);
|
||||
}
|
||||
|
||||
runner.Run ((IList<TestAssemblyInfo>)testAssemblies);
|
||||
if (options.EnableXml) {
|
||||
runner.WriteResultsToFile (writer);
|
||||
|
|
|
@ -16,6 +16,7 @@ using Xamarin.iOS.UnitTests.NUnit;
|
|||
using BCLTests;
|
||||
using BCLTests.TestRunner.Core;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace monotouchtestWatchKitExtension
|
||||
{
|
||||
|
@ -108,6 +109,12 @@ namespace monotouchtestWatchKitExtension
|
|||
else
|
||||
runner = new NUnitTestRunner (logger);
|
||||
|
||||
var skippedTests = IgnoreFileParser.ParseContentFiles (NSBundle.MainBundle.BundlePath);
|
||||
if (skippedTests.Any ()) {
|
||||
// ensure that we skip those tests that have been passed via the ignore files
|
||||
runner.SkipTests (skippedTests);
|
||||
}
|
||||
|
||||
ThreadPool.QueueUserWorkItem ((v) =>
|
||||
{
|
||||
BeginInvokeOnMainThread (() =>
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
# System.PlatformNotSupportedException : Process.Start is not supported on the current platform.
|
||||
System.Data.Tests.DataTableReadXmlSchemaTest.XsdSchemaDeserializationIgnoresLocale
|
||||
|
||||
# System.PlatformNotSupportedException : Process.Start is not supported on the current platform.
|
||||
System.Data.Tests.DataTableReadXmlSchemaTest.XsdSchemaSerializationIgnoresLocale
|
|
@ -0,0 +1,2 @@
|
|||
# System.PlatformNotSupportedException : System.Net.Dns:GetHostByName is not supported on this platform.
|
||||
MonoTests.Mono.Data.Tds.TdsConnectionPoolTest.CheckNullException
|
|
@ -0,0 +1,82 @@
|
|||
# System.PlatformNotSupportedException : System.Data.SqlClient.SqlConnection is not supported on the current platform.
|
||||
System.Data.SqlClient.Tests.SqlConnectionTest.RetrieveStatistics_Keys_SyncRoot_Success
|
||||
System.Data.SqlClient.Tests.SqlConnectionTest.RetrieveStatistics_Add_ExistingKey_Throws
|
||||
System.Data.SqlClient.Tests.SqlConnectionTest.RetrieveStatistics_Keys_CopyTo_StringArray_Success
|
||||
System.Data.SqlClient.Tests.SqlConnectionTest.RetrieveStatistics_Contains_NullKey_Throws
|
||||
System.Data.SqlClient.Tests.SqlConnectionTest.RetrieveStatistics_CopyTo_Success
|
||||
System.Data.SqlClient.Tests.SqlConnectionTest.RetrieveStatistics_IDictionary_GetEnumerator_Success
|
||||
System.Data.SqlClient.Tests.SqlConnectionTest.RetrieveStatistics_Setter_NullKey_Throws
|
||||
System.Data.SqlClient.Tests.SqlConnectionTest.RetrieveStatistics_Values_GetEnumerator_ModifyCollection_Throws
|
||||
System.Data.SqlClient.Tests.SqlConnectionTest.RetrieveStatistics_UnexpectedKeysNotInDictionary_Success
|
||||
System.Data.SqlClient.Tests.SqlConnectionTest.RetrieveStatistics_Remove_NonExistentKey_Success
|
||||
System.Data.SqlClient.Tests.SqlConnectionTest.RetrieveStatistics_Setter_Success(key: "Foo", value: 100)
|
||||
System.Data.SqlClient.Tests.CloneTests.CloneParameters
|
||||
System.Data.SqlClient.Tests.CloneTests.CloneSqlConnection
|
||||
System.Data.SqlClient.Tests.CloneTests.CloneSqlCommand
|
||||
System.Data.SqlClient.Tests.SqlClientFactoryTest.FactoryMethodTest # (factory: Func`1 { Method = System.Data.Common.DbCommand CreateCommand(), Target = SqlClientFactory { CanCreateDataSourceEnumerator = True } }, expectedType: typeof(System.Data.SqlClient.SqlCommand)) Test case: System.Data.SqlClient.Tests.SqlClientFactoryTest.FactoryMethodTest
|
||||
|
||||
# System.PlatformNotSupportedException : System.Data.SqlClient.SqlParameter
|
||||
System.Data.SqlClient.Tests.SqlDataRecordTest.GetDataTypeName_ReturnsMetaDataTypeIfUdtType
|
||||
|
||||
# System.PlatformNotSupportedException : System.Data.SqlClient.SqlConnection is not supported on the current platform.
|
||||
System.Data.SqlClient.Tests.SqlClientFactoryTest.FactoryMethodTest # (factory: Func`1 { Method = System.Data.Common.DbConnection CreateConnection(), Target = SqlClientFactory { CanCreateDataSourceEnumerator = True } }, expectedType: typeof(System.Data.SqlClient.SqlConnection)) Test case: System.Data.SqlClient.Tests.SqlClientFactoryTest.FactoryMethodTest
|
||||
System.Data.SqlClient.Tests.SqlConnectionTest.RetrieveStatistics_Keys_Success
|
||||
System.Data.SqlClient.Tests.SqlConnectionTest.RetrieveStatistics_CopyTo_Throws
|
||||
System.Data.SqlClient.Tests.SqlConnectionTest.RetrieveStatistics_Values_SyncRoot_Success
|
||||
System.Data.SqlClient.Tests.SqlConnectionTest.RetrieveStatistics_IsFixedSize_Success
|
||||
System.Data.SqlClient.Tests.SqlConnectionTest.RetrieveStatistics_Remove_ExistingKey_Success
|
||||
System.Data.SqlClient.Tests.SqlConnectionTest.RetrieveStatistics_IsReadOnly_Success
|
||||
System.Data.SqlClient.Tests.SqlConnectionTest.RetrieveStatistics_Keys_GetEnumerator_ModifyCollection_Throws
|
||||
System.Data.SqlClient.Tests.SqlConnectionTest.RetrieveStatistics_Values_CopyTo_Throws
|
||||
System.Data.SqlClient.Tests.SqlConnectionTest.RetrieveStatistics_Add_Success(key: "Blah", value: "Blah")
|
||||
System.Data.SqlClient.Tests.SqlConnectionTest.RetrieveStatistics_Add_Success(key: 100, value: "Value")
|
||||
System.Data.SqlClient.Tests.SqlConnectionTest.RetrieveStatistics_Add_Success(key: "Foo", value: 100)
|
||||
System.Data.SqlClient.Tests.SqlConnectionTest.RetrieveStatistics_Add_Success(key: "Foo", value: null)
|
||||
System.Data.SqlClient.Tests.SqlConnectionTest.RetrieveStatistics_Success
|
||||
System.Data.SqlClient.Tests.SqlConnectionTest.RetrieveStatistics_Clear_Success
|
||||
System.Data.SqlClient.Tests.SqlConnectionTest.RetrieveStatistics_Setter_Success(key: "Blah", value: "Blah")
|
||||
System.Data.SqlClient.Tests.SqlConnectionTest.RetrieveStatistics_Setter_Success(key: 100, value: "Value")
|
||||
System.Data.SqlClient.Tests.SqlConnectionTest.RetrieveStatistics_Setter_Success(key: "Foo", value: null)
|
||||
System.Data.SqlClient.Tests.SqlConnectionTest.RetrieveStatistics_ExpectedKeysInDictionary_Success
|
||||
System.Data.SqlClient.Tests.SqlConnectionTest.RetrieveStatistics_Remove_NullKey_Throws
|
||||
System.Data.SqlClient.Tests.SqlConnectionTest.RetrieveStatistics_Keys_IsSynchronized_Success
|
||||
System.Data.SqlClient.Tests.SqlConnectionTest.RetrieveStatistics_Values_IsSynchronized_Success
|
||||
System.Data.SqlClient.Tests.SqlConnectionTest.RetrieveStatistics_Values_GetEnumerator_Success
|
||||
System.Data.SqlClient.Tests.SqlConnectionTest.RetrieveStatistics_IsSynchronized_Success
|
||||
System.Data.SqlClient.Tests.SqlConnectionTest.RetrieveStatistics_Keys_CopyTo_Throws
|
||||
System.Data.SqlClient.Tests.SqlConnectionTest.RetrieveStatistics_Add_NullKey_Throws
|
||||
System.Data.SqlClient.Tests.SqlConnectionTest.RetrieveStatistics_GetEnumerator_ModifyCollection_Throws
|
||||
System.Data.SqlClient.Tests.SqlConnectionTest.RetrieveStatistics_GetEnumerator_ModifyCollection_Throws
|
||||
System.Data.SqlClient.Tests.SqlConnectionTest.RetrieveStatistics_Keys_CopyTo_ObjectArray_Success
|
||||
System.Data.SqlClient.Tests.SqlConnectionTest.RetrieveStatistics_Setter_ExistingKey_Success
|
||||
System.Data.SqlClient.Tests.SqlConnectionTest.RetrieveStatistics_SyncRoot_Success
|
||||
System.Data.SqlClient.Tests.SqlConnectionTest.RetrieveStatistics_IEnumerable_GetEnumerator_Success
|
||||
System.Data.SqlClient.Tests.SqlConnectionTest.RetrieveStatistics_Values_CopyTo_Int64Array_Success
|
||||
System.Data.SqlClient.Tests.SqlConnectionTest.RetrieveStatistics_Keys_GetEnumerator_Success
|
||||
System.Data.SqlClient.Tests.SqlConnectionTest.RetrieveStatistics_Values_Success
|
||||
System.Data.SqlClient.Tests.SqlBulkCopyColumnMappingCollectionTest.GetEnumerator_ModifiedCollectionDuringEnumeration_ThrowsInvalidOperationException
|
||||
System.Data.SqlClient.Tests.SqlBulkCopyColumnMappingCollectionTest.Remove_BehavesAsExpected
|
||||
System.Data.SqlClient.Tests.SqlBulkCopyColumnMappingCollectionTest.IListAddInsert_InsertNonSqlBulkCopyColumnMappingItems_DoNotThrow
|
||||
System.Data.SqlClient.Tests.SqlBulkCopyColumnMappingCollectionTest.Contains_ItemsAdded_MatchesExpectation
|
||||
System.Data.SqlClient.Tests.SqlBulkCopyColumnMappingCollectionTest.CopyTo_ItemsAdded_ItemsCopiedToArray
|
||||
System.Data.SqlClient.Tests.SqlBulkCopyColumnMappingCollectionTest.IndexOf_BehavesAsExpected
|
||||
System.Data.SqlClient.Tests.SqlBulkCopyColumnMappingCollectionTest.Add_HelperOverloads_ItemsAddedAsExpected
|
||||
System.Data.SqlClient.Tests.SqlBulkCopyColumnMappingCollectionTest.InsertAndClear_BehavesAsExpected
|
||||
System.Data.SqlClient.Tests.SqlBulkCopyColumnMappingCollectionTest.Add_AddItems_ItemsAddedAsEpected
|
||||
System.Data.SqlClient.Tests.SqlBulkCopyColumnMappingCollectionTest.CopyTo_InvalidArrayType_Throws
|
||||
System.Data.SqlClient.Tests.SqlBulkCopyColumnMappingCollectionTest.Properties_ReturnFalse
|
||||
System.Data.SqlClient.Tests.SqlBulkCopyColumnMappingCollectionTest.RemoveAt_BehavesAsExpected
|
||||
System.Data.SqlClient.Tests.SqlBulkCopyColumnMappingCollectionTest.GetEnumerator_NoItems_EmptyEnumerator
|
||||
System.Data.SqlClient.Tests.SqlBulkCopyColumnMappingCollectionTest.SyncRoot_NotNullAndSameObject
|
||||
System.Data.SqlClient.Tests.SqlBulkCopyColumnMappingCollectionTest.GetEnumerator_ItemsAdded_ItemsFromEnumeratorMatchesItemsFromIndexer
|
||||
System.Data.SqlClient.Tests.SqlBulkCopyColumnMappingCollectionTest.GetEnumerator_ItemsAdded_AllItemsReturnedAndEnumeratorBehavesAsExpected
|
||||
System.Data.SqlClient.Tests.SqlBulkCopyColumnMappingCollectionTest.Members_InvalidRange_ThrowsArgumentOutOfRangeException
|
||||
System.Data.SqlClient.Tests.SqlBulkCopyColumnMappingCollectionTest.Add_InvalidItems_ThrowsInvalidOperationException
|
||||
System.Data.SqlClient.Tests.SqlBulkCopyColumnMappingCollectionTest.Insert_BehavesAsExpected
|
||||
System.Data.SqlClient.Tests.SqlBulkCopyColumnMappingCollectionTest.Methods_NullParameterPassed_ThrowsArgumentNullException
|
||||
System.Data.SqlClient.Tests.SqlBulkCopyColumnMappingCollectionTest.Indexer_BehavesAsExpected
|
||||
System.Data.SqlClient.Tests.SqlConnectionTest.RetrieveStatistics_Values_CopyTo_ObjectArray_Success
|
||||
|
||||
# System.IO.IOException : SystemDataXunit- test app isn't present in the test runtime directory.
|
||||
System.Data.Tests.DataTableReadXmlSchemaTest.XsdSchemaDeserializationIgnoresLocale
|
||||
System.Data.Tests.DataTableReadXmlSchemaTest.XsdSchemaSerializationIgnoresLocale
|
|
@ -0,0 +1,53 @@
|
|||
#if XAMCORE_2_0 && __IOS__
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using ARKit;
|
||||
using Foundation;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace MonoTouchFixtures.ARKit {
|
||||
|
||||
[TestFixture]
|
||||
[Preserve (AllMembers = true)]
|
||||
public class ARCondigurationTest {
|
||||
|
||||
[SetUp]
|
||||
public void Setup ()
|
||||
{
|
||||
TestRuntime.AssertXcodeVersion (9,3);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SupportedVideoFormats ()
|
||||
{
|
||||
var svf = ARConfiguration.SupportedVideoFormats;
|
||||
Assert.That (svf, Is.Empty, "empty");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void GetSupportedVideoFormats ()
|
||||
{
|
||||
Assert.NotNull (ARWorldTrackingConfiguration.GetSupportedVideoFormats (), "ARWorldTrackingConfiguration");
|
||||
Assert.NotNull (AROrientationTrackingConfiguration.GetSupportedVideoFormats (), "AROrientationTrackingConfiguration");
|
||||
Assert.NotNull (ARFaceTrackingConfiguration.GetSupportedVideoFormats (), "ARFaceTrackingConfiguration");
|
||||
Assert.NotNull (ARImageTrackingConfiguration.GetSupportedVideoFormats (), "ARImageTrackingConfiguration");
|
||||
Assert.NotNull (ARObjectScanningConfiguration.GetSupportedVideoFormats (), "ARObjectScanningConfiguration");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Subclasses ()
|
||||
{
|
||||
// all subclasses of ARConfiguration must (re)export 'GetSupportedVideoFormats'
|
||||
var c = typeof (ARConfiguration);
|
||||
foreach (var sc in c.Assembly.GetTypes ()) {
|
||||
if (!sc.IsSubclassOf (c))
|
||||
continue;
|
||||
var m = sc.GetMethod ("GetSupportedVideoFormats", BindingFlags.Static | BindingFlags.Public);
|
||||
Assert.NotNull (m, sc.FullName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
|
@ -0,0 +1,79 @@
|
|||
#if !__WATCHOS__
|
||||
|
||||
using System;
|
||||
|
||||
using CoreGraphics;
|
||||
using CoreText;
|
||||
using Foundation;
|
||||
|
||||
using NUnit.Framework;
|
||||
using MonoTouchFixtures.CoreGraphics;
|
||||
|
||||
namespace MonoTouchFixtures.CoreText {
|
||||
|
||||
class MyOps : CTRunDelegateOperations {
|
||||
|
||||
static public bool Ascent;
|
||||
static public bool Descent;
|
||||
static public bool Width;
|
||||
|
||||
public MyOps ()
|
||||
{
|
||||
// to re-run the test
|
||||
Ascent = false;
|
||||
Descent = false;
|
||||
Width = false;
|
||||
}
|
||||
|
||||
public override float GetAscent ()
|
||||
{
|
||||
Ascent = true;
|
||||
return base.GetAscent ();
|
||||
}
|
||||
|
||||
public override float GetDescent ()
|
||||
{
|
||||
Descent = true;
|
||||
return base.GetDescent ();
|
||||
}
|
||||
|
||||
public override float GetWidth ()
|
||||
{
|
||||
Width = true;
|
||||
return base.GetWidth ();
|
||||
}
|
||||
}
|
||||
|
||||
[TestFixture]
|
||||
[Preserve (AllMembers = true)]
|
||||
public class RunTest {
|
||||
|
||||
[Test]
|
||||
public void CustomOps ()
|
||||
{
|
||||
using (var o = new MyOps ())
|
||||
using (var d = new CTRunDelegate (o)) {
|
||||
Assert.AreSame (o, d.Operations, "same");
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Runs ()
|
||||
{
|
||||
using (var mas = new NSMutableAttributedString ("Bonjour"))
|
||||
using (var rd = new CTRunDelegate (new MyOps ())) {
|
||||
var sa = new CTStringAttributes () {
|
||||
RunDelegate = rd,
|
||||
};
|
||||
mas.SetAttributes (sa, new NSRange (3, 3));
|
||||
using (var fs = new CTFramesetter (mas)) {
|
||||
Assert.True (MyOps.Ascent, "Ascent called");
|
||||
Assert.True (MyOps.Descent, "Descent called");
|
||||
Assert.True (MyOps.Width, "Width called");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
|
@ -22,7 +22,8 @@ namespace xharness.BCLTestImporter {
|
|||
var plistTemplatePath = outputDir;
|
||||
|
||||
projectGenerator = new BCLTestProjectGenerator (outputDir, Harness.MONO_PATH, projectTemplatePath, registerTypesTemplatePath, plistTemplatePath) {
|
||||
Override = true
|
||||
iOSMonoSDKPath = Harness.MONO_SDK_DESTDIR,
|
||||
Override = true,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -37,11 +38,6 @@ namespace xharness.BCLTestImporter {
|
|||
Name = $"[{prefix}] Mono {name}",
|
||||
SkiptvOSVariation = !platforms.Contains (Platform.TvOS),
|
||||
SkipwatchOSVariation = !platforms.Contains (Platform.WatchOS),
|
||||
Dependency = async () => {
|
||||
var rv = await Harness.BuildBclTests ();
|
||||
if (!rv.Succeeded)
|
||||
throw new Exception ($"Failed to build BCL tests, exit code: {rv.ExitCode}. Check the harness log for more details.");
|
||||
}
|
||||
});
|
||||
}
|
||||
return result;
|
||||
|
|
|
@ -86,6 +86,7 @@ namespace xharness
|
|||
public string JENKINS_RESULTS_DIRECTORY { get; set; } // Use same name as in Makefiles, so that a grep finds it.
|
||||
public string MAC_DESTDIR { get; set; }
|
||||
public string IOS_DESTDIR { get; set; }
|
||||
public string MONO_SDK_DESTDIR { get; set; }
|
||||
public bool IncludeMac32 { get; set; }
|
||||
|
||||
// Run
|
||||
|
@ -225,6 +226,7 @@ namespace xharness
|
|||
SdkRoot = make_config ["XCODE_DEVELOPER_ROOT"];
|
||||
if (string.IsNullOrEmpty (SdkRoot94))
|
||||
SdkRoot94 = make_config ["XCODE94_DEVELOPER_ROOT"];
|
||||
MONO_SDK_DESTDIR = make_config ["MONO_SDK_DESTDIR"];
|
||||
}
|
||||
|
||||
void AutoConfigureMac ()
|
||||
|
|
|
@ -5,3 +5,6 @@
|
|||
!wrong-simd-missing-marshaldirective! System.IntPtr ARKit.ARPlaneGeometry::GetRawTextureCoordinates(): simd type: simd_float2
|
||||
!wrong-simd-missing-marshaldirective! System.IntPtr ARKit.ARPlaneGeometry::GetRawVertices(): simd type: simd_float3
|
||||
!wrong-simd-missing-marshaldirective! System.IntPtr ARKit.ARPointCloud::GetRawPoints(): simd type: simd_float3
|
||||
|
||||
# only exposed in subclasses (it's static but also abstract) - see https://github.com/xamarin/xamarin-macios/issues/5347
|
||||
!missing-selector! +ARConfiguration::supportedVideoFormats not bound
|
|
@ -1128,9 +1128,7 @@
|
|||
!missing-selector! +NSBezierPath::bezierPath not bound
|
||||
!missing-selector! +NSCursor::pop not bound
|
||||
!missing-selector! +NSInputManager::currentInputManager not bound
|
||||
!missing-selector! +NSOpenPanel::openPanel not bound
|
||||
!missing-selector! +NSPDFPanel::panel not bound
|
||||
!missing-selector! +NSSavePanel::savePanel not bound
|
||||
!missing-selector! +NSSound::soundUnfilteredFileTypes not bound
|
||||
!missing-selector! +NSSound::soundUnfilteredPasteboardTypes not bound
|
||||
!missing-selector! NSBezierPath::cachesBezierPath not bound
|
||||
|
|
|
@ -39,14 +39,27 @@ namespace BCLTestImporter {
|
|||
/// <param name="platform">The platform whose test directory we need.</param>
|
||||
/// <returns>The full path of the test directory.</returns>
|
||||
/// <exception cref="ArgumentNullException">Raised when one of the parameters is null.</exception>
|
||||
public static string GetTestDirectory (string monoRootPath, Platform platform)
|
||||
public static string GetTestDirectoryFromMonoPath (string monoRootPath, Platform platform)
|
||||
{
|
||||
if (monoRootPath == null)
|
||||
if (string.IsNullOrEmpty (monoRootPath))
|
||||
throw new ArgumentNullException (nameof (monoRootPath));
|
||||
var fullPath = monoRootPath;
|
||||
return Path.Combine (fullPath, partialPath, platformPathMatch[platform], "tests");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the directory from the downloads where tests can be found.
|
||||
/// </summary>
|
||||
/// <returns>The test directory from downloads path.</returns>
|
||||
/// <param name="downloadsPath">Downloads path.</param>
|
||||
/// <param name="platform">Platform whose tests we require.</param>
|
||||
public static string GetTestDirectoryFromDownloadsPath (string downloadsPath, Platform platform)
|
||||
{
|
||||
if (string.IsNullOrEmpty (downloadsPath))
|
||||
throw new ArgumentNullException (nameof (downloadsPath));
|
||||
return Path.Combine (downloadsPath, "ios-bcl", platformPathMatch [platform], "tests");
|
||||
}
|
||||
|
||||
public static string GetHintPathForRefenreceAssembly (string assembly, string monoRootPath, Platform plaform)
|
||||
{
|
||||
var hintPath = Path.Combine (monoRootPath, partialPath, platformPathMatch[plaform], $"{assembly}.dll");
|
||||
|
@ -56,9 +69,14 @@ namespace BCLTestImporter {
|
|||
/// <summary>
|
||||
/// Returns the path of the test assembly within the mono checkout.
|
||||
/// </summary>
|
||||
/// <param name="monoRootPath">The root path of the mono checkout.</param>
|
||||
/// <param name="rootPath">The root path of the mono checkout.</param>
|
||||
/// <param name="platform">The platform we are working with.</param>
|
||||
/// <returns>The full path of the assembly.</returns>
|
||||
public string GetPath (string monoRootPath, Platform platform) => Path.Combine (GetTestDirectory (monoRootPath, platform), Name);
|
||||
public string GetPath (string rootPath, Platform platform, bool wasDownloaded)
|
||||
{
|
||||
var testsRootPath = wasDownloaded? GetTestDirectoryFromDownloadsPath (rootPath, platform) :
|
||||
GetTestDirectoryFromMonoPath (rootPath, platform);
|
||||
return Path.Combine (testsRootPath, Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace BCLTestImporterTests {
|
|||
WriteJunk (plistTemplatePath);
|
||||
outputPath = Path.Combine (tmpPath, Path.GetRandomFileName());
|
||||
monoCheckout = Path.Combine (tmpPath, Path.GetRandomFileName());
|
||||
var testDir = BCLTestAssemblyDefinition.GetTestDirectory (monoCheckout, platform);
|
||||
var testDir = BCLTestAssemblyDefinition.GetTestDirectoryFromMonoPath (monoCheckout, platform);
|
||||
|
||||
if (Directory.Exists (testDir)) return;
|
||||
|
||||
|
|
|
@ -121,7 +121,7 @@ namespace BCLTestImporterTests {
|
|||
{
|
||||
var fixedPath = registerPath.Replace ("/", "\\");
|
||||
var sb = new StringBuilder ();
|
||||
sb.AppendLine ($"<Compile Include=\"{fixedPath}\">");
|
||||
sb.AppendLine ($"<Compile Include=\"{registerPath}\">");
|
||||
sb.AppendLine ($"<Link>{Path.GetFileName (registerPath)}</Link>");
|
||||
sb.AppendLine ("</Compile>");
|
||||
var expected = sb.ToString ();
|
||||
|
@ -140,7 +140,7 @@ namespace BCLTestImporterTests {
|
|||
Assert.Contains (projectName, generatedProject);
|
||||
Assert.DoesNotContain (BCLTestProjectGenerator.WatchOSTemplatePathKey, generatedProject);
|
||||
Assert.DoesNotContain (BCLTestProjectGenerator.PlistKey, generatedProject);
|
||||
Assert.Contains (plistPath.Replace ("/", "\\"), generatedProject);
|
||||
Assert.Contains (plistPath, generatedProject);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -13,7 +13,7 @@ namespace BCLTestImporterTests {
|
|||
public void GetPathNullMonoRoot ()
|
||||
{
|
||||
var testAssemblyDefinition = new BCLTestAssemblyDefinition ("MONOTOUCH_System.Json.Microsoft_test.dll");
|
||||
Assert.Throws<ArgumentNullException> (() => testAssemblyDefinition.GetPath (null, Platform.iOS));
|
||||
Assert.Throws<ArgumentNullException> (() => testAssemblyDefinition.GetPath (null, Platform.iOS, true));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
@ -36,7 +36,7 @@ namespace BCLTestImporterTests {
|
|||
var testAssemblyDefinition = new BCLTestAssemblyDefinition ("MONOTOUCH_System.Json.Microsoft_xunit-test.dll");
|
||||
var home = Environment.GetEnvironmentVariable ("HOME");
|
||||
var expectedPath = Path.Combine (home, "mcs/class/lib", "monotouch", "tests", testAssemblyDefinition.Name);
|
||||
Assert.Equal (expectedPath, testAssemblyDefinition.GetPath (Environment.GetEnvironmentVariable("HOME"), Platform.iOS));
|
||||
Assert.Equal (expectedPath, testAssemblyDefinition.GetPath (Environment.GetEnvironmentVariable("HOME"), Platform.iOS, false));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
@ -45,7 +45,7 @@ namespace BCLTestImporterTests {
|
|||
var testAssemblyDefinition = new BCLTestAssemblyDefinition ("MONOTOUCH_System.Json.Microsoft_xunit-test.dll");
|
||||
var home = Environment.GetEnvironmentVariable ("HOME");
|
||||
var expectedPath = Path.Combine (home, "mcs/class/lib", "monotouch", "tests", testAssemblyDefinition.Name);
|
||||
Assert.Equal (expectedPath, testAssemblyDefinition.GetPath (Environment.GetEnvironmentVariable("HOME"), Platform.TvOS));
|
||||
Assert.Equal (expectedPath, testAssemblyDefinition.GetPath (Environment.GetEnvironmentVariable("HOME"), Platform.TvOS, false));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
@ -53,8 +53,8 @@ namespace BCLTestImporterTests {
|
|||
{
|
||||
var testAssemblyDefinition = new BCLTestAssemblyDefinition ("MONOTOUCH_System.Json.Microsoft_xunit-test.dll");
|
||||
var home = Environment.GetEnvironmentVariable ("HOME");
|
||||
var expectedPath = Path.Combine (home, "mcs/class/lib", "monotouch_watch", "tests", testAssemblyDefinition.Name);
|
||||
Assert.Equal (expectedPath, testAssemblyDefinition.GetPath (Environment.GetEnvironmentVariable("HOME"), Platform.WatchOS));
|
||||
var expectedPath = Path.Combine (home, "mcs/class/lib", "monotouch", "tests", testAssemblyDefinition.Name);
|
||||
Assert.Equal (expectedPath, testAssemblyDefinition.GetPath (Environment.GetEnvironmentVariable("HOME"), Platform.WatchOS, false));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
@ -62,8 +62,8 @@ namespace BCLTestImporterTests {
|
|||
{
|
||||
var testAssemblyDefinition = new BCLTestAssemblyDefinition ("MONOTOUCH_System.Json.Microsoft_xunit-test.dll");
|
||||
var home = Environment.GetEnvironmentVariable ("HOME");
|
||||
var expectedPath = Path.Combine (home, "mcs/class/lib", "xammac", "tests", testAssemblyDefinition.Name);
|
||||
Assert.Equal (expectedPath, testAssemblyDefinition.GetPath (Environment.GetEnvironmentVariable("HOME"), Platform.MacOSFull));
|
||||
var expectedPath = Path.Combine (home, "mcs/class/lib", "xammac_net_4_5", "tests", testAssemblyDefinition.Name);
|
||||
Assert.Equal (expectedPath, testAssemblyDefinition.GetPath (Environment.GetEnvironmentVariable("HOME"), Platform.MacOSFull, false));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace BCLTestImporterTests {
|
|||
public void GetTypeForAssembliesNullMonoPath ()
|
||||
{
|
||||
var projectDefinition = new BCLTestProjectDefinition ("MyProject", new List<BCLTestAssemblyDefinition> ());
|
||||
Assert.Throws<ArgumentNullException> (() => projectDefinition.GetTypeForAssemblies (null, Platform.iOS));
|
||||
Assert.Throws<ArgumentNullException> (() => projectDefinition.GetTypeForAssemblies (null, Platform.iOS, true));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -65,24 +65,24 @@ namespace BCLTestImporter {
|
|||
/// Returns the assemblies that a referenced by the given test assembly.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
IEnumerable<string> GetProjectAssemblyReferences (string monoRootPath, Platform platform)
|
||||
IEnumerable<string> GetProjectAssemblyReferences (string rootPath, Platform platform, bool wasDownloaded)
|
||||
{
|
||||
var set = new HashSet<string> ();
|
||||
foreach (var definition in TestAssemblies) {
|
||||
foreach (var reference in GetAssemblyReferences (definition.GetPath (monoRootPath, platform))) {
|
||||
foreach (var reference in GetAssemblyReferences (definition.GetPath (rootPath, platform, wasDownloaded))) {
|
||||
set.Add (reference);
|
||||
}
|
||||
}
|
||||
return set;
|
||||
}
|
||||
|
||||
public Dictionary <string, Type> GetTypeForAssemblies (string monoRootPath, Platform platform) {
|
||||
public Dictionary <string, Type> GetTypeForAssemblies (string monoRootPath, Platform platform, bool wasDownloaded) {
|
||||
if (monoRootPath == null)
|
||||
throw new ArgumentNullException (nameof (monoRootPath));
|
||||
var dict = new Dictionary <string, Type> ();
|
||||
// loop over the paths, grab the assembly, find a type and then add it
|
||||
foreach (var definition in TestAssemblies) {
|
||||
var path = definition.GetPath (monoRootPath, platform);
|
||||
var path = definition.GetPath (monoRootPath, platform, wasDownloaded);
|
||||
var a = Assembly.LoadFile (path);
|
||||
try {
|
||||
var types = a.ExportedTypes;
|
||||
|
@ -111,17 +111,17 @@ namespace BCLTestImporter {
|
|||
/// <param name="platform">The platform we are working with.</param>
|
||||
/// <returns>The list of tuples (assembly name, path hint) for all the assemblies in the project.</returns>
|
||||
public List<(string assembly, string hintPath)> GetAssemblyInclusionInformation (string monoRootPath,
|
||||
Platform platform)
|
||||
Platform platform, bool wasDownloaded)
|
||||
{
|
||||
if (monoRootPath == null)
|
||||
throw new ArgumentNullException (nameof (monoRootPath));
|
||||
|
||||
return GetProjectAssemblyReferences (monoRootPath, platform).Select (
|
||||
return GetProjectAssemblyReferences (monoRootPath, platform, wasDownloaded).Select (
|
||||
a => (assembly: a,
|
||||
hintPath: BCLTestAssemblyDefinition.GetHintPathForRefenreceAssembly (a, monoRootPath, platform))).Union (
|
||||
TestAssemblies.Select (
|
||||
definition => (assembly: definition.Name,
|
||||
hintPath: definition.GetPath (monoRootPath, platform))))
|
||||
hintPath: definition.GetPath (monoRootPath, platform, wasDownloaded))))
|
||||
.ToList ();
|
||||
}
|
||||
|
||||
|
|
|
@ -9,134 +9,6 @@ namespace BCLTestImporter
|
|||
// Added for the workaround so that it does not make the code uglier
|
||||
public partial struct BCLTestProjectDefinition
|
||||
{
|
||||
static Dictionary<string, List<(string assembly, string hint)>> iOSCachedAssemblyInfo =
|
||||
new Dictionary<string, List<(string assembly, string hint)>>
|
||||
{
|
||||
{"SystemNumericsTests", new List<(string assembly, string hint)> {
|
||||
(assembly:"mscorlib", hint:"{MONO_ROOT}mcs/class/lib/monotouch/mscorlib.dll"),
|
||||
(assembly:"nunitlite", hint:"{MONO_ROOT}mcs/class/lib/monotouch/nunitlite.dll"),
|
||||
(assembly:"System.Numerics", hint:"{MONO_ROOT}mcs/class/lib/monotouch/System.Numerics.dll"),
|
||||
(assembly:"MONOTOUCH_System.Numerics_test.dll", hint:"{MONO_ROOT}mcs/class/lib/monotouch/tests/MONOTOUCH_System.Numerics_test.dll"),
|
||||
}},
|
||||
{"SystemRuntimeSerializationTests", new List<(string assembly, string hint)> {
|
||||
(assembly:"mscorlib", hint:"{MONO_ROOT}mcs/class/lib/monotouch/mscorlib.dll"),
|
||||
(assembly:"System.Runtime.Serialization", hint:"{MONO_ROOT}mcs/class/lib/monotouch/System.Runtime.Serialization.dll"),
|
||||
(assembly:"System.Core", hint:"{MONO_ROOT}mcs/class/lib/monotouch/System.Core.dll"),
|
||||
(assembly:"System", hint:"{MONO_ROOT}mcs/class/lib/monotouch/System.dll"),
|
||||
(assembly:"System.ServiceModel", hint:"{MONO_ROOT}mcs/class/lib/monotouch/System.ServiceModel.dll"),
|
||||
(assembly:"System.Xml", hint:"{MONO_ROOT}mcs/class/lib/monotouch/System.Xml.dll"),
|
||||
(assembly:"nunitlite", hint:"{MONO_ROOT}mcs/class/lib/monotouch/nunitlite.dll"),
|
||||
(assembly:"MONOTOUCH_System.Runtime.Serialization_test.dll", hint:"{MONO_ROOT}mcs/class/lib/monotouch/tests/MONOTOUCH_System.Runtime.Serialization_test.dll"),
|
||||
}},
|
||||
{"SystemXmlLinqTests", new List<(string assembly, string hint)> {
|
||||
(assembly:"mscorlib", hint:"{MONO_ROOT}mcs/class/lib/monotouch/mscorlib.dll"),
|
||||
(assembly:"nunitlite", hint:"{MONO_ROOT}mcs/class/lib/monotouch/nunitlite.dll"),
|
||||
(assembly:"System.Xml", hint:"{MONO_ROOT}mcs/class/lib/monotouch/System.Xml.dll"),
|
||||
(assembly:"System.Xml.Linq", hint:"{MONO_ROOT}mcs/class/lib/monotouch/System.Xml.Linq.dll"),
|
||||
(assembly:"System.Core", hint:"{MONO_ROOT}mcs/class/lib/monotouch/System.Core.dll"),
|
||||
(assembly:"MONOTOUCH_System.Xml.Linq_test.dll", hint:"{MONO_ROOT}mcs/class/lib/monotouch/tests/MONOTOUCH_System.Xml.Linq_test.dll"),
|
||||
}},
|
||||
{"MonoSecurityTests", new List<(string assembly, string hint)> {
|
||||
(assembly:"mscorlib", hint:"{MONO_ROOT}mcs/class/lib/monotouch/mscorlib.dll"),
|
||||
(assembly:"nunitlite", hint:"{MONO_ROOT}mcs/class/lib/monotouch/nunitlite.dll"),
|
||||
(assembly:"Mono.Security", hint:"{MONO_ROOT}mcs/class/lib/monotouch/Mono.Security.dll"),
|
||||
(assembly:"MONOTOUCH_Mono.Security_test.dll", hint:"{MONO_ROOT}mcs/class/lib/monotouch/tests/MONOTOUCH_Mono.Security_test.dll"),
|
||||
}},
|
||||
{"SystemComponentModelDataAnnotationTests", new List<(string assembly, string hint)> {
|
||||
(assembly:"mscorlib", hint:"{MONO_ROOT}mcs/class/lib/monotouch/mscorlib.dll"),
|
||||
(assembly:"nunitlite", hint:"{MONO_ROOT}mcs/class/lib/monotouch/nunitlite.dll"),
|
||||
(assembly:"System.ComponentModel.DataAnnotations", hint:"{MONO_ROOT}mcs/class/lib/monotouch/System.ComponentModel.DataAnnotations.dll"),
|
||||
(assembly:"System", hint:"{MONO_ROOT}mcs/class/lib/monotouch/System.dll"),
|
||||
(assembly:"MONOTOUCH_System.ComponentModel.DataAnnotations_test.dll", hint:"{MONO_ROOT}mcs/class/lib/monotouch/tests/MONOTOUCH_System.ComponentModel.DataAnnotations_test.dll"),
|
||||
}},
|
||||
{"SystemJsonTests", new List<(string assembly, string hint)> {
|
||||
(assembly:"mscorlib", hint:"{MONO_ROOT}mcs/class/lib/monotouch/mscorlib.dll"),
|
||||
(assembly:"nunitlite", hint:"{MONO_ROOT}mcs/class/lib/monotouch/nunitlite.dll"),
|
||||
(assembly:"System.Json", hint:"{MONO_ROOT}mcs/class/lib/monotouch/System.Json.dll"),
|
||||
(assembly:"MONOTOUCH_System.Json_test.dll", hint:"{MONO_ROOT}mcs/class/lib/monotouch/tests/MONOTOUCH_System.Json_test.dll"),
|
||||
}},
|
||||
{"MonoDataTdsTests", new List<(string assembly, string hint)> {
|
||||
(assembly:"mscorlib", hint:"{MONO_ROOT}mcs/class/lib/monotouch/mscorlib.dll"),
|
||||
(assembly:"nunitlite", hint:"{MONO_ROOT}mcs/class/lib/monotouch/nunitlite.dll"),
|
||||
(assembly:"System", hint:"{MONO_ROOT}mcs/class/lib/monotouch/System.dll"),
|
||||
(assembly:"Mono.Data.Tds", hint:"{MONO_ROOT}mcs/class/lib/monotouch/Mono.Data.Tds.dll"),
|
||||
(assembly:"MONOTOUCH_Mono.Data.Tds_test.dll", hint:"{MONO_ROOT}mcs/class/lib/monotouch/tests/MONOTOUCH_Mono.Data.Tds_test.dll"),
|
||||
}},
|
||||
{"MonoCSharpTests", new List<(string assembly, string hint)> {
|
||||
(assembly:"mscorlib", hint:"{MONO_ROOT}mcs/class/lib/monotouch/mscorlib.dll"),
|
||||
(assembly:"Mono.CSharp", hint:"{MONO_ROOT}mcs/class/lib/monotouch/Mono.CSharp.dll"),
|
||||
(assembly:"nunitlite", hint:"{MONO_ROOT}mcs/class/lib/monotouch/nunitlite.dll"),
|
||||
(assembly:"MONOTOUCH_Mono.CSharp_test.dll", hint:"{MONO_ROOT}mcs/class/lib/monotouch/tests/MONOTOUCH_Mono.CSharp_test.dll"),
|
||||
}},
|
||||
{"SystemJsonMicrosoftTests", new List<(string assembly, string hint)> {
|
||||
(assembly:"mscorlib", hint:"{MONO_ROOT}mcs/class/lib/monotouch/mscorlib.dll"),
|
||||
(assembly:"nunitlite", hint:"{MONO_ROOT}mcs/class/lib/monotouch/nunitlite.dll"),
|
||||
(assembly:"System.Json.Microsoft", hint:"{MONO_ROOT}mcs/class/lib/monotouch/System.Json.Microsoft.dll"),
|
||||
(assembly:"MONOTOUCH_System.Json.Microsoft_test.dll", hint:"{MONO_ROOT}mcs/class/lib/monotouch/tests/MONOTOUCH_System.Json.Microsoft_test.dll"),
|
||||
}},
|
||||
{"MonoParallelTests", new List<(string assembly, string hint)> {
|
||||
(assembly:"mscorlib", hint:"{MONO_ROOT}mcs/class/lib/monotouch/mscorlib.dll"),
|
||||
(assembly:"nunitlite", hint:"{MONO_ROOT}mcs/class/lib/monotouch/nunitlite.dll"),
|
||||
(assembly:"Mono.Parallel", hint:"{MONO_ROOT}mcs/class/lib/monotouch/Mono.Parallel.dll"),
|
||||
(assembly:"System.Core", hint:"{MONO_ROOT}mcs/class/lib/monotouch/System.Core.dll"),
|
||||
(assembly:"MONOTOUCH_Mono.Parallel_test.dll", hint:"{MONO_ROOT}mcs/class/lib/monotouch/tests/MONOTOUCH_Mono.Parallel_test.dll"),
|
||||
}},
|
||||
{"MonoTaskletsTests", new List<(string assembly, string hint)> {
|
||||
(assembly:"mscorlib", hint:"{MONO_ROOT}mcs/class/lib/monotouch/mscorlib.dll"),
|
||||
(assembly:"nunitlite", hint:"{MONO_ROOT}mcs/class/lib/monotouch/nunitlite.dll"),
|
||||
(assembly:"Mono.Tasklets", hint:"{MONO_ROOT}mcs/class/lib/monotouch/Mono.Tasklets.dll"),
|
||||
(assembly:"MONOTOUCH_Mono.Tasklets_test.dll", hint:"{MONO_ROOT}mcs/class/lib/monotouch/tests/MONOTOUCH_Mono.Tasklets_test.dll"),
|
||||
}},
|
||||
{"SystemThreadingTasksDataflowTests", new List<(string assembly, string hint)> {
|
||||
(assembly:"mscorlib", hint:"{MONO_ROOT}mcs/class/lib/monotouch/mscorlib.dll"),
|
||||
(assembly:"System.Threading.Tasks.Dataflow", hint:"{MONO_ROOT}mcs/class/lib/monotouch/System.Threading.Tasks.Dataflow.dll"),
|
||||
(assembly:"System.Core", hint:"{MONO_ROOT}mcs/class/lib/monotouch/System.Core.dll"),
|
||||
(assembly:"nunitlite", hint:"{MONO_ROOT}mcs/class/lib/monotouch/nunitlite.dll"),
|
||||
(assembly:"System", hint:"{MONO_ROOT}mcs/class/lib/monotouch/System.dll"),
|
||||
(assembly:"MONOTOUCH_System.Threading.Tasks.Dataflow_test.dll", hint:"{MONO_ROOT}mcs/class/lib/monotouch/tests/MONOTOUCH_System.Threading.Tasks.Dataflow_test.dll"),
|
||||
}},
|
||||
{"SystemJsonXunit", new List<(string assembly, string hint)> {
|
||||
(assembly:"mscorlib", hint:"{MONO_ROOT}mcs/class/lib/monotouch/mscorlib.dll"),
|
||||
(assembly:"xunit.core", hint:""),
|
||||
(assembly:"xunit.abstractions", hint:""),
|
||||
(assembly:"xunit.assert", hint:""),
|
||||
(assembly:"System.Json", hint:"{MONO_ROOT}mcs/class/lib/monotouch/System.Json.dll"),
|
||||
(assembly:"System", hint:"{MONO_ROOT}mcs/class/lib/monotouch/System.dll"),
|
||||
(assembly:"System.Core", hint:"{MONO_ROOT}mcs/class/lib/monotouch/System.Core.dll"),
|
||||
(assembly:"MONOTOUCH_System.Json_xunit-test.dll", hint:"{MONO_ROOT}mcs/class/lib/monotouch/tests/MONOTOUCH_System.Json_xunit-test.dll"),
|
||||
}},
|
||||
{"SystemNumericsXunit", new List<(string assembly, string hint)> {
|
||||
(assembly:"mscorlib", hint:"{MONO_ROOT}mcs/class/lib/monotouch/mscorlib.dll"),
|
||||
(assembly:"xunit.core", hint:""),
|
||||
(assembly:"xunit.abstractions", hint:""),
|
||||
(assembly:"xunit.assert", hint:""),
|
||||
(assembly:"System.Numerics", hint:"{MONO_ROOT}mcs/class/lib/monotouch/System.Numerics.dll"),
|
||||
(assembly:"System.Core", hint:"{MONO_ROOT}mcs/class/lib/monotouch/System.Core.dll"),
|
||||
(assembly:"Xunit.NetCore.Extensions", hint:""),
|
||||
(assembly:"Microsoft.CSharp", hint:"{MONO_ROOT}mcs/class/lib/monotouch/Microsoft.CSharp.dll"),
|
||||
(assembly:"MONOTOUCH_System.Numerics_xunit-test.dll", hint:"{MONO_ROOT}mcs/class/lib/monotouch/tests/MONOTOUCH_System.Numerics_xunit-test.dll"),
|
||||
}},
|
||||
{"SystemLinqXunit", new List<(string assembly, string hint)> {
|
||||
(assembly:"mscorlib", hint:"{MONO_ROOT}mcs/class/lib/monotouch/mscorlib.dll"),
|
||||
(assembly:"System.Xml", hint:"{MONO_ROOT}mcs/class/lib/monotouch/System.Xml.dll"),
|
||||
(assembly:"xunit.core", hint:""),
|
||||
(assembly:"xunit.abstractions", hint:""),
|
||||
(assembly:"System.Xml.Linq", hint:"{MONO_ROOT}mcs/class/lib/monotouch/System.Xml.Linq.dll"),
|
||||
(assembly:"Xunit.NetCore.Extensions", hint:""),
|
||||
(assembly:"System", hint:"{MONO_ROOT}mcs/class/lib/monotouch/System.dll"),
|
||||
(assembly:"xunit.assert", hint:""),
|
||||
(assembly:"System.Core", hint:"{MONO_ROOT}mcs/class/lib/monotouch/System.Core.dll"),
|
||||
(assembly:"MONOTOUCH_System.Xml.Linq_xunit-test.dll", hint:"{MONO_ROOT}mcs/class/lib/monotouch/tests/MONOTOUCH_System.Xml.Linq_xunit-test.dll"),
|
||||
}},
|
||||
{"SystemRuntimeCompilerServicesUnsafeXunit", new List<(string assembly, string hint)> {
|
||||
(assembly:"mscorlib", hint:"{MONO_ROOT}mcs/class/lib/monotouch/mscorlib.dll"),
|
||||
(assembly:"xunit.core", hint:""),
|
||||
(assembly:"xunit.abstractions", hint:""),
|
||||
(assembly:"System.Runtime.CompilerServices.Unsafe", hint:"{MONO_ROOT}mcs/class/lib/monotouch/System.Runtime.CompilerServices.Unsafe.dll"),
|
||||
(assembly:"xunit.assert", hint:""),
|
||||
(assembly:"MONOTOUCH_System.Runtime.CompilerServices.Unsafe_xunit-test.dll", hint:"{MONO_ROOT}mcs/class/lib/monotouch/tests/MONOTOUCH_System.Runtime.CompilerServices.Unsafe_xunit-test.dll"),
|
||||
}},
|
||||
};
|
||||
|
||||
private static Dictionary<string, List<(string assembly, string hint)>> macCachedAssemblyInfo =
|
||||
new Dictionary<string, List<(string assembly, string hint)>> {
|
||||
|
@ -441,8 +313,7 @@ namespace BCLTestImporter
|
|||
case Platform.iOS:
|
||||
case Platform.TvOS:
|
||||
case Platform.WatchOS:
|
||||
info = iOSCachedAssemblyInfo[Name];
|
||||
break;
|
||||
throw new InvalidOperationException ("All iOS platforms must used the dlls from the SDK and not build their own tests.");
|
||||
case Platform.MacOSFull:
|
||||
case Platform.MacOSModern:
|
||||
info = macCachedAssemblyInfo[Name];
|
||||
|
|
|
@ -14,11 +14,13 @@ namespace BCLTestImporter {
|
|||
/// </summary>
|
||||
public class BCLTestProjectGenerator {
|
||||
|
||||
static string NUnitPattern = "MONOTOUCH_*_test.dll";
|
||||
static string xUnitPattern = "MONOTOUCH_*_xunit-test.dll";
|
||||
static string NUnitPattern = "monotouch_*_test.dll";
|
||||
static string xUnitPattern = "monotouch_*_xunit-test.dll";
|
||||
static string iOSReleasePattern = "ios-release-Darwin-*";
|
||||
internal static readonly string NameKey = "%NAME%";
|
||||
internal static readonly string ReferencesKey = "%REFERENCES%";
|
||||
internal static readonly string RegisterTypeKey = "%REGISTER TYPE%";
|
||||
internal static readonly string ContentKey = "%CONTENT RESOURCES%";
|
||||
internal static readonly string PlistKey = "%PLIST PATH%";
|
||||
internal static readonly string WatchOSTemplatePathKey = "%TEMPLATE PATH%";
|
||||
internal static readonly string WatchOSCsporjAppKey = "%WATCH APP PROJECT PATH%";
|
||||
|
@ -67,6 +69,7 @@ namespace BCLTestImporter {
|
|||
"xunit.core",
|
||||
"xunit.abstractions",
|
||||
"xunit.assert",
|
||||
"Xunit.NetCore.Extensions",
|
||||
};
|
||||
|
||||
// we have two different types of list, those that are for the iOS like projects (ios, tvos and watch os) and those
|
||||
|
@ -74,75 +77,69 @@ namespace BCLTestImporter {
|
|||
static readonly List<(string name, string[] assemblies)> commoniOSTestProjects = new List<(string name, string[] assemblies)> {
|
||||
// NUNIT TESTS
|
||||
|
||||
(name:"SystemTests", assemblies: new[] {"MONOTOUCH_System_test.dll"}),
|
||||
(name:"SystemCoreTests", assemblies: new [] {"MONOTOUCH_System.Core_test.dll"}),
|
||||
(name:"SystemDataTests", assemblies: new [] {"MONOTOUCH_System.Data_test.dll"}),
|
||||
(name:"SystemNetHttpTests", assemblies: new [] {"MONOTOUCH_System.Net.Http_test.dll"}),
|
||||
(name:"SystemNumericsTests", assemblies: new [] {"MONOTOUCH_System.Numerics_test.dll"}),
|
||||
(name:"SystemRuntimeSerializationTests", assemblies: new [] {"MONOTOUCH_System.Runtime.Serialization_test.dll"}),
|
||||
(name:"SystemTransactionsTests", assemblies: new [] {"MONOTOUCH_System.Transactions_test.dll"}),
|
||||
(name:"SystemXmlTests", assemblies: new [] {"MONOTOUCH_System.Xml_test.dll"}),
|
||||
(name:"SystemXmlLinqTests", assemblies: new [] {"MONOTOUCH_System.Xml.Linq_test.dll"}),
|
||||
(name:"MonoSecurityTests", assemblies: new [] {"MONOTOUCH_Mono.Security_test.dll"}),
|
||||
(name:"SystemComponentModelDataAnnotationTests", assemblies: new [] {"MONOTOUCH_System.ComponentModel.DataAnnotations_test.dll"}),
|
||||
(name:"SystemJsonTests", assemblies: new [] {"MONOTOUCH_System.Json_test.dll"}),
|
||||
(name:"SystemServiceModelWebTests", assemblies: new [] {"MONOTOUCH_System.ServiceModel.Web_test.dll"}),
|
||||
(name:"MonoDataTdsTests", assemblies: new [] {"MONOTOUCH_Mono.Data.Tds_test.dll"}),
|
||||
(name:"SystemIOCompressionTests", assemblies: new [] {"MONOTOUCH_System.IO.Compression_test.dll"}),
|
||||
(name:"SystemIOCompressionFileSystemTests", assemblies: new [] {"MONOTOUCH_System.IO.Compression.FileSystem_test.dll"}),
|
||||
(name:"MonoCSharpTests", assemblies: new [] {"MONOTOUCH_Mono.CSharp_test.dll"}),
|
||||
(name:"SystemSecurityTests", assemblies: new [] {"MONOTOUCH_System.Security_test.dll"}),
|
||||
(name:"SystemServiceModelTests", assemblies: new [] {"MONOTOUCH_System.ServiceModel_test.dll"}),
|
||||
(name:"SystemJsonMicrosoftTests", assemblies: new [] {"MONOTOUCH_System.Json.Microsoft_test.dll"}),
|
||||
(name:"SystemDataDataSetExtensionTests", assemblies: new [] {"MONOTOUCH_System.Data.DataSetExtensions_test.dll"}),
|
||||
(name:"SystemRuntimeSerializationFormattersSoapTests", assemblies: new [] {"MONOTOUCH_System.Runtime.Serialization.Formatters.Soap_test.dll"}),
|
||||
(name:"CorlibTests", assemblies: new [] {"MONOTOUCH_corlib_test.dll"}),
|
||||
(name:"MonoParallelTests", assemblies: new [] {"MONOTOUCH_Mono.Parallel_test.dll"}),
|
||||
(name:"MonoRuntimeTests", assemblies: new [] {"MONOTOUCH_Mono.Runtime.Tests_test.dll"}),
|
||||
(name:"MonoTaskletsTests", assemblies: new [] {"MONOTOUCH_Mono.Tasklets_test.dll"}),
|
||||
(name:"SystemThreadingTasksDataflowTests", assemblies: new [] {"MONOTOUCH_System.Threading.Tasks.Dataflow_test.dll"}),
|
||||
(name:"SystemTests", assemblies: new[] {"monotouch_System_test.dll"}),
|
||||
(name:"SystemCoreTests", assemblies: new [] {"monotouch_System.Core_test.dll"}),
|
||||
(name:"SystemDataTests", assemblies: new [] {"monotouch_System.Data_test.dll"}),
|
||||
(name:"SystemNetHttpTests", assemblies: new [] {"monotouch_System.Net.Http_test.dll"}),
|
||||
(name:"SystemNumericsTests", assemblies: new [] {"monotouch_System.Numerics_test.dll"}),
|
||||
(name:"SystemRuntimeSerializationTests", assemblies: new [] {"monotouch_System.Runtime.Serialization_test.dll"}),
|
||||
(name:"SystemTransactionsTests", assemblies: new [] {"monotouch_System.Transactions_test.dll"}),
|
||||
(name:"SystemXmlTests", assemblies: new [] {"monotouch_System.Xml_test.dll"}),
|
||||
(name:"SystemXmlLinqTests", assemblies: new [] {"monotouch_System.Xml.Linq_test.dll"}),
|
||||
(name:"MonoSecurityTests", assemblies: new [] {"monotouch_Mono.Security_test.dll"}),
|
||||
(name:"SystemComponentModelDataAnnotationTests", assemblies: new [] {"monotouch_System.ComponentModel.DataAnnotations_test.dll"}),
|
||||
(name:"SystemJsonTests", assemblies: new [] {"monotouch_System.Json_test.dll"}),
|
||||
(name:"SystemServiceModelWebTests", assemblies: new [] {"monotouch_System.ServiceModel.Web_test.dll"}),
|
||||
(name:"MonoDataTdsTests", assemblies: new [] {"monotouch_Mono.Data.Tds_test.dll"}),
|
||||
(name:"SystemIOCompressionTests", assemblies: new [] {"monotouch_System.IO.Compression_test.dll"}),
|
||||
(name:"SystemIOCompressionFileSystemTests", assemblies: new [] {"monotouch_System.IO.Compression.FileSystem_test.dll"}),
|
||||
(name:"MonoCSharpTests", assemblies: new [] {"monotouch_Mono.CSharp_test.dll"}),
|
||||
(name:"SystemSecurityTests", assemblies: new [] {"monotouch_System.Security_test.dll"}),
|
||||
(name:"SystemServiceModelTests", assemblies: new [] {"monotouch_System.ServiceModel_test.dll"}),
|
||||
(name:"SystemDataDataSetExtensionTests", assemblies: new [] {"monotouch_System.Data.DataSetExtensions_test.dll"}),
|
||||
(name:"SystemRuntimeSerializationFormattersSoapTests", assemblies: new [] {"monotouch_System.Runtime.Serialization.Formatters.Soap_test.dll"}),
|
||||
(name:"CorlibTests", assemblies: new [] {"monotouch_corlib_test.dll"}),
|
||||
(name:"MonoRuntimeTests", assemblies: new [] {"monotouch_Mono.Runtime.Tests_test.dll"}),
|
||||
|
||||
// XUNIT TESTS
|
||||
|
||||
(name:"SystemDataXunit", assemblies: new [] {"MONOTOUCH_System.Data_xunit-test.dll"}),
|
||||
(name:"SystemJsonXunit", assemblies: new [] {"MONOTOUCH_System.Json_xunit-test.dll"}),
|
||||
(name:"SystemNumericsXunit", assemblies: new [] {"MONOTOUCH_System.Numerics_xunit-test.dll"}),
|
||||
(name:"SystemSecurityXunit", assemblies: new [] {"MONOTOUCH_System.Security_xunit-test.dll"}),
|
||||
(name:"SystemThreadingTaskXunit", assemblies: new [] {"MONOTOUCH_System.Threading.Tasks.Dataflow_xunit-test.dll"}),
|
||||
(name:"SystemLinqXunit", assemblies: new [] {"MONOTOUCH_System.Xml.Linq_xunit-test.dll"}),
|
||||
(name:"SystemRuntimeCompilerServicesUnsafeXunit", assemblies: new [] {"MONOTOUCH_System.Runtime.CompilerServices.Unsafe_xunit-test.dll"}),
|
||||
(name:"SystemDataXunit", assemblies: new [] {"monotouch_System.Data_xunit-test.dll"}),
|
||||
(name:"SystemJsonXunit", assemblies: new [] {"monotouch_System.Json_xunit-test.dll"}),
|
||||
(name:"SystemNumericsXunit", assemblies: new [] {"monotouch_System.Numerics_xunit-test.dll"}),
|
||||
(name:"SystemSecurityXunit", assemblies: new [] {"monotouch_System.Security_xunit-test.dll"}),
|
||||
(name:"SystemThreadingTaskXunit", assemblies: new [] {"monotouch_System.Threading.Tasks.Dataflow_xunit-test.dll"}),
|
||||
(name:"SystemLinqXunit", assemblies: new [] {"monotouch_System.Xml.Linq_xunit-test.dll"}),
|
||||
(name:"SystemRuntimeCompilerServicesUnsafeXunit", assemblies: new [] {"monotouch_System.Runtime.CompilerServices.Unsafe_xunit-test.dll"}),
|
||||
};
|
||||
|
||||
static readonly List <string> CommonIgnoredAssemblies = new List <string> {
|
||||
"MONOTOUCH_System.Data_xunit-test.dll", // issue https://github.com/xamarin/maccore/issues/1131
|
||||
"MONOTOUCH_System.Security_xunit-test.dll",// issue https://github.com/xamarin/maccore/issues/1128
|
||||
"MONOTOUCH_System.Threading.Tasks.Dataflow_xunit-test.dll", // issue https://github.com/xamarin/maccore/issues/1132
|
||||
"MONOTOUCH_System.Xml_test.dll", // issue https://github.com/xamarin/maccore/issues/1133
|
||||
"MONOTOUCH_System.Transactions_test.dll", // issue https://github.com/xamarin/maccore/issues/1134
|
||||
"MONOTOUCH_System_test.dll", // issues https://github.com/xamarin/maccore/issues/1135
|
||||
"MONOTOUCH_System.ServiceModel.Web_test.dll", // issue https://github.com/xamarin/maccore/issues/1137
|
||||
"MONOTOUCH_System.ServiceModel_test.dll", // issue https://github.com/xamarin/maccore/issues/1138
|
||||
"MONOTOUCH_System.Security_test.dll", // issue https://github.com/xamarin/maccore/issues/1139
|
||||
"MONOTOUCH_System.Runtime.Serialization.Formatters.Soap_test.dll", // issue https://github.com/xamarin/maccore/issues/1140
|
||||
"MONOTOUCH_System.Net.Http_test.dll", // issue https://github.com/xamarin/maccore/issues/1144 and https://github.com/xamarin/maccore/issues/1145
|
||||
"MONOTOUCH_System.IO.Compression_test.dll", // issue https://github.com/xamarin/maccore/issues/1146
|
||||
"MONOTOUCH_System.IO.Compression.FileSystem_test.dll", // issue https://github.com/xamarin/maccore/issues/1147 and https://github.com/xamarin/maccore/issues/1148
|
||||
"MONOTOUCH_System.Data_test.dll", // issue https://github.com/xamarin/maccore/issues/1149
|
||||
"MONOTOUCH_System.Data.DataSetExtensions_test.dll", // issue https://github.com/xamarin/maccore/issues/1150 and https://github.com/xamarin/maccore/issues/1151
|
||||
"MONOTOUCH_System.Core_test.dll", // issue https://github.com/xamarin/maccore/issues/1143
|
||||
"MONOTOUCH_Mono.Runtime.Tests_test.dll", // issue https://github.com/xamarin/maccore/issues/1141
|
||||
"MONOTOUCH_corlib_test.dll", // issue https://github.com/xamarin/maccore/issues/1153
|
||||
"MONOTOUCH_Commons.Xml.Relaxng_test.dll", // not supported by xamarin
|
||||
"MONOTOUCH_Cscompmgd_test.dll", // not supported by xamarin
|
||||
"MONOTOUCH_I18N.CJK_test.dll",
|
||||
"MONOTOUCH_I18N.MidEast_test.dll",
|
||||
"MONOTOUCH_I18N.Other_test.dll",
|
||||
"MONOTOUCH_I18N.Rare_test.dll",
|
||||
"MONOTOUCH_I18N.West_test.dll",
|
||||
"MONOTOUCH_Mono.C5_test.dll", // not supported by xamarin
|
||||
"MONOTOUCH_Mono.CodeContracts_test.dll", // not supported by xamarin
|
||||
"MONOTOUCH_Novell.Directory.Ldap_test.dll", // not supported by xamarin
|
||||
"MONOTOUCH_Mono.Profiler.Log_xunit-test.dll", // special tests that need an extra app to connect as a profiler
|
||||
"monotouch_System.Security_xunit-test.dll",// issue https://github.com/xamarin/maccore/issues/1128
|
||||
"monotouch_System.Threading.Tasks.Dataflow_xunit-test.dll", // issue https://github.com/xamarin/maccore/issues/1132
|
||||
"monotouch_System.Xml_test.dll", // issue https://github.com/xamarin/maccore/issues/1133
|
||||
"monotouch_System.Transactions_test.dll", // issue https://github.com/xamarin/maccore/issues/1134
|
||||
"monotouch_System_test.dll", // issues https://github.com/xamarin/maccore/issues/1135
|
||||
"monotouch_System.ServiceModel_test.dll", // issue https://github.com/xamarin/maccore/issues/1138
|
||||
"monotouch_System.Security_test.dll", // issue https://github.com/xamarin/maccore/issues/1139
|
||||
"monotouch_System.Runtime.Serialization.Formatters.Soap_test.dll", // issue https://github.com/xamarin/maccore/issues/1140
|
||||
"monotouch_System.Net.Http_test.dll", // issue https://github.com/xamarin/maccore/issues/1144 and https://github.com/xamarin/maccore/issues/1145
|
||||
"monotouch_System.IO.Compression_test.dll", // issue https://github.com/xamarin/maccore/issues/1146
|
||||
"monotouch_System.IO.Compression.FileSystem_test.dll", // issue https://github.com/xamarin/maccore/issues/1147 and https://github.com/xamarin/maccore/issues/1148
|
||||
"monotouch_System.Data_test.dll", // issue https://github.com/xamarin/maccore/issues/1149
|
||||
"monotouch_System.Data.DataSetExtensions_test.dll", // issue https://github.com/xamarin/maccore/issues/1150 and https://github.com/xamarin/maccore/issues/1151
|
||||
"monotouch_System.Core_test.dll", // issue https://github.com/xamarin/maccore/issues/1143
|
||||
"monotouch_Mono.Runtime.Tests_test.dll", // issue https://github.com/xamarin/maccore/issues/1141
|
||||
"monotouch_corlib_test.dll", // issue https://github.com/xamarin/maccore/issues/1153
|
||||
"monotouch_Commons.Xml.Relaxng_test.dll", // not supported by xamarin
|
||||
"monotouch_Cscompmgd_test.dll", // not supported by xamarin
|
||||
"monotouch_I18N.CJK_test.dll",
|
||||
"monotouch_I18N.MidEast_test.dll",
|
||||
"monotouch_I18N.Other_test.dll",
|
||||
"monotouch_I18N.Rare_test.dll",
|
||||
"monotouch_I18N.West_test.dll",
|
||||
"monotouch_Mono.C5_test.dll", // not supported by xamarin
|
||||
"monotouch_Mono.CodeContracts_test.dll", // not supported by xamarin
|
||||
"monotouch_Novell.Directory.Ldap_test.dll", // not supported by xamarin
|
||||
"monotouch_Mono.Profiler.Log_xunit-test.dll", // special tests that need an extra app to connect as a profiler
|
||||
};
|
||||
|
||||
// list of assemblies that are going to be ignored, any project with an assemblies that is ignored will
|
||||
|
@ -151,15 +148,14 @@ namespace BCLTestImporter {
|
|||
static readonly List<string> iOSIgnoredAssemblies = new List<string> {};
|
||||
|
||||
static readonly List<string> tvOSIgnoredAssemblies = new List<string> {
|
||||
"MONOTOUCH_System.Xml.Linq_xunit-test.dll", // issue https://github.com/xamarin/maccore/issues/1130
|
||||
"MONOTOUCH_System.Numerics_xunit-test.dll", // issue https://github.com/xamarin/maccore/issues/1129
|
||||
"monotouch_System.Xml.Linq_xunit-test.dll", // issue https://github.com/xamarin/maccore/issues/1130
|
||||
"monotouch_System.Numerics_xunit-test.dll", // issue https://github.com/xamarin/maccore/issues/1129
|
||||
};
|
||||
|
||||
static readonly List<string> watcOSIgnoredAssemblies = new List<string> {
|
||||
"MONOTOUCH_System.Xml.Linq_xunit-test.dll", // issue https://github.com/xamarin/maccore/issues/1130
|
||||
"MONOTOUCH_System.Numerics_xunit-test.dll", // issue https://github.com/xamarin/maccore/issues/1129
|
||||
"MONOTOUCH_Mono.Security_test.dll", // issue https://github.com/xamarin/maccore/issues/1142
|
||||
"MONOTOUCH_Mono.Data.Tds_test.dll", // issue https://gist.github.com/mandel-macaque/d97fa28f8a73c3016d1328567da77a0b
|
||||
"monotouch_System.Xml.Linq_xunit-test.dll", // issue https://github.com/xamarin/maccore/issues/1130
|
||||
"monotouch_System.Numerics_xunit-test.dll", // issue https://github.com/xamarin/maccore/issues/1129
|
||||
"monotouch_Mono.Security_test.dll", // issue https://github.com/xamarin/maccore/issues/1142
|
||||
};
|
||||
|
||||
private static readonly List<(string name, string[] assemblies)> macTestProjects = new List<(string name, string[] assemblies)> {
|
||||
|
@ -237,6 +233,7 @@ namespace BCLTestImporter {
|
|||
public bool Override { get; set; }
|
||||
public string OutputDirectoryPath { get; private set; }
|
||||
public string MonoRootPath { get; private set; }
|
||||
public string iOSMonoSDKPath { get; set; }
|
||||
public string ProjectTemplateRootPath { get; private set; }
|
||||
public string PlistTemplateRootPath{ get; private set; }
|
||||
public string RegisterTypesTemplatePath { get; private set; }
|
||||
|
@ -260,6 +257,22 @@ namespace BCLTestImporter {
|
|||
RegisterTypesTemplatePath = registerTypesTemplatePath ?? throw new ArgumentNullException (nameof (registerTypesTemplatePath));
|
||||
}
|
||||
|
||||
string GetReleaseDownload (Platform platform)
|
||||
{
|
||||
switch (platform) {
|
||||
case Platform.iOS:
|
||||
case Platform.TvOS:
|
||||
case Platform.WatchOS:
|
||||
// simply, try to find the dir with the pattern
|
||||
return iOSMonoSDKPath;
|
||||
case Platform.MacOSFull:
|
||||
case Platform.MacOSModern:
|
||||
return null;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the path to be used to store the project file depending on the platform.
|
||||
/// </summary>
|
||||
|
@ -353,6 +366,48 @@ namespace BCLTestImporter {
|
|||
return sb.ToString ();
|
||||
}
|
||||
|
||||
internal static string GetContentNode (string resourcePath)
|
||||
{
|
||||
var sb = new StringBuilder ();
|
||||
sb.AppendLine ($"<Content Include=\"{resourcePath}\">");
|
||||
sb.AppendLine ($"<Link>{Path.GetFileName (resourcePath)}</Link>");
|
||||
sb.AppendLine ("<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>");
|
||||
sb.AppendLine ("</Content>");
|
||||
return sb.ToString ();
|
||||
}
|
||||
|
||||
internal static string GetCommonIgnoreFileName (string projectName) => $"common-{projectName}.ignore";
|
||||
|
||||
internal static string GetIgnoreFileName (string projectName, Platform platform)
|
||||
{
|
||||
switch (platform) {
|
||||
case Platform.iOS:
|
||||
return $"iOS-{projectName}.ignore";
|
||||
case Platform.MacOSFull:
|
||||
case Platform.MacOSModern:
|
||||
return $"macOS-{projectName}.ignore";
|
||||
case Platform.TvOS:
|
||||
return $"tvOS-{projectName}.ignore";
|
||||
case Platform.WatchOS:
|
||||
return $"watchOS-{projectName}.ignore";
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
internal static IEnumerable<string> GetIgnoreFiles (string templatePath, string projectName, Platform platform)
|
||||
{
|
||||
// check if the common and plaform paths can be found in the template path, if they are, we return them
|
||||
var templateDir = Path.GetDirectoryName (templatePath);
|
||||
var commonIgnore = Path.Combine (templateDir, GetCommonIgnoreFileName (projectName));
|
||||
if (File.Exists (commonIgnore))
|
||||
yield return commonIgnore;
|
||||
var platformIgnore = Path.Combine (templateDir, GetIgnoreFileName (projectName, platform));
|
||||
if (File.Exists (platformIgnore))
|
||||
yield return platformIgnore;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns is a project should be ignored in a platform. A project is ignored in one of the assemblies in the
|
||||
/// project is ignored in the platform.
|
||||
|
@ -401,8 +456,9 @@ namespace BCLTestImporter {
|
|||
Directory.CreateDirectory (generatedCodeDir);
|
||||
}
|
||||
var registerTypePath = Path.Combine (generatedCodeDir, "RegisterType.cs");
|
||||
var registerCode = await RegisterTypeGenerator.GenerateCodeAsync (def.name, projectDefinition.IsXUnit,
|
||||
RegisterTypesTemplatePath, Platform.WatchOS);
|
||||
var typesPerAssembly = projectDefinition.GetTypeForAssemblies (GetReleaseDownload (Platform.iOS), Platform.WatchOS, true);
|
||||
var registerCode = await RegisterTypeGenerator.GenerateCodeAsync (typesPerAssembly,
|
||||
projectDefinition.IsXUnit, RegisterTypesTemplatePath);
|
||||
using (var file = new StreamWriter (registerTypePath, false)) { // false is do not append
|
||||
await file.WriteAsync (registerCode);
|
||||
}
|
||||
|
@ -424,7 +480,7 @@ namespace BCLTestImporter {
|
|||
generatedProject = await GenerateWatchAppAsync (projectDefinition.Name, projetTemplate, data.plist);
|
||||
break;
|
||||
default:
|
||||
generatedProject = await GenerateWatchExtensionAsync (projectDefinition.Name, projetTemplate, data.plist, registerTypePath, projectDefinition.GetCachedAssemblyInclusionInformation (MonoRootPath, Platform.WatchOS));
|
||||
generatedProject = await GenerateWatchExtensionAsync (projectDefinition.Name, projetTemplate, data.plist, registerTypePath, projectDefinition.GetAssemblyInclusionInformation (GetReleaseDownload (Platform.WatchOS), Platform.WatchOS, true));
|
||||
break;
|
||||
}
|
||||
data.project = GetProjectPath (projectDefinition.Name, appType);
|
||||
|
@ -478,9 +534,10 @@ namespace BCLTestImporter {
|
|||
}
|
||||
var registerTypePath = Path.Combine (generatedCodeDir, "RegisterType.cs");
|
||||
|
||||
var registerCode = await RegisterTypeGenerator.GenerateCodeAsync (def.name, projectDefinition.IsXUnit,
|
||||
RegisterTypesTemplatePath, Platform.iOS);
|
||||
|
||||
var typesPerAssembly = projectDefinition.GetTypeForAssemblies (GetReleaseDownload (Platform.iOS), Platform.iOS, true);
|
||||
var registerCode = await RegisterTypeGenerator.GenerateCodeAsync (typesPerAssembly,
|
||||
projectDefinition.IsXUnit, RegisterTypesTemplatePath);
|
||||
|
||||
using (var file = new StreamWriter (registerTypePath, false)) { // false is do not append
|
||||
await file.WriteAsync (registerCode);
|
||||
}
|
||||
|
@ -494,7 +551,7 @@ namespace BCLTestImporter {
|
|||
|
||||
var projectTemplatePath = Path.Combine (ProjectTemplateRootPath, projectTemplateMatches[platform]);
|
||||
var generatedProject = await GenerateAsync (projectDefinition.Name, registerTypePath,
|
||||
projectDefinition.GetCachedAssemblyInclusionInformation (MonoRootPath, platform), projectTemplatePath, infoPlistPath);
|
||||
projectDefinition.GetAssemblyInclusionInformation (GetReleaseDownload (platform), platform, true), projectTemplatePath, infoPlistPath, platform);
|
||||
var projectPath = GetProjectPath (projectDefinition.Name, platform);
|
||||
projectPaths.Add ((name: projectDefinition.Name, path: projectPath, xunit: projectDefinition.IsXUnit));
|
||||
using (var file = new StreamWriter (projectPath, false)) { // false is do not append
|
||||
|
@ -564,6 +621,7 @@ namespace BCLTestImporter {
|
|||
result = await GenerateWatchOSTestProjectsAsync (projects, generatedDir);
|
||||
break;
|
||||
case Platform.iOS:
|
||||
case Platform.TvOS:
|
||||
result = await GenerateiOSTestProjectsAsync (projects, platform, generatedDir);
|
||||
break;
|
||||
case Platform.MacOSFull:
|
||||
|
@ -647,7 +705,7 @@ namespace BCLTestImporter {
|
|||
/// <param name="templatePath">A path to the template used to generate the path.</param>
|
||||
/// <param name="infoPlistPath">The path to the info plist of the project.</param>
|
||||
/// <returns></returns>
|
||||
static async Task<string> GenerateAsync (string projectName, string registerPath, List<(string assembly, string hintPath)> info, string templatePath, string infoPlistPath)
|
||||
static async Task<string> GenerateAsync (string projectName, string registerPath, List<(string assembly, string hintPath)> info, string templatePath, string infoPlistPath, Platform platform)
|
||||
{
|
||||
// fix possible issues with the paths to be included in the msbuild xml
|
||||
infoPlistPath = infoPlistPath.Replace ('/', '\\');
|
||||
|
@ -656,6 +714,11 @@ namespace BCLTestImporter {
|
|||
if (!excludeDlls.Contains (assemblyInfo.assembly))
|
||||
sb.AppendLine (GetReferenceNode (assemblyInfo.assembly, assemblyInfo.hintPath));
|
||||
}
|
||||
|
||||
var contentFiles = new StringBuilder ();
|
||||
foreach (var path in GetIgnoreFiles (templatePath, projectName, platform)) {
|
||||
contentFiles.Append (GetContentNode (path));
|
||||
}
|
||||
|
||||
using (var reader = new StreamReader(templatePath)) {
|
||||
var result = await reader.ReadToEndAsync ();
|
||||
|
@ -663,6 +726,7 @@ namespace BCLTestImporter {
|
|||
result = result.Replace (ReferencesKey, sb.ToString ());
|
||||
result = result.Replace (RegisterTypeKey, GetRegisterTypeNode (registerPath));
|
||||
result = result.Replace (PlistKey, infoPlistPath);
|
||||
result = result.Replace (ContentKey, contentFiles.ToString ());
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
@ -676,12 +740,17 @@ namespace BCLTestImporter {
|
|||
sb.AppendLine (GetReferenceNode (assemblyInfo.assembly, assemblyInfo.hintPath));
|
||||
}
|
||||
|
||||
var contentFiles = new StringBuilder ();
|
||||
foreach (var path in GetIgnoreFiles (templatePath, projectName, platform)) {
|
||||
contentFiles.Append (GetContentNode (path));
|
||||
}
|
||||
using (var reader = new StreamReader(templatePath)) {
|
||||
var result = await reader.ReadToEndAsync ();
|
||||
result = result.Replace (NameKey, projectName);
|
||||
result = result.Replace (ReferencesKey, sb.ToString ());
|
||||
result = result.Replace (RegisterTypeKey, GetRegisterTypeNode (registerPath));
|
||||
result = result.Replace (PlistKey, infoPlistPath);
|
||||
result = result.Replace (ContentKey, contentFiles.ToString ());
|
||||
switch (platform){
|
||||
case Platform.MacOSFull:
|
||||
result = result.Replace (TargetFrameworkVersionKey, "v4.5");
|
||||
|
@ -729,6 +798,11 @@ namespace BCLTestImporter {
|
|||
sb.AppendLine (GetReferenceNode (assemblyInfo.assembly, assemblyInfo.hintPath));
|
||||
}
|
||||
|
||||
var contentFiles = new StringBuilder ();
|
||||
foreach (var path in GetIgnoreFiles (templatePath, projectName, Platform.WatchOS)) {
|
||||
contentFiles.Append (GetContentNode (path));
|
||||
}
|
||||
|
||||
using (var reader = new StreamReader(templatePath)) {
|
||||
var result = await reader.ReadToEndAsync ();
|
||||
result = result.Replace (NameKey, projectName);
|
||||
|
@ -736,12 +810,13 @@ namespace BCLTestImporter {
|
|||
result = result.Replace (PlistKey, infoPlistPath);
|
||||
result = result.Replace (RegisterTypeKey, GetRegisterTypeNode (registerPath));
|
||||
result = result.Replace (ReferencesKey, sb.ToString ());
|
||||
result = result.Replace (ContentKey, contentFiles.ToString ());
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
public static string Generate (string projectName, string registerPath, List<(string assembly, string hintPath)> info, string templatePath, string infoPlistPath) =>
|
||||
GenerateAsync (projectName, registerPath, info, templatePath, infoPlistPath).Result;
|
||||
public static string Generate (string projectName, string registerPath, List<(string assembly, string hintPath)> info, string templatePath, string infoPlistPath, Platform platform) =>
|
||||
GenerateAsync (projectName, registerPath, info, templatePath, infoPlistPath, platform).Result;
|
||||
|
||||
/// <summary>
|
||||
/// Removes all the generated files by the tool.
|
||||
|
@ -773,11 +848,12 @@ namespace BCLTestImporter {
|
|||
/// </summary>
|
||||
/// <param name="missingAssemblies"></param>
|
||||
/// <returns></returns>
|
||||
public bool AllTestAssembliesAreRan (out Dictionary<Platform, List<string>> missingAssemblies)
|
||||
public bool AllTestAssembliesAreRan (out Dictionary<Platform, List<string>> missingAssemblies, bool wasDownloaded)
|
||||
{
|
||||
missingAssemblies = new Dictionary<Platform, List<string>> ();
|
||||
foreach (var platform in new [] {Platform.iOS, Platform.TvOS}) {
|
||||
var testDir = BCLTestAssemblyDefinition.GetTestDirectory (MonoRootPath, platform);
|
||||
var testDir = wasDownloaded ? BCLTestAssemblyDefinition.GetTestDirectoryFromMonoPath (MonoRootPath, platform)
|
||||
: BCLTestAssemblyDefinition.GetTestDirectoryFromDownloadsPath (GetReleaseDownload (platform), platform);
|
||||
var missingAssembliesPlatform = Directory.GetFiles (testDir, NUnitPattern).Select (Path.GetFileName).Union (
|
||||
Directory.GetFiles (testDir, xUnitPattern).Select (Path.GetFileName)).ToList ();
|
||||
|
||||
|
|
|
@ -200,7 +200,7 @@ namespace BCLTestImporter {
|
|||
var projectGenerator = new BCLTestProjectGenerator (appOptions.Output, appOptions.MonoPath,
|
||||
appOptions.ProjectTemplate, appOptions.RegisterTypeTemplate, appOptions.PlistTemplate);
|
||||
outputWriter.WriteLine ("Verifying if all the test assemblies have been added.");
|
||||
if (!appOptions.IgnoreMissingAssemblies && !projectGenerator.AllTestAssembliesAreRan (out var missingAssemblies)) {
|
||||
if (!appOptions.IgnoreMissingAssemblies && !projectGenerator.AllTestAssembliesAreRan (out var missingAssemblies, true)) {
|
||||
outputWriter.WriteLine ("The following test assemblies should be added to a test project or ignored.");
|
||||
foreach (var platform in missingAssemblies.Keys) {
|
||||
outputWriter.WriteLine ($"Platform {platform}");
|
||||
|
|
|
@ -15,25 +15,6 @@ namespace BCLTestImporter {
|
|||
|
||||
// the following cache is a workaround until mono does provide the required binaries precompiled, at that point
|
||||
// we will remove the dict and we will use the refection based method.
|
||||
static Dictionary<string, (string testNamespace, string testAssembly, string testType)> iOSCache = new Dictionary<string, (string testNamespace, string testAssembly, string testType)> {
|
||||
{"SystemNumericsTests", ("MonoTests.System.Numerics", "MONOTOUCH_System.Numerics_test.dll", "MonoTests.System.Numerics.BigIntegerTest")},
|
||||
{"SystemRuntimeSerializationTests", ("MonoTests", "MONOTOUCH_System.Runtime.Serialization_test.dll", "MonoTests.XmlComparer")},
|
||||
{"SystemXmlLinqTests", ("MonoTests.System.Xml", "MONOTOUCH_System.Xml.Linq_test.dll", "MonoTests.System.Xml.ExtensionsTest")},
|
||||
{"MonoSecurityTests", ("MonoTests.System.Security.Cryptography", "MONOTOUCH_Mono.Security_test.dll", "MonoTests.System.Security.Cryptography.SHA224ManagedTest")},
|
||||
{"SystemComponentModelDataAnnotationTests", ("MonoTests.System.ComponentModel.DataAnnotations", "MONOTOUCH_System.ComponentModel.DataAnnotations_test.dll", "MonoTests.System.ComponentModel.DataAnnotations.AssociationAttributeTest")},
|
||||
{"SystemJsonTests", ("MonoTests.System", "MONOTOUCH_System.Json_test.dll", "MonoTests.System.JsonValueTests")},
|
||||
{"MonoDataTdsTests", ("MonoTests.Mono.Data.Tds", "MONOTOUCH_Mono.Data.Tds_test.dll", "MonoTests.Mono.Data.Tds.TdsConnectionPoolTest")},
|
||||
{"MonoCSharpTests", ("MonoTests.Visit", "MONOTOUCH_Mono.CSharp_test.dll", "MonoTests.Visit.ASTVisitorTest")},
|
||||
{"SystemJsonMicrosoftTests", ("MonoTests.System", "MONOTOUCH_System.Json.Microsoft_test.dll", "MonoTests.System.JsonValueTests")},
|
||||
{"MonoParallelTests", ("MonoTests.Mono.Threading", "MONOTOUCH_Mono.Parallel_test.dll", "MonoTests.Mono.Threading.SnziTests")},
|
||||
{"MonoTaskletsTests", ("MonoTests.System", "MONOTOUCH_Mono.Tasklets_test.dll", "MonoTests.System.ContinuationsTest")},
|
||||
{"SystemThreadingTasksDataflowTests", ("MonoTests", "MONOTOUCH_System.Threading.Tasks.Dataflow_test.dll", "MonoTests.TestScheduler")},
|
||||
{"SystemJsonXunit", ("System.Json.Tests", "MONOTOUCH_System.Json_xunit-test.dll", "System.Json.Tests.JsonArrayTests")},
|
||||
{"SystemNumericsXunit", ("System.Numerics.Tests", "MONOTOUCH_System.Numerics_xunit-test.dll", "System.Numerics.Tests.GenericVectorTests")},
|
||||
{"SystemLinqXunit", ("Microsoft.Test.ModuleCore", "MONOTOUCH_System.Xml.Linq_xunit-test.dll", "Microsoft.Test.ModuleCore.LtmContext")},
|
||||
{"SystemRuntimeCompilerServicesUnsafeXunit", ("System.Runtime.CompilerServices", "MONOTOUCH_System.Runtime.CompilerServices.Unsafe_xunit-test.dll", "System.Runtime.CompilerServices.UnsafeTests")},
|
||||
};
|
||||
|
||||
static Dictionary<string, (string testNamespace, string testAssembly, string testType)> macCache = new Dictionary<string, (string testNamespace, string testAssembly, string testType)> {
|
||||
{"MonoCSharpTests", ("MonoTests.Visit", "xammac_net_4_5_Mono.CSharp_test.dll", "MonoTests.Visit.ASTVisitorTest")},
|
||||
{"MonoDataSqilteTests", ("MonoTests.Mono.Data.Sqlite", "xammac_net_4_5_Mono.Data.Sqlite_test.dll", "MonoTests.Mono.Data.Sqlite.SqliteiOS82BugTests")},
|
||||
|
@ -77,8 +58,7 @@ namespace BCLTestImporter {
|
|||
case Platform.iOS:
|
||||
case Platform.TvOS:
|
||||
case Platform.WatchOS:
|
||||
cache = iOSCache;
|
||||
break;
|
||||
throw new InvalidOperationException ("All iOS projects should be using the sdk test assemblies and not compile them.");
|
||||
case Platform.MacOSFull:
|
||||
case Platform.MacOSModern:
|
||||
cache = macCache;
|
||||
|
|
|
@ -4750,7 +4750,7 @@ namespace Registrar {
|
|||
|
||||
sb.WriteLine (native_return_type);
|
||||
sb.Write (name);
|
||||
sb.Write (" (", method.Name);
|
||||
sb.Write (" (");
|
||||
for (int i = first_parameter; i < method.Parameters.Count; i++) {
|
||||
if (i > first_parameter)
|
||||
sb.Write (", ");
|
||||
|
@ -4760,6 +4760,11 @@ namespace Registrar {
|
|||
}
|
||||
sb.WriteLine (")");
|
||||
sb.WriteLine ("{");
|
||||
if (is_stret) {
|
||||
sb.StringBuilder.AppendLine ("#if defined (__arm64__)");
|
||||
sb.WriteLine ("xamarin_process_managed_exception ((MonoObject *) mono_exception_from_name_msg (mono_get_corlib (), \"System\", \"EntryPointNotFoundException\", \"{0}\"));", pinfo.EntryPoint);
|
||||
sb.StringBuilder.AppendLine ("#else");
|
||||
}
|
||||
sb.WriteLine ("@try {");
|
||||
if (!isVoid || is_stret)
|
||||
sb.Write ("return ");
|
||||
|
@ -4773,6 +4778,8 @@ namespace Registrar {
|
|||
sb.WriteLine ("} @catch (NSException *exc) {");
|
||||
sb.WriteLine ("xamarin_process_nsexception (exc);");
|
||||
sb.WriteLine ("}");
|
||||
if (is_stret)
|
||||
sb.StringBuilder.AppendLine ("#endif /* defined (__arm64__) */");
|
||||
sb.WriteLine ("}");
|
||||
sb.WriteLine ();
|
||||
} else {
|
||||
|
|
|
@ -1923,6 +1923,9 @@ namespace Xamarin.Bundler {
|
|||
continue;
|
||||
} else if (line.Contains ("was built for newer iOS version (5.1.1) than being linked (5.1)")) {
|
||||
continue;
|
||||
} else if (line.Contains ("was built for newer iOS version (7.0) than being linked (6.0)") &&
|
||||
line.Contains (Driver.GetProductSdkDirectory (target.App))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (line.Contains ("Undefined symbols for architecture")) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче