[autoformat] Add msbuild tests. (#16717)

This commit is contained in:
Rolf Bjarne Kvinge 2022-11-14 08:58:59 +01:00 коммит произвёл GitHub
Родитель 6905e0b176
Коммит 3b839e1551
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
61 изменённых файлов: 243 добавлений и 330 удалений

Просмотреть файл

@ -8,11 +8,9 @@ using NUnit.Framework;
using Xamarin.Tests;
using System.Linq;
namespace Xamarin.MacDev.Tasks
{
namespace Xamarin.MacDev.Tasks {
[TestFixture]
public class FrameworkListTests
{
public class FrameworkListTests {
[TestCase ("Xamarin.iOS-FrameworkList.xml.in")]
[TestCase ("Xamarin.TVOS-FrameworkList.xml.in")]
[TestCase ("Xamarin.WatchOS-FrameworkList.xml.in")]
@ -23,7 +21,7 @@ namespace Xamarin.MacDev.Tasks
Configuration.AssertLegacyXamarinAvailable ();
var fameworkListFileParts = frameworkListFile.Split ('-');
string frameworkName = fameworkListFileParts[0];
string frameworkName = fameworkListFileParts [0];
switch (frameworkName) {
case "Xamarin.iOS":
if (!Configuration.include_ios)
@ -43,7 +41,7 @@ namespace Xamarin.MacDev.Tasks
break;
}
var isMac = frameworkName == "Xamarin.Mac";
var isFull = fameworkListFileParts[1] == "Full";
var isFull = fameworkListFileParts [1] == "Full";
var frameworkListAssemblies = ScanFrameworkListXml (frameworkListFile, isMac);
var installedAssemblies = ScanAssemblyDirectory (frameworkName, isMac, isFull);
@ -149,8 +147,7 @@ namespace Xamarin.MacDev.Tasks
}
}
class AssemblyInfo
{
class AssemblyInfo {
public string Name;
public string Version;
@ -181,7 +178,8 @@ namespace Xamarin.MacDev.Tasks
PublicKeyToken = fn.Substring (i, j - i);
}
public bool Equals (AssemblyInfo other) {
public bool Equals (AssemblyInfo other)
{
// ignore Culture and InGac for equality since those are not mentioned in the FrameworkList.xml
return other.Name == this.Name &&
other.Version == this.Version &&

Просмотреть файл

@ -7,10 +7,8 @@ using NUnit.Framework;
using Xamarin.iOS.Tasks;
namespace Xamarin.MacDev.Tasks
{
class CustomBTouchTask : BTouch
{
namespace Xamarin.MacDev.Tasks {
class CustomBTouchTask : BTouch {
public string GetCommandLineCommands ()
{
return base.GenerateCommandLineCommands ();
@ -18,15 +16,14 @@ namespace Xamarin.MacDev.Tasks
}
[TestFixture]
public class BTouchTaskTests : TestBase
{
public class BTouchTaskTests : TestBase {
[Test]
public void StandardCommandline ()
{
var task = CreateTask<CustomBTouchTask> ();
task.ApiDefinitions = new[] { new TaskItem ("apidefinition.cs") };
task.References = new[] { new TaskItem ("a.dll"), new TaskItem ("b.dll"), new TaskItem ("c.dll") };
task.ApiDefinitions = new [] { new TaskItem ("apidefinition.cs") };
task.References = new [] { new TaskItem ("a.dll"), new TaskItem ("b.dll"), new TaskItem ("c.dll") };
task.ResponseFilePath = Path.Combine (Cache.CreateTemporaryDirectory (), "response-file.txt");
var args = task.GetCommandLineCommands () + " " + File.ReadAllText (task.ResponseFilePath);
@ -40,8 +37,8 @@ namespace Xamarin.MacDev.Tasks
{
var task = CreateTask<CustomBTouchTask> ();
task.ApiDefinitions = new[] { new TaskItem ("apidefinition.cs") };
task.References = new[] { new TaskItem ("a.dll"), new TaskItem ("b.dll"), new TaskItem ("c.dll") };
task.ApiDefinitions = new [] { new TaskItem ("apidefinition.cs") };
task.References = new [] { new TaskItem ("a.dll"), new TaskItem ("b.dll"), new TaskItem ("c.dll") };
task.ProjectDir = "~/"; // not important, but required (so can't be null)
task.ResponseFilePath = Path.Combine (Cache.CreateTemporaryDirectory (), "response-file.txt");

Просмотреть файл

@ -10,10 +10,8 @@ using Xamarin.MacDev;
#nullable enable
namespace Xamarin.MacDev.Tasks
{
class CustomCompileEntitlements : CompileEntitlements
{
namespace Xamarin.MacDev.Tasks {
class CustomCompileEntitlements : CompileEntitlements {
protected override MobileProvision? GetMobileProvision (MobileProvisionPlatform platform, string uuid)
{
if (File.Exists (ProvisioningProfile))
@ -24,8 +22,7 @@ namespace Xamarin.MacDev.Tasks
}
[TestFixture]
public class CompileEntitlementsTaskTests : TestBase
{
public class CompileEntitlementsTaskTests : TestBase {
CustomCompileEntitlements CreateEntitlementsTask (out string compiledEntitlements)
{
var task = CreateTask<CustomCompileEntitlements> ();
@ -73,7 +70,7 @@ namespace Xamarin.MacDev.Tasks
if (value is not null)
dict ["Value"] = value;
var customEntitlements = new TaskItem[] {
var customEntitlements = new TaskItem [] {
new TaskItem ("com.xamarin.custom.entitlement", dict)
};
var task = CreateEntitlementsTask (out var compiledEntitlements);
@ -93,7 +90,7 @@ namespace Xamarin.MacDev.Tasks
{ "Type", "String" },
{ "Value", value },
};
var customEntitlements = new TaskItem[] {
var customEntitlements = new TaskItem [] {
new TaskItem ("com.xamarin.custom.entitlement", dict)
};
var task = CreateEntitlementsTask (out var compiledEntitlements);
@ -134,14 +131,14 @@ namespace Xamarin.MacDev.Tasks
{ "Value", $"A;B;C{separator}D{separator}E" },
{ "ArraySeparator", separator },
};
var customEntitlements = new TaskItem[] {
var customEntitlements = new TaskItem [] {
new TaskItem ("com.xamarin.custom.entitlement", dict)
};
var task = CreateEntitlementsTask(out var compiledEntitlements);
var task = CreateEntitlementsTask (out var compiledEntitlements);
task.TargetFrameworkMoniker = ".NETCoreApp,Version=v6.0,Profile=maccatalyst";
task.CustomEntitlements = customEntitlements;
ExecuteTask(task);
var compiled = PDictionary.FromFile(compiledEntitlements);
ExecuteTask (task);
var compiled = PDictionary.FromFile (compiledEntitlements);
var array = compiled.GetArray ("com.xamarin.custom.entitlement");
Assert.NotNull (array, "array");
Assert.AreEqual (new string [] { "A;B;C", "D", "E" }, array.ToStringArray (), "array contents");
@ -160,28 +157,28 @@ namespace Xamarin.MacDev.Tasks
[Test]
public void AllowJit_True ()
{
var customEntitlements = new TaskItem[] {
var customEntitlements = new TaskItem [] {
new TaskItem ("com.apple.security.cs.allow-jit", new Dictionary<string, string> { { "Type", "Boolean" }, { "Value", "true" } }),
};
var task = CreateEntitlementsTask (out var compiledEntitlements);
task.TargetFrameworkMoniker = ".NETCoreApp,Version=v6.0,Profile=maccatalyst";
task.CustomEntitlements = customEntitlements;
ExecuteTask (task);
var compiled = PDictionary.FromFile(compiledEntitlements);
var compiled = PDictionary.FromFile (compiledEntitlements);
Assert.IsTrue (compiled.ContainsKey (EntitlementKeys.AllowExecutionOfJitCode), "#1");
Assert.IsTrue (compiled.Get<PBoolean>(EntitlementKeys.AllowExecutionOfJitCode).Value, "#2");
Assert.IsTrue (compiled.Get<PBoolean> (EntitlementKeys.AllowExecutionOfJitCode).Value, "#2");
}
[Test]
public void AllowJit_False ()
{
var customEntitlements = new TaskItem[] {
var customEntitlements = new TaskItem [] {
new TaskItem ("com.apple.security.cs.allow-jit", new Dictionary<string, string> { { "Type", "Boolean" }, { "Value", "false" } }),
};
var task = CreateEntitlementsTask(out var compiledEntitlements);
var task = CreateEntitlementsTask (out var compiledEntitlements);
task.TargetFrameworkMoniker = ".NETCoreApp,Version=v6.0,Profile=maccatalyst";
task.CustomEntitlements = customEntitlements;
ExecuteTask(task);
ExecuteTask (task);
var compiled = PDictionary.FromFile (compiledEntitlements);
Assert.IsTrue (compiled.ContainsKey (EntitlementKeys.AllowExecutionOfJitCode), "#1");
Assert.IsFalse (compiled.Get<PBoolean> (EntitlementKeys.AllowExecutionOfJitCode).Value, "#2");
@ -190,14 +187,14 @@ namespace Xamarin.MacDev.Tasks
[Test]
public void AllowJit_None ()
{
var customEntitlements = new TaskItem[] {
var customEntitlements = new TaskItem [] {
new TaskItem ("com.apple.security.cs.allow-jit", new Dictionary<string, string> { { "Type", "Remove" } }),
};
var task = CreateEntitlementsTask(out var compiledEntitlements);
var task = CreateEntitlementsTask (out var compiledEntitlements);
task.TargetFrameworkMoniker = ".NETCoreApp,Version=v6.0,Profile=maccatalyst";
task.CustomEntitlements = customEntitlements;
ExecuteTask(task);
var compiled = PDictionary.FromFile(compiledEntitlements);
ExecuteTask (task);
var compiled = PDictionary.FromFile (compiledEntitlements);
Assert.IsFalse (compiled.ContainsKey (EntitlementKeys.AllowExecutionOfJitCode), "#1");
}

Просмотреть файл

@ -510,7 +510,7 @@ namespace Xamarin.MacDev.Tasks {
Environment.CurrentDirectory = currentDir;
}
}
void VerifyCodesigningResults (CodesignInfo [] infos, ITaskItem[] outputCodesignItems, ApplePlatform platform)
void VerifyCodesigningResults (CodesignInfo [] infos, ITaskItem [] outputCodesignItems, ApplePlatform platform)
{
Assert.That (outputCodesignItems.Select (v => v.ItemSpec), Is.Unique, "Uniqueness");

Просмотреть файл

@ -150,7 +150,7 @@ namespace Xamarin.MacDev.Tasks {
Assert.AreEqual (manifest, File.ReadAllText (Path.Combine (directory, "manifest")), "Manifest");
}
ITaskItem[] CreateNativeReferences (string tmpdir, bool symlinks)
ITaskItem [] CreateNativeReferences (string tmpdir, bool symlinks)
{
var rv = new List<ITaskItem> ();

Просмотреть файл

@ -7,11 +7,9 @@ using Xamarin.iOS.Tasks;
using Xamarin.Tests;
namespace Xamarin.MacDev.Tasks
{
namespace Xamarin.MacDev.Tasks {
[TestFixture]
public class DetectSdkLocationsTaskTests : TestBase
{
public class DetectSdkLocationsTaskTests : TestBase {
[Test]
public void InvalidXamarinSdkRoot ()
{

Просмотреть файл

@ -76,8 +76,7 @@ namespace Xamarin.MacDev.Tasks {
</dict>
</plist>";
public class EntitlementTestCase
{
public class EntitlementTestCase {
public string Name = string.Empty;
public string Entitlements = string.Empty;
public bool Required;
@ -90,9 +89,9 @@ namespace Xamarin.MacDev.Tasks {
}
}
static EntitlementTestCase[] GetEntitlementsTestCases ()
static EntitlementTestCase [] GetEntitlementsTestCases ()
{
return new EntitlementTestCase[]
return new EntitlementTestCase []
{
new EntitlementTestCase { Name = nameof (EmptyEntitlements1), Entitlements = EmptyEntitlements1, Required = false, IsSimulator = true },
new EntitlementTestCase { Name = nameof (EmptyEntitlements2), Entitlements = EmptyEntitlements2, Required = false, IsSimulator = true },

Просмотреть файл

@ -11,11 +11,9 @@ using Xamarin.MacDev.Tasks;
using Xamarin.Tests;
using Xamarin.Utils;
namespace Xamarin.MacDev.Tasks
{
namespace Xamarin.MacDev.Tasks {
[TestFixture]
public abstract class GeneratePlistTaskTests_Core : TestBase
{
public abstract class GeneratePlistTaskTests_Core : TestBase {
protected const string appBundleName = "BundleName";
protected const string assemblyName = "AssemblyName";
protected const string bundleIdentifier = "DefaultIdentifier";

Просмотреть файл

@ -5,12 +5,10 @@ using Xamarin.MacDev;
using Xamarin.Tests;
using Xamarin.Utils;
namespace Xamarin.MacDev.Tasks
{
namespace Xamarin.MacDev.Tasks {
[TestFixture (true)]
[TestFixture (false)]
public class GeneratePlistTaskTests_iOS : GeneratePlistTaskTests_Core
{
public class GeneratePlistTaskTests_iOS : GeneratePlistTaskTests_Core {
protected override ApplePlatform Platform => ApplePlatform.iOS;
public GeneratePlistTaskTests_iOS (bool isDotNet)

Просмотреть файл

@ -1,12 +1,10 @@
using NUnit.Framework;
using Xamarin.MacDev;
namespace Xamarin.MacDev.Tasks
{
namespace Xamarin.MacDev.Tasks {
[TestFixture (true)]
[TestFixture (false)]
public class GeneratePlistTaskTests_iOS_AppExtension : GeneratePlistTaskTests_iOS
{
public class GeneratePlistTaskTests_iOS_AppExtension : GeneratePlistTaskTests_iOS {
public GeneratePlistTaskTests_iOS_AppExtension (bool isDotNet)
: base (isDotNet)
{

Просмотреть файл

@ -4,12 +4,10 @@ using Xamarin.MacDev;
using Xamarin.Tests;
using Xamarin.Utils;
namespace Xamarin.MacDev.Tasks
{
namespace Xamarin.MacDev.Tasks {
[TestFixture (true)]
[TestFixture (false)]
public class GeneratePlistTaskTests_tvOS : GeneratePlistTaskTests_Core
{
public class GeneratePlistTaskTests_tvOS : GeneratePlistTaskTests_Core {
protected override ApplePlatform Platform => ApplePlatform.TVOS;
public GeneratePlistTaskTests_tvOS (bool isDotNet)
@ -23,7 +21,7 @@ namespace Xamarin.MacDev.Tasks
base.ConfigureTask (isDotNet);
Task.DefaultSdkVersion = Sdks.TVOS.GetClosestInstalledSdk (AppleSdkVersion.V9_0, true).ToString ();
Task.TargetFrameworkMoniker = isDotNet ? TargetFramework.DotNet_tvOS_String : TargetFramework.Xamarin_TVOS_1_0.ToString ();
Task.TargetFrameworkMoniker = isDotNet ? TargetFramework.DotNet_tvOS_String : TargetFramework.Xamarin_TVOS_1_0.ToString ();
}
}
}

Просмотреть файл

@ -4,12 +4,10 @@ using Xamarin.MacDev;
using Xamarin.Tests;
using Xamarin.Utils;
namespace Xamarin.MacDev.Tasks
{
namespace Xamarin.MacDev.Tasks {
[TestFixture (true)]
[TestFixture (false)]
public abstract class GeneratePlistTaskTests_watchOS: GeneratePlistTaskTests_Core
{
public abstract class GeneratePlistTaskTests_watchOS : GeneratePlistTaskTests_Core {
protected override ApplePlatform Platform => ApplePlatform.WatchOS;
public GeneratePlistTaskTests_watchOS (bool isDotNet)

Просмотреть файл

@ -1,11 +1,9 @@
using NUnit.Framework;
namespace Xamarin.MacDev.Tasks
{
namespace Xamarin.MacDev.Tasks {
[TestFixture (true)]
[TestFixture (false)]
public class GeneratePlistTaskTests_watchOS_WatchKitApp : GeneratePlistTaskTests_watchOS
{
public class GeneratePlistTaskTests_watchOS_WatchKitApp : GeneratePlistTaskTests_watchOS {
public GeneratePlistTaskTests_watchOS_WatchKitApp (bool isDotNet)
: base (isDotNet)
{

Просмотреть файл

@ -2,12 +2,10 @@ using System.Linq;
using NUnit.Framework;
using Xamarin.MacDev;
namespace Xamarin.MacDev.Tasks
{
namespace Xamarin.MacDev.Tasks {
[TestFixture (true)]
[TestFixture (false)]
public class GeneratePlistTaskTests_watchOS_WatchKitExtension : GeneratePlistTaskTests_watchOS
{
public class GeneratePlistTaskTests_watchOS_WatchKitExtension : GeneratePlistTaskTests_watchOS {
public GeneratePlistTaskTests_watchOS_WatchKitExtension (bool isDotNet)
: base (isDotNet)
{

Просмотреть файл

@ -4,11 +4,9 @@ using NUnit.Framework;
using Xamarin.MacDev.Tasks;
namespace Xamarin.MacDev.Tasks
{
namespace Xamarin.MacDev.Tasks {
[TestFixture]
public class GetBundleNameTaskTests : TestBase
{
public class GetBundleNameTaskTests : TestBase {
[Test]
public void GetBundleName_MissingName ()
{

Просмотреть файл

@ -13,11 +13,9 @@ using Xamarin.MacDev.Tasks;
using Xamarin.Tests;
using Xamarin.Utils;
namespace Xamarin.MacDev.Tasks
{
namespace Xamarin.MacDev.Tasks {
[TestFixture]
public class IBToolTaskTests : TestBase
{
public class IBToolTaskTests : TestBase {
IBTool CreateIBToolTask (ApplePlatform framework, string projectDir, string intermediateOutputPath)
{
var interfaceDefinitions = new List<ITaskItem> ();
@ -158,7 +156,7 @@ namespace Xamarin.MacDev.Tasks
Assert.That (unexpectedResource, Is.Empty, "No extra resources");
}
IBTool CreateIBToolTask (ApplePlatform framework, string projectDir, string intermediateOutputPath, params string[] fileNames)
IBTool CreateIBToolTask (ApplePlatform framework, string projectDir, string intermediateOutputPath, params string [] fileNames)
{
var ibtool = CreateIBToolTask (framework, projectDir, intermediateOutputPath);
var interfaceDefinitions = new List<ITaskItem> ();
@ -171,7 +169,7 @@ namespace Xamarin.MacDev.Tasks
return ibtool;
}
void TestGenericAndDeviceSpecificXibsGeneric (params string[] fileNames)
void TestGenericAndDeviceSpecificXibsGeneric (params string [] fileNames)
{
var tmp = Cache.CreateTemporaryDirectory ("advanced-ibtool");
IBTool ibtool;

Просмотреть файл

@ -44,8 +44,8 @@ namespace Xamarin.MacDev.Tasks {
Assert.IsFalse (task.Execute (), "Execute failure");
Assert.AreEqual (1, Engine.Logger.ErrorEvents.Count, "ErrorCount");
bool isTranslated = Engine.Logger.ErrorEvents[0].Message.Contains (errorMessage);
Assert.IsTrue (isTranslated, $"Should contain \"{errorMessage}\", but instead has value: \"{Engine.Logger.ErrorEvents[0].Message}\"");
bool isTranslated = Engine.Logger.ErrorEvents [0].Message.Contains (errorMessage);
Assert.IsTrue (isTranslated, $"Should contain \"{errorMessage}\", but instead has value: \"{Engine.Logger.ErrorEvents [0].Message}\"");
} finally {
Thread.CurrentThread.CurrentUICulture = originalUICulture;
Thread.CurrentThread.CurrentCulture = originalCulture;
@ -78,7 +78,7 @@ namespace Xamarin.MacDev.Tasks {
string newCultureError = TranslateError (culture, errorCode);
Assert.AreNotEqual (englishError, newCultureError, $"\"{errorCode}\" is not translated in {culture}.");
} catch (NullReferenceException){
} catch (NullReferenceException) {
Assert.Fail ($"Error code \"{errorCode}\" was not found");
} finally {
Thread.CurrentThread.CurrentUICulture = originalUICulture;

Просмотреть файл

@ -10,10 +10,8 @@ using NUnit.Framework;
using Xamarin.iOS.Tasks;
using Xamarin.MacDev;
namespace Xamarin.MacDev.Tasks
{
class CustomMTouchTask : MTouch
{
namespace Xamarin.MacDev.Tasks {
class CustomMTouchTask : MTouch {
public CustomMTouchTask ()
{
Architectures = "Default";
@ -26,7 +24,7 @@ namespace Xamarin.MacDev.Tasks
SdkIsSimulator = true;
UseLlvm = false;
UseThumb = false;
AppExtensionReferences = new Microsoft.Build.Framework.ITaskItem[] { };
AppExtensionReferences = new Microsoft.Build.Framework.ITaskItem [] { };
}
public string ResponseFile = "";
@ -47,8 +45,7 @@ namespace Xamarin.MacDev.Tasks
}
[TestFixture]
public class MTouchTaskTests : TestBase
{
public class MTouchTaskTests : TestBase {
CustomMTouchTask Task {
get; set;
}
@ -141,7 +138,7 @@ namespace Xamarin.MacDev.Tasks
[Test]
public void StandardCommandline_WithBitcodeEnabled_iOS ()
{
MTouchEnableBitcode("Xamarin.iOS");
MTouchEnableBitcode ("Xamarin.iOS");
var ex = Assert.Throws<InvalidOperationException> (() => Task.GenerateCommandLineCommands (), "Exception");
Assert.AreEqual ("Bitcode is currently not supported on iOS.", ex.Message, "Message");
@ -150,7 +147,7 @@ namespace Xamarin.MacDev.Tasks
[Test]
public void StandardCommandline_WithBitcodeEnabled_watchOS ()
{
MTouchEnableBitcode("Xamarin.WatchOS");
MTouchEnableBitcode ("Xamarin.WatchOS");
var args = Task.GenerateCommandLineCommands ();
Assert.IsTrue (Task.ResponseFile.Contains ("--bitcode=full"));
@ -159,7 +156,7 @@ namespace Xamarin.MacDev.Tasks
[Test]
public void StandardCommandline_WithBitcodeEnabled_tvOS ()
{
MTouchEnableBitcode("Xamarin.TVOS");
MTouchEnableBitcode ("Xamarin.TVOS");
var args = Task.GenerateCommandLineCommands ();
Assert.IsTrue (Task.ResponseFile.Contains ("--bitcode=asmonly"));
@ -211,14 +208,14 @@ namespace Xamarin.MacDev.Tasks
}
[Test]
public void ReferenceFrameworkFileResolution_WhenReceivedReferencePathExists()
public void ReferenceFrameworkFileResolution_WhenReceivedReferencePathExists ()
{
using (var sdk = new TempSdk()) {
using (var sdk = new TempSdk ()) {
Task.TargetFrameworkMoniker = "MonoTouch,v1.0";
var expectedPath = Path.Combine (Cache.CreateTemporaryDirectory (), "tmpfile");
Task.References = new[] { new TaskItem (expectedPath, new Dictionary<string, string> { { "FrameworkFile", "true" } }) };
Task.References = new [] { new TaskItem (expectedPath, new Dictionary<string, string> { { "FrameworkFile", "true" } }) };
var args = Task.GenerateCommandLineCommands ();
@ -237,16 +234,16 @@ namespace Xamarin.MacDev.Tasks
Assert.IsTrue (args.Contains ($"@{Task.ResponseFilePath}"), "#@response-file");
}
[TestCase("Xamarin.iOS,v1.0", "Xamarin.iOS")]
public void ReferenceFrameworkFileResolution_WhenFacadeFileExists(string targetFrameworkMoniker, string frameworkDir)
[TestCase ("Xamarin.iOS,v1.0", "Xamarin.iOS")]
public void ReferenceFrameworkFileResolution_WhenFacadeFileExists (string targetFrameworkMoniker, string frameworkDir)
{
using (var sdk = new TempSdk()) {
using (var sdk = new TempSdk ()) {
Task.TargetFrameworkMoniker = targetFrameworkMoniker;
var expectedPath = Path.Combine (Sdks.XamIOS.LibDir, "mono", frameworkDir, "Facades", "System.Collections.dll");
Directory.CreateDirectory (Path.GetDirectoryName (expectedPath));
File.WriteAllText (expectedPath, "");
Task.References = new[] { new TaskItem ("System.Collections.dll", new Dictionary<string, string> { { "FrameworkFile", "true" } }) };
Task.References = new [] { new TaskItem ("System.Collections.dll", new Dictionary<string, string> { { "FrameworkFile", "true" } }) };
var args = Task.GenerateCommandLineCommands ();
@ -254,7 +251,7 @@ namespace Xamarin.MacDev.Tasks
// In Windows, the path slashes are escaped.
expectedPath = expectedPath.Replace ("\\", "\\\\");
Assert.IsTrue (Task.ResponseFile.Contains (expectedPath), string.Format(
Assert.IsTrue (Task.ResponseFile.Contains (expectedPath), string.Format (
@"Failed to resolve facade assembly to the Sdk path.
Expected path:{0}
@ -262,16 +259,16 @@ namespace Xamarin.MacDev.Tasks
}
}
[TestCase("Xamarin.iOS,v1.0", "Xamarin.iOS")]
public void ReferenceFrameworkFileResolution_WhenFrameworkFileExists(string targetFrameworkMoniker, string frameworkDir)
[TestCase ("Xamarin.iOS,v1.0", "Xamarin.iOS")]
public void ReferenceFrameworkFileResolution_WhenFrameworkFileExists (string targetFrameworkMoniker, string frameworkDir)
{
using (var sdk = new TempSdk()) {
using (var sdk = new TempSdk ()) {
Task.TargetFrameworkMoniker = targetFrameworkMoniker;
var expectedPath = Path.Combine (Sdks.XamIOS.LibDir, "mono", frameworkDir, "System.Collections.dll");
Directory.CreateDirectory (Path.GetDirectoryName (expectedPath));
File.WriteAllText (expectedPath, "");
Task.References = new[] { new TaskItem ("System.Collections.dll", new Dictionary<string, string> { { "FrameworkFile", "true" } }) };
Task.References = new [] { new TaskItem ("System.Collections.dll", new Dictionary<string, string> { { "FrameworkFile", "true" } }) };
var args = Task.GenerateCommandLineCommands ();
@ -279,7 +276,7 @@ namespace Xamarin.MacDev.Tasks
// In Windows, the path slashes are escaped.
expectedPath = expectedPath.Replace ("\\", "\\\\");
Assert.IsTrue (Task.ResponseFile.Contains (expectedPath), string.Format(
Assert.IsTrue (Task.ResponseFile.Contains (expectedPath), string.Format (
@"Failed to resolve facade assembly to the Sdk path.
Expected path:{0}
@ -287,13 +284,13 @@ namespace Xamarin.MacDev.Tasks
}
}
[TestCase("Xamarin.iOS,v1.0", "Xamarin.iOS")]
public void ReferenceFrameworkFileResolution_WhenResolutionFails(string targetFrameworkMoniker, string frameworkDir)
[TestCase ("Xamarin.iOS,v1.0", "Xamarin.iOS")]
public void ReferenceFrameworkFileResolution_WhenResolutionFails (string targetFrameworkMoniker, string frameworkDir)
{
using (var sdk = new TempSdk()) {
using (var sdk = new TempSdk ()) {
Task.TargetFrameworkMoniker = targetFrameworkMoniker;
Task.References = new[] { new TaskItem ("/usr/foo/System.Collections.dll", new Dictionary<string, string> { { "FrameworkFile", "true" } }) };
Task.References = new [] { new TaskItem ("/usr/foo/System.Collections.dll", new Dictionary<string, string> { { "FrameworkFile", "true" } }) };
var args = Task.GenerateCommandLineCommands ();
@ -349,8 +346,7 @@ namespace Xamarin.MacDev.Tasks
Assert.That (items.Count (), Is.EqualTo (3), "framework files");
}
class TempSdk : IDisposable
{
class TempSdk : IDisposable {
MonoTouchSdk sdk;
public TempSdk ()

Просмотреть файл

@ -27,7 +27,7 @@ namespace Xamarin.MacDev.Tasks {
RunMake (Path.Combine (Configuration.RootPath, "tests", "common", "TestProjects", "ComplexAssembly"), environment: env);
}
static void RunMake (string directory, Dictionary<string, string> environment = null)
static void RunMake (string directory, Dictionary<string, string> environment = null)
{
var arguments = new List<string> {
"-C",
@ -51,7 +51,7 @@ namespace Xamarin.MacDev.Tasks {
}
}
MergeAppBundles CreateTask (string outputBundle, params string[] inputBundles)
MergeAppBundles CreateTask (string outputBundle, params string [] inputBundles)
{
var inputItems = new List<TaskItem> ();
for (var i = 0; i < inputBundles.Length; i++) {
@ -66,7 +66,7 @@ namespace Xamarin.MacDev.Tasks {
}
// Create two app bundles, one with fileA, and one with fileB, in the root directory
string[] CreateAppBundles (string fileA, string fileB, string fileName = null)
string [] CreateAppBundles (string fileA, string fileB, string fileName = null)
{
var appBundleA = Path.Combine (Cache.CreateTemporaryDirectory (), "MergeMe.app");
var appBundleB = Path.Combine (Cache.CreateTemporaryDirectory (), "MergeMe.app");
@ -77,7 +77,7 @@ namespace Xamarin.MacDev.Tasks {
return new string [] { appBundleA, appBundleB };
}
string CreateAppBundle (string directory, params string[] files)
string CreateAppBundle (string directory, params string [] files)
{
var appBundle = Path.Combine (Cache.CreateTemporaryDirectory (), "MergeMe.app");
Directory.CreateDirectory (appBundle);

Просмотреть файл

@ -6,12 +6,10 @@ using NUnit.Framework;
using Xamarin.MacDev.Tasks;
namespace Xamarin.MacDev.Tasks
{
namespace Xamarin.MacDev.Tasks {
[TestFixture]
public class ParseBundlerArgumentsTests : TestBase
{
class CustomParseBundlerArguments : ParseBundlerArgumentsTaskBase {}
public class ParseBundlerArgumentsTests : TestBase {
class CustomParseBundlerArguments : ParseBundlerArgumentsTaskBase { }
[Test]
public void NoExtraArgs ()

Просмотреть файл

@ -5,18 +5,16 @@ using NUnit.Framework;
using Xamarin.MacDev;
using Xamarin.MacDev.Tasks;
namespace Xamarin.MacDev.Tasks
{
namespace Xamarin.MacDev.Tasks {
[TestFixture]
public class PropertyListEditorTaskTests : TestBase
{
public class PropertyListEditorTaskTests : TestBase {
static void CheckArray (PArray array, PArray expected)
{
Assert.AreEqual (expected.Count, array.Count, "Unexpected number of array elements");
for (int i = 0; i < expected.Count; i++) {
Assert.AreEqual (expected[i].Type, array[i].Type, "Type-mismatch for array element {0}", i);
CheckValue (array[i], expected[i]);
Assert.AreEqual (expected [i].Type, array [i].Type, "Type-mismatch for array element {0}", i);
CheckValue (array [i], expected [i]);
}
}
@ -215,7 +213,7 @@ namespace Xamarin.MacDev.Tasks
files.Add ("icon2");
var expected = (PDictionary) plist.Clone ();
files[0] = new PString ("icon");
files [0] = new PString ("icon");
TestExecuteTask (plist, PropertyListEditorAction.Set, ":CFBundleIcons:CFBundlePrimaryIcon:CFBundleIconFiles:0", "string", "icon0", expected);
@ -239,7 +237,7 @@ namespace Xamarin.MacDev.Tasks
TestExecuteTask (plist, PropertyListEditorAction.Clear, null, "integer", null, new PNumber (0));
TestExecuteTask (plist, PropertyListEditorAction.Clear, null, "real", null, new PReal (0));
TestExecuteTask (plist, PropertyListEditorAction.Clear, null, "string", null, new PString (string.Empty));
TestExecuteTask (plist, PropertyListEditorAction.Clear, null, "data", null, new PData (new byte[0]));
TestExecuteTask (plist, PropertyListEditorAction.Clear, null, "data", null, new PData (new byte [0]));
}
[Test]

Просмотреть файл

@ -12,7 +12,7 @@ using Xamarin.Utils;
namespace Xamarin.MacDev.Tasks {
[TestFixture]
public class ReadAppManifestTaskTests : TestBase {
ReadAppManifest CreateTask (ApplePlatform platform = ApplePlatform.iOS, Action<PDictionary>? createDictionary = null)
ReadAppManifest CreateTask (ApplePlatform platform = ApplePlatform.iOS, Action<PDictionary>? createDictionary = null)
{
var tmpdir = Cache.CreateTemporaryDirectory ();

Просмотреть файл

@ -17,11 +17,11 @@ namespace Xamarin.MacDev.Tasks.Tests {
[TestCase ("watchOS", null, "arm64_32", "watchos-arm64_32_armv7k/Universal.framework/Universal")]
[TestCase ("watchOS", "simulator", "x86_64", "watchos-arm64_x86_64-simulator/Universal.framework/Universal")] // subset
[TestCase ("macOS", null, "x86_64", "macos-arm64_x86_64/Universal.framework/Universal")] // subset
// multiple arch request (all must be present)
// multiple arch request (all must be present)
[TestCase ("macOS", null, "x86_64, arm64", "macos-arm64_x86_64/Universal.framework/Universal")]
// failure to resolve requested architecture
[TestCase ("iOS", "simulator", "i386, x86_64", "")] // i386 not available
// failure to resolve mismatched variant
// failure to resolve mismatched variant
[TestCase ("macOS", "maccatalyst", "x86_64", "")] // maccatalyst not available on macOS (it's on iOS)
public void Xcode12_x (string platform, string variant, string architecture, string expected)
{

Просмотреть файл

@ -55,7 +55,7 @@ namespace Xamarin.MacDev.Tasks {
RedirectStandardOutput = true,
RedirectStandardError = true,
};
psi.EnvironmentVariables ["DEVELOPER_DIR"] =Configuration.xcode_root;
psi.EnvironmentVariables ["DEVELOPER_DIR"] = Configuration.xcode_root;
psi.EnvironmentVariables.Remove ("XCODE_DEVELOPER_DIR_PATH"); // VSfM sets XCODE_DEVELOPER_DIR_PATH, which confuses the command-line tools if it doesn't match xcode-select, so just unset it.
var proc = Process.Start (psi);

Просмотреть файл

@ -2,10 +2,8 @@ using System.Collections.Generic;
using Microsoft.Build.Framework;
namespace Xamarin.MacDev.Tasks
{
public class Logger : ILogger
{
namespace Xamarin.MacDev.Tasks {
public class Logger : ILogger {
public List<CustomBuildEventArgs> CustomEvents {
get; set;
}

Просмотреть файл

@ -7,10 +7,8 @@ using NUnit.Framework;
using Xamarin.Tests;
namespace Xamarin.MacDev.Tasks
{
public abstract class TestBase
{
namespace Xamarin.MacDev.Tasks {
public abstract class TestBase {
TestEngine engine;
public TestEngine Engine {
get {
@ -80,7 +78,7 @@ namespace Xamarin.MacDev.Tasks
protected string CreateTempFile (string path)
{
path = Path.Combine (Cache.CreateTemporaryDirectory ("msbuild-tests"), path);
using (new FileStream (path, FileMode.CreateNew)) {}
using (new FileStream (path, FileMode.CreateNew)) { }
return path;
}
}

Просмотреть файл

@ -6,11 +6,9 @@ using Microsoft.Build.Framework;
using Microsoft.Build.Evaluation;
using Microsoft.Build.Logging;
namespace Xamarin.MacDev.Tasks
{
namespace Xamarin.MacDev.Tasks {
public class TestEngine : IBuildEngine, IBuildEngine2, IBuildEngine3, IBuildEngine4
{
public class TestEngine : IBuildEngine, IBuildEngine2, IBuildEngine3, IBuildEngine4 {
public Logger Logger {
get; set;
}
@ -61,7 +59,7 @@ namespace Xamarin.MacDev.Tasks
get { return true; }
}
public int LineNumberOfTaskNode {
get {return 0;}
get { return 0; }
}
public string ProjectFileOfTaskNode {
get { return ""; }

Просмотреть файл

@ -10,11 +10,9 @@ using Xamarin.MacDev;
using Xamarin.MacDev.Tasks;
using Xamarin.Utils;
namespace Xamarin.MacDev.Tasks
{
namespace Xamarin.MacDev.Tasks {
[TestFixture]
public class UtilityTests
{
public class UtilityTests {
[Test]
public void TestAbsoluteToRelativePath ()
{

Просмотреть файл

@ -11,12 +11,10 @@ using Xamarin;
using Xamarin.Tests;
using Xamarin.Utils;
namespace Xamarin.MMP.Tests
{
namespace Xamarin.MMP.Tests {
[TestFixture]
public partial class MMPTests
{
void RunMSBuildTest (Action <string> test, string directory_name = null)
public partial class MMPTests {
void RunMSBuildTest (Action<string> test, string directory_name = null)
{
test (Cache.CreateTemporaryDirectory (directory_name ?? "msbuild-tests"));
}
@ -150,7 +148,7 @@ namespace Xamarin.MMP.Tests
}
[Test]
public void BuildUnifiedProject_WithJustNativeRefNoLinkWith_Builds()
public void BuildUnifiedProject_WithJustNativeRefNoLinkWith_Builds ()
{
Configuration.IgnoreIfIgnoredPlatform (ApplePlatform.MacOSX);
Configuration.AssertLegacyXamarinAvailable (); // Investigate whether this test should be ported to .NET

Просмотреть файл

@ -4,12 +4,10 @@ using System.IO;
using Xamarin.Tests;
using Xamarin.Utils;
namespace Xamarin.MacDev.Tasks
{
namespace Xamarin.MacDev.Tasks {
[TestFixture ("iPhone")]
[TestFixture ("iPhoneSimulator")]
public class BindingProject : TestBase
{
public class BindingProject : TestBase {
public BindingProject (string platform)
: base (platform)
{

Просмотреть файл

@ -10,11 +10,9 @@ using NUnit.Framework;
using Xamarin.Tests;
using Xamarin.Utils;
namespace Xamarin.MacDev.Tasks
{
namespace Xamarin.MacDev.Tasks {
[TestFixture]
public class Bug60536 : ProjectTest
{
public class Bug60536 : ProjectTest {
public Bug60536 ()
: base ("iPhoneSimulator", "Debug")
{
@ -55,12 +53,12 @@ namespace Xamarin.MacDev.Tasks
RunTarget (MonoTouchProject, "Build", expectedErrorCount: 1);
var expectedFile = Path.Combine ("obj", Platform, Config, "actool", "cloned-assets", "Assets.xcassets", "AppIcon.appiconset", "Contents.json");
Assert.AreEqual (expectedFile, Engine.Logger.ErrorEvents[0].File, "File");
Assert.AreEqual (197, Engine.Logger.ErrorEvents[0].LineNumber, "LineNumber");
Assert.AreEqual (4, Engine.Logger.ErrorEvents[0].ColumnNumber, "ColumnNumber");
Assert.AreEqual (197, Engine.Logger.ErrorEvents[0].EndLineNumber, "EndLineNumber");
Assert.AreEqual (4, Engine.Logger.ErrorEvents[0].EndColumnNumber, "EndColumnNumber");
Assert.AreEqual ("']' is invalid without a matching open. LineNumber: 196 | BytePositionInLine: 3.", Engine.Logger.ErrorEvents[0].Message, "Message");
Assert.AreEqual (expectedFile, Engine.Logger.ErrorEvents [0].File, "File");
Assert.AreEqual (197, Engine.Logger.ErrorEvents [0].LineNumber, "LineNumber");
Assert.AreEqual (4, Engine.Logger.ErrorEvents [0].ColumnNumber, "ColumnNumber");
Assert.AreEqual (197, Engine.Logger.ErrorEvents [0].EndLineNumber, "EndLineNumber");
Assert.AreEqual (4, Engine.Logger.ErrorEvents [0].EndColumnNumber, "EndColumnNumber");
Assert.AreEqual ("']' is invalid without a matching open. LineNumber: 196 | BytePositionInLine: 3.", Engine.Logger.ErrorEvents [0].Message, "Message");
}
}
}

Просмотреть файл

@ -11,15 +11,13 @@ using Xamarin.MacDev;
using Xamarin.Tests;
using Xamarin.Utils;
namespace Xamarin.MacDev.Tasks
{
namespace Xamarin.MacDev.Tasks {
[TestFixture ("iPhone", "Debug")]
[TestFixture ("iPhone", "Release")]
// Note: Disabled because Simulator builds aren't consistently signed or not-signed, while device builds are.
//[TestFixture ("iPhoneSimulator", "Debug")]
//[TestFixture ("iPhoneSimulator", "Release")]
public class CodesignAppBundle : ProjectTest
{
public class CodesignAppBundle : ProjectTest {
public CodesignAppBundle (string platform, string configuration)
: base (platform, configuration)
{
@ -93,7 +91,7 @@ namespace Xamarin.MacDev.Tasks
if (Path.GetFileName (file) == "MyTabbedApplication" || Path.GetExtension (file) == ".dylib")
continue;
Assert.AreEqual (timestamps[file], newTimestamps[file], "App Bundle timestamp changed: " + file);
Assert.AreEqual (timestamps [file], newTimestamps [file], "App Bundle timestamp changed: " + file);
}
if (Platform != "iPhoneSimulator") {
@ -103,9 +101,9 @@ namespace Xamarin.MacDev.Tasks
foreach (var file in dsymTimestamps.Keys) {
// The Info.plist should be newer because it gets touched
if (Path.GetFileName (file) == "Info.plist") {
Assert.IsTrue (dsymTimestamps[file] < newDsymTimestamps[file], "App Bundle dSYMs Info.plist not touched: " + file);
Assert.IsTrue (dsymTimestamps [file] < newDsymTimestamps [file], "App Bundle dSYMs Info.plist not touched: " + file);
} else {
Assert.AreEqual (dsymTimestamps[file], newDsymTimestamps[file], "App Bundle dSYMs changed: " + file);
Assert.AreEqual (dsymTimestamps [file], newDsymTimestamps [file], "App Bundle dSYMs changed: " + file);
}
}
@ -115,7 +113,7 @@ namespace Xamarin.MacDev.Tasks
// Note: we could fix this by not using `ditto` and instead implementing this ourselves to only overwrite files if they've changed
// and then setting some [Output] params that specify whether or not we need to re-codesign and/or strip debug symbols.
foreach (var file in appexDsymTimestamps.Keys)
Assert.IsTrue (appexDsymTimestamps[file] < newAppexDsymTimestamps[file], "App Extension dSYMs should be newer: " + file);
Assert.IsTrue (appexDsymTimestamps [file] < newAppexDsymTimestamps [file], "App Extension dSYMs should be newer: " + file);
}
}

Просмотреть файл

@ -10,12 +10,10 @@ using NUnit.Framework;
using Xamarin.Tests;
using Xamarin.Utils;
namespace Xamarin.MacDev.Tasks
{
namespace Xamarin.MacDev.Tasks {
// [TestFixture ("iPhone")] // Skip this to speed things up a bit.
[TestFixture ("iPhoneSimulator")]
public class CompileSceneKitAssetsTest : ProjectTest
{
public class CompileSceneKitAssetsTest : ProjectTest {
public CompileSceneKitAssetsTest (string platform) : base (platform)
{
}

Просмотреть файл

@ -9,19 +9,17 @@ using Xamarin.Utils;
using NUnit.Framework;
namespace Xamarin.MacDev.Tasks
{
namespace Xamarin.MacDev.Tasks {
[TestFixture ("iPhone")]
[TestFixture ("iPhoneSimulator")]
public class CoreMLCompiler : ProjectTest
{
public class CoreMLCompiler : ProjectTest {
public CoreMLCompiler (string platform) : base (platform)
{
}
void AssertCompiledModelExists (string modelName)
{
var expected = new string[] { "coremldata.bin", "model.espresso.net", "model.espresso.shape", "model.espresso.weights", "model/coremldata.bin", "neural_network_optionals/coremldata.bin" };
var expected = new string [] { "coremldata.bin", "model.espresso.net", "model.espresso.shape", "model.espresso.weights", "model/coremldata.bin", "neural_network_optionals/coremldata.bin" };
var mlmodelc = Path.Combine (AppBundlePath, modelName + ".mlmodelc");
Assert.IsTrue (Directory.Exists (mlmodelc));

Просмотреть файл

@ -25,7 +25,7 @@ namespace Xamarin.MacDev.Tasks {
var proj = SetupProjectPaths ("NativeExtensionEmbedding/managed/ManagedContainer");
MonoTouchProject = proj;
var xcodeProjectFolder = Path.Combine (proj.ProjectPath , "..", "..", "native");
var xcodeProjectFolder = Path.Combine (proj.ProjectPath, "..", "..", "native");
string [] xcodeBuildArgs = new [] { "-configuration", "Debug", "-target", "NativeTodayExtension", "-sdk", Platform == "iPhoneSimulator" ? "iphonesimulator" : "iphoneos" };
var env = new System.Collections.Generic.Dictionary<string, string> { { "DEVELOPER_DIR", Configuration.XcodeLocation } };
Assert.AreEqual (0, ExecutionHelper.Execute ("/usr/bin/xcodebuild", xcodeBuildArgs.Concat (new [] { "clean" }).ToList (), xcodeProjectFolder, Console.WriteLine, Console.Error.WriteLine));

Просмотреть файл

@ -6,9 +6,8 @@ using Xamarin.Utils;
namespace Xamarin.MacDev.Tasks {
[TestFixture ("iPhone")]
[TestFixture ("iPhoneSimulator")]
public class ActionTests : ExtensionTestBase
{
public ActionTests (string platform) : base (platform)
public class ActionTests : ExtensionTestBase {
public ActionTests (string platform) : base (platform)
{
}

Просмотреть файл

@ -9,16 +9,17 @@ namespace Xamarin.MacDev.Tasks {
[TestFixture ("iPhone")]
[TestFixture ("iPhoneSimulator")]
public class CustomKeyboardTests : ExtensionTestBase {
public CustomKeyboardTests(string platform) : base(platform) {
ExpectedAppFiles = new string [] {
"MainStoryboard_iPad.storyboardc",
"MainStoryboard_iPhone.storyboardc",
public CustomKeyboardTests (string platform) : base (platform)
{
ExpectedAppFiles = new string [] {
"MainStoryboard_iPad.storyboardc",
"MainStoryboard_iPhone.storyboardc",
"default.metallib"
};
}
[Test]
public void BasicTest ()
public void BasicTest ()
{
Configuration.IgnoreIfIgnoredPlatform (ApplePlatform.iOS);
Configuration.AssertLegacyXamarinAvailable (); // Investigate whether this test should be ported to .NET

Просмотреть файл

@ -9,12 +9,12 @@ namespace Xamarin.MacDev.Tasks {
[TestFixture ("iPhoneSimulator")]
public class DocumentPickerTests : ExtensionTestBase {
public DocumentPickerTests (string platform) : base(platform)
public DocumentPickerTests (string platform) : base (platform)
{
}
[Test]
public void BasicTest ()
public void BasicTest ()
{
Configuration.IgnoreIfIgnoredPlatform (ApplePlatform.iOS);
Configuration.AssertLegacyXamarinAvailable (); // Investigate whether this test should be ported to .NET

Просмотреть файл

@ -5,8 +5,7 @@ using NUnit.Framework;
using Xamarin.Tests;
namespace Xamarin.MacDev.Tasks
{
namespace Xamarin.MacDev.Tasks {
public class ExtensionTestBase : TestBase {
public ExtensionTestBase () { }
@ -30,7 +29,7 @@ namespace Xamarin.MacDev.Tasks
RunTarget (mtouchPaths, "Clean");
Assert.IsFalse (Directory.Exists (AppBundlePath), "App bundle exists after cleanup: {0} ", AppBundlePath);
RunTarget (mtouchPaths, "Build", expectedErrorCount: expectedErrorCount);
if (expectedErrorCount > 0)
@ -38,11 +37,11 @@ namespace Xamarin.MacDev.Tasks
Assert.IsTrue (Directory.Exists (AppBundlePath), "App Bundle does not exist: {0} ", AppBundlePath);
TestPList (AppBundlePath, new string[] {"CFBundleExecutable", "CFBundleVersion"});
TestPList (AppBundlePath, new string [] { "CFBundleExecutable", "CFBundleVersion" });
Assert.IsTrue (Directory.Exists (extensionPath), "Appex directory does not exist: {0} ", extensionPath);
TestPList (extensionPath, new string[] {"CFBundleExecutable", "CFBundleVersion"});
TestPList (extensionPath, new string [] { "CFBundleExecutable", "CFBundleVersion" });
TestFilesExists (AppBundlePath, ExpectedAppFiles);
TestFilesDoNotExist (AppBundlePath, UnexpectedAppFiles);

Просмотреть файл

@ -8,18 +8,18 @@ namespace Xamarin.MacDev.Tasks {
[TestFixture ("iPhoneSimulator")]
public class WatchKit : ExtensionTestBase {
public WatchKit (string platform) : base(platform)
public WatchKit (string platform) : base (platform)
{
}
[Test]
public void BasicTest ()
public void BasicTest ()
{
Configuration.IgnoreIfIgnoredPlatform (ApplePlatform.WatchOS);
Configuration.AssertLegacyXamarinAvailable ();
BuildExtension ("MyWatchApp", "MyWatchKitExtension", expectedErrorCount: 1);
Assert.AreEqual ("Xamarin.iOS 14+ does not support watchOS 1 apps. Please migrate your project to watchOS 2+.", Engine.Logger.ErrorEvents[0].Message, "WK 1 error message");
Assert.AreEqual ("Xamarin.iOS 14+ does not support watchOS 1 apps. Please migrate your project to watchOS 2+.", Engine.Logger.ErrorEvents [0].Message, "WK 1 error message");
}
}
}

Просмотреть файл

@ -11,12 +11,12 @@ namespace Xamarin.MacDev.Tasks {
[TestFixture ("iPhoneSimulator")]
public class WatchKit2 : ExtensionTestBase {
public WatchKit2 (string platform) : base(platform)
public WatchKit2 (string platform) : base (platform)
{
}
[Test]
public void BasicTest ()
public void BasicTest ()
{
Configuration.IgnoreIfIgnoredPlatform (ApplePlatform.WatchOS);
Configuration.AssertLegacyXamarinAvailable (); // Investigate whether this test should be ported to .NET

Просмотреть файл

@ -3,12 +3,10 @@ using NUnit.Framework;
using Xamarin.Tests;
using Xamarin.Utils;
namespace Xamarin.MacDev.Tasks
{
namespace Xamarin.MacDev.Tasks {
[TestFixture ("iPhone")]
[TestFixture ("iPhoneSimulator")]
public class IBToolLinking : ProjectTest
{
public class IBToolLinking : ProjectTest {
public IBToolLinking (string platform) : base (platform)
{
}

Просмотреть файл

@ -5,13 +5,11 @@ using NUnit.Framework;
using Xamarin.Tests;
using Xamarin.Utils;
namespace Xamarin.MacDev.Tasks
{
namespace Xamarin.MacDev.Tasks {
[TestFixture ("iPhone")]
[TestFixture ("iPhoneSimulator")]
public class LinkedAssets : ProjectTest
{
static readonly string[] IconNames = { "AppIcon29x29.png", "AppIcon29x29@2x.png", "AppIcon40x40@2x.png", "AppIcon57x57.png", "AppIcon57x57@2x.png", "AppIcon60x60@2x.png" };
public class LinkedAssets : ProjectTest {
static readonly string [] IconNames = { "AppIcon29x29.png", "AppIcon29x29@2x.png", "AppIcon40x40@2x.png", "AppIcon57x57.png", "AppIcon57x57@2x.png", "AppIcon60x60@2x.png" };
public LinkedAssets (string platform) : base (platform)
{

Просмотреть файл

@ -12,8 +12,8 @@ namespace Xamarin.MacDev.Tasks {
[TestFixture ("iPhone")]
[TestFixture ("iPhoneSimulator")]
public class NativeReferencesTests : ProjectTest {
public NativeReferencesTests (string platform) : base (platform)
public NativeReferencesTests (string platform) : base (platform)
{
}
@ -49,7 +49,7 @@ namespace Xamarin.MacDev.Tasks {
{
Configuration.IgnoreIfIgnoredPlatform (ApplePlatform.iOS);
Configuration.AssertLegacyXamarinAvailable (); // Investigate whether this test should be ported to .NET
if (Platform.Contains ("Simulator"))
return; // incremental builds on the simulator doesn't make much sense.

Просмотреть файл

@ -6,8 +6,7 @@ using NUnit.Framework;
using Xamarin.Tests;
using Xamarin.Utils;
namespace Xamarin.MacDev.Tasks
{
namespace Xamarin.MacDev.Tasks {
[TestFixture ("iPhone")]
[TestFixture ("iPhoneSimulator")]
public class NativeReferencesNoEmbedding : ProjectTest {
@ -80,7 +79,7 @@ namespace Xamarin.MacDev.Tasks
ClearMessages ();
// No change build should not
BuildProjectNoEmbedding (bindingLib, clean : false);
BuildProjectNoEmbedding (bindingLib, clean: false);
Assert.False (GetMessages ().Contains (CreatePackageString), "Rebuild build did create package?");
ClearMessages ();

Просмотреть файл

@ -6,12 +6,10 @@ using NUnit.Framework;
using Xamarin.Tests;
using Xamarin.Utils;
namespace Xamarin.MacDev.Tasks
{
namespace Xamarin.MacDev.Tasks {
[TestFixture ("iPhone")]
[TestFixture ("iPhoneSimulator")]
public class ProjectReferenceTests : ProjectTest
{
public class ProjectReferenceTests : ProjectTest {
public ProjectReferenceTests (string platform) : base (platform)
{

Просмотреть файл

@ -6,8 +6,7 @@ using NUnit.Framework;
using Xamarin.Tests;
namespace Xamarin.MacDev.Tasks
{
namespace Xamarin.MacDev.Tasks {
public class ProjectTest : TestBase {
public ProjectTest (string platform)
: base (platform)

Просмотреть файл

@ -9,7 +9,7 @@ namespace Xamarin.MacDev.Tasks {
[TestFixture ("iPhone")]
[TestFixture ("iPhoneSimulator")]
public class ProjectWithFrameworksTests : ExtensionTestBase {
public ProjectWithFrameworksTests (string platform) : base (platform)
public ProjectWithFrameworksTests (string platform) : base (platform)
{
}

Просмотреть файл

@ -5,12 +5,10 @@ using NUnit.Framework;
using Xamarin.Tests;
using Xamarin.Utils;
namespace Xamarin.MacDev.Tasks
{
namespace Xamarin.MacDev.Tasks {
[TestFixture ("iPhone")]
[TestFixture ("iPhoneSimulator")]
public class ProjectWithSpacesTests : ProjectTest
{
public class ProjectWithSpacesTests : ProjectTest {
public ProjectWithSpacesTests (string platform) : base (platform)
{
}

Просмотреть файл

@ -7,11 +7,9 @@ using NUnit.Framework;
using Xamarin.Tests;
using Xamarin.Utils;
namespace Xamarin.MacDev.Tasks
{
namespace Xamarin.MacDev.Tasks {
[TestFixture ("iPhone")]
public class ReleaseBuild : ProjectTest
{
public class ReleaseBuild : ProjectTest {
public ReleaseBuild (string platform)
: base (platform, "Release")
{
@ -52,10 +50,10 @@ namespace Xamarin.MacDev.Tasks
var newDSymTimestamps = Directory.EnumerateFiles (dsymDir, "*.*", SearchOption.AllDirectories).ToDictionary (file => file, file => GetLastModified (file));
foreach (var file in timestamps.Keys)
Assert.AreEqual (timestamps[file], newTimestamps[file], "#1: " + file);
Assert.AreEqual (timestamps [file], newTimestamps [file], "#1: " + file);
foreach (var file in dsymTimestamps.Keys)
Assert.AreEqual (dsymTimestamps[file], newDSymTimestamps[file], "#2: " + file);
Assert.AreEqual (dsymTimestamps [file], newDSymTimestamps [file], "#2: " + file);
EnsureFilestampChange ();
@ -78,7 +76,7 @@ namespace Xamarin.MacDev.Tasks
} else if (fileName == "MyReleaseBuild") {
// the executable must of course be modified
isModificationExpected = true;
} else if (fileName == "CodeResources") {
} else if (fileName == "CodeResources") {
// the signature has of course changed too
isModificationExpected = true;
} else if (fileName.EndsWith (".dll", StringComparison.Ordinal) || fileName.EndsWith (".exe", StringComparison.Ordinal)) {
@ -87,13 +85,13 @@ namespace Xamarin.MacDev.Tasks
}
if (isModificationExpected)
Assert.AreNotEqual (timestamps[file], newTimestamps[file], "#3: " + file);
Assert.AreNotEqual (timestamps [file], newTimestamps [file], "#3: " + file);
else
Assert.AreEqual (timestamps[file], newTimestamps[file], "#3: " + file);
Assert.AreEqual (timestamps [file], newTimestamps [file], "#3: " + file);
}
foreach (var file in dsymTimestamps.Keys)
Assert.AreNotEqual (dsymTimestamps[file], newDSymTimestamps[file], "#4: " + file);
Assert.AreNotEqual (dsymTimestamps [file], newDSymTimestamps [file], "#4: " + file);
}
}
}

Просмотреть файл

@ -6,10 +6,8 @@ using NUnit.Framework;
using Xamarin.Tests;
using Xamarin.Utils;
namespace Xamarin.MacDev.Tasks
{
public class ResponseFileArguments : ProjectTest
{
namespace Xamarin.MacDev.Tasks {
public class ResponseFileArguments : ProjectTest {
public ResponseFileArguments () : base ("iPhoneSimulator")
{
}

Просмотреть файл

@ -12,8 +12,8 @@ namespace Xamarin.MacDev.Tasks {
[TestFixture ("iPhone")]
[TestFixture ("iPhoneSimulator")]
public class SystemMemoryReferenceTests : ProjectTest {
public SystemMemoryReferenceTests (string platform) : base (platform)
public SystemMemoryReferenceTests (string platform) : base (platform)
{
}

Просмотреть файл

@ -5,18 +5,16 @@ using NUnit.Framework;
using Xamarin.Tests;
using Xamarin.Utils;
namespace Xamarin.MacDev.Tasks
{
namespace Xamarin.MacDev.Tasks {
[TestFixture ("iPhone")]
[TestFixture ("iPhoneSimulator")]
public class TVAppTests : ExtensionTestBase
{
public class TVAppTests : ExtensionTestBase {
public TVAppTests (string platform) : base (platform)
{
}
[Test]
public void BasicTest()
public void BasicTest ()
{
Configuration.IgnoreIfIgnoredPlatform (ApplePlatform.TVOS);
Configuration.AssertLegacyXamarinAvailable (); // Investigate whether this test should be ported to .NET

Просмотреть файл

@ -4,12 +4,10 @@ using NUnit.Framework;
using Xamarin.Tests;
using Xamarin.Utils;
namespace Xamarin.MacDev.Tasks
{
namespace Xamarin.MacDev.Tasks {
[TestFixture ("iPhone")]
[TestFixture ("iPhoneSimulator")]
public class XamarinForms : ProjectTest
{
public class XamarinForms : ProjectTest {
public XamarinForms (string platform) : base (platform)
{
}

Просмотреть файл

@ -6,11 +6,9 @@ using NUnit.Framework;
using Xamarin.Tests;
using Xamarin.Utils;
namespace Xamarin.MMP.Tests
{
namespace Xamarin.MMP.Tests {
[TestFixture]
public partial class MMPTests
{
public partial class MMPTests {
public string RoslynTestProjectRoot => Path.Combine (Configuration.TestProjectsDirectory, "RoslynTestApp");
[Test]

Просмотреть файл

@ -7,11 +7,9 @@ using NUnit.Framework;
using Xamarin.Tests;
using Xamarin.Utils;
namespace Xamarin.MMP.Tests
{
namespace Xamarin.MMP.Tests {
[TestFixture]
public class RuntimeTests
{
public class RuntimeTests {
[Test]
public void AssemblyRegistration ()
{

Просмотреть файл

@ -9,17 +9,15 @@ using Xamarin.MacDev;
using Xamarin.Tests;
using Xamarin.Utils;
namespace Xamarin.MacDev.Tasks
{
namespace Xamarin.MacDev.Tasks {
[TestFixture]
public class TargetTests : TestBase
{
public class TargetTests : TestBase {
public TargetTests ()
: base ("iPhoneSimulator")
{
}
string[] ExpectedExecutableBundleResources {
string [] ExpectedExecutableBundleResources {
get {
var files = new [] {
Path.Combine ("Folder", "BundleResource.txt"),
@ -50,7 +48,7 @@ namespace Xamarin.MacDev.Tasks
}
}
string[] ExpectedLibraryBundleResources {
string [] ExpectedLibraryBundleResources {
get {
var files = new [] {
Path.Combine ("LibrarySecondStoryboard.storyboardc", "43-view-49.nib"),
@ -69,7 +67,7 @@ namespace Xamarin.MacDev.Tasks
}
}
string[] ExpectedExecutableFiles {
string [] ExpectedExecutableFiles {
get {
var files = new [] {
"MonoTouchDebugConfiguration.txt",
@ -101,8 +99,8 @@ namespace Xamarin.MacDev.Tasks
return expected.ToArray ();
}
}
static string[] ExpectedLibraryEmbeddedResources {
static string [] ExpectedLibraryEmbeddedResources {
get {
return new [] {
"MyLibrary.MyLibraryFolder.LibraryLinkedEmbeddedResource.txt",
@ -149,7 +147,7 @@ namespace Xamarin.MacDev.Tasks
RunTarget (MonoTouchProject, TargetName.ResolveReferences);
var references = MonoTouchProjectInstance.GetItems ("ReferencePath").ToArray ();
var expected_references = new string[] {
var expected_references = new string [] {
"MyLibrary.dll",
"System.dll",
"System.Xml.dll",
@ -172,7 +170,7 @@ namespace Xamarin.MacDev.Tasks
RunTarget (LibraryProject, TargetName.ResolveReferences);
var references = LibraryProjectInstance.GetItems ("ReferencePath").ToArray ();
var expected_references = new string[] {
var expected_references = new string [] {
"System.dll",
"System.Xml.dll",
"System.Core.dll",
@ -208,13 +206,13 @@ namespace Xamarin.MacDev.Tasks
// Verify that we have not bundled BundleResource or Content items as embedded resources
var assemblyDef = AssemblyDefinition.ReadAssembly (Path.Combine (AppBundlePath, "MySingleView.exe"));
Assert.AreEqual (2, assemblyDef.MainModule.Resources.OfType <EmbeddedResource> ().Count (), "#3");
Assert.AreEqual (2, assemblyDef.MainModule.Resources.OfType<EmbeddedResource> ().Count (), "#3");
var plist = PDictionary.FromFile (Path.Combine (AppBundlePath, "Info.plist"));
Assert.IsTrue (plist.ContainsKey ("CFBundleExecutable"));
Assert.IsTrue (plist.ContainsKey ("CFBundleVersion"));
Assert.IsNotEmpty (((PString)plist["CFBundleExecutable"]).Value);
Assert.IsNotEmpty (((PString)plist["CFBundleVersion"]).Value);
Assert.IsNotEmpty (((PString) plist ["CFBundleExecutable"]).Value);
Assert.IsNotEmpty (((PString) plist ["CFBundleVersion"]).Value);
}
[Test]
@ -403,10 +401,10 @@ namespace Xamarin.MacDev.Tasks
Configuration.AssertLegacyXamarinAvailable (); // Investigate whether this test should be ported to .NET
var libraryPath = Path.Combine (LibraryProjectBinPath, "MyLibrary.dll");
RunTarget (LibraryProject, TargetName.Build);
var timestamp = GetLastModified (libraryPath);
Touch (Path.Combine (LibraryProjectPath, "LibraryStoryboard.storyboard"));
RunTarget (LibraryProject, TargetName.Build);
Assert.AreNotEqual (timestamp, GetLastModified (libraryPath));
@ -428,30 +426,30 @@ namespace Xamarin.MacDev.Tasks
Configuration.AssertLegacyXamarinAvailable (); // Investigate whether this test should be ported to .NET
LibraryProjectInstance.RemoveItems ("InterfaceDefinition");
BuildLibraryCore (ExpectedLibraryEmbeddedResources.Where (s => !s.Contains ("storyboardc")).ToArray ());
}
void BuildLibraryCore (string[] expectedResources)
void BuildLibraryCore (string [] expectedResources)
{
Configuration.IgnoreIfIgnoredPlatform (ApplePlatform.iOS);
Configuration.AssertLegacyXamarinAvailable (); // Investigate whether this test should be ported to .NET
var library = Path.Combine (LibraryProjectBinPath, "MyLibrary.dll");
RunTarget (LibraryProject, TargetName.Build);
Assert.IsTrue (string.IsNullOrEmpty (LibraryProjectInstance.GetPropertyValue ("AppBundleDir")), "#1");
var entries = Directory.GetFileSystemEntries (LibraryProjectBinPath);
Assert.AreEqual (2, entries.Length, "#1");
Assert.IsTrue (File.Exists (library), "#2");
Assert.IsTrue (File.Exists (Path.ChangeExtension (library, ".pdb")), "#3");
var assemblyDef = AssemblyDefinition.ReadAssembly (library);
var actualResources = assemblyDef.MainModule.Resources.Select (n => n.Name).ToList ();
foreach (var resource in expectedResources)
Assert.IsTrue (actualResources.Contains (resource), "#1. " + resource);
Assert.AreEqual (expectedResources.Length, assemblyDef.MainModule.Resources.OfType <EmbeddedResource> ().Count (), "#2");
Assert.AreEqual (expectedResources.Length, assemblyDef.MainModule.Resources.OfType<EmbeddedResource> ().Count (), "#2");
}
[Test]
@ -481,8 +479,8 @@ namespace Xamarin.MacDev.Tasks
RunTarget (MonoTouchProject, TargetName.PackLibraryResources);
var embeddedResources = MonoTouchProjectInstance.GetItems ("EmbeddedResource").ToArray ();
Assert.AreEqual (2, embeddedResources.Length, "#1");
Assert.IsTrue (embeddedResources.Any (i => i.EvaluatedInclude == "LinkedEmbeddedResource.txt"), "#1");
Assert.IsTrue (embeddedResources.Any (i => i.EvaluatedInclude == Path.Combine ("Folder", "EmbeddedResource.txt")), "#2");
Assert.IsTrue (embeddedResources.Any (i => i.EvaluatedInclude == "LinkedEmbeddedResource.txt"), "#1");
Assert.IsTrue (embeddedResources.Any (i => i.EvaluatedInclude == Path.Combine ("Folder", "EmbeddedResource.txt")), "#2");
}
[Test]
@ -566,7 +564,7 @@ namespace Xamarin.MacDev.Tasks
}
[Test (Description = "Xambug #39137")]
public void AddAppIcon_NoClean()
public void AddAppIcon_NoClean ()
{
Configuration.IgnoreIfIgnoredPlatform (ApplePlatform.iOS);
Configuration.AssertLegacyXamarinAvailable (); // Investigate whether this test should be ported to .NET
@ -577,7 +575,7 @@ namespace Xamarin.MacDev.Tasks
var plistCopy = PDictionary.FromFile (path);
// Start without app icon.
plist.Remove("XSAppIconAssets");
plist.Remove ("XSAppIconAssets");
plist.SetMinimumOSVersion ("7.0");
plist.Save (path, true);

Просмотреть файл

@ -9,11 +9,9 @@ using Xamarin.MacDev;
using Xamarin.Tests;
using Xamarin.Utils;
namespace Xamarin.MacDev.Tasks
{
namespace Xamarin.MacDev.Tasks {
[TestFixture]
public class ValidateAppBundleTaskTests : ExtensionTestBase
{
public class ValidateAppBundleTaskTests : ExtensionTestBase {
string extensionBundlePath;
string mainAppPlistPath;
string extensionPlistPath;
@ -55,7 +53,7 @@ namespace Xamarin.MacDev.Tasks
void MissingPlist_Extension ()
{
var contents = File.ReadAllBytes (extensionPlistPath);
try {
try {
File.Delete (extensionPlistPath);
RunTarget (MonoTouchProject, "_ValidateAppBundle", 1);
Assert.IsTrue (Engine.Logger.ErrorEvents.Count > 0, "#2");

Просмотреть файл

@ -5,15 +5,14 @@ using System.Linq;
using System.Text;
using Xamarin.Utils;
using Microsoft.Build.Framework;
using Microsoft.Build.Logging.StructuredLogger;
#nullable enable
namespace Xamarin.Tests {
public class BuildEngine
{
public class BuildEngine {
public Dictionary<string, string> Properties { get; private set; } = new Dictionary<string, string> ();
public void SetGlobalProperty (string name, string value)
@ -108,7 +107,7 @@ namespace Xamarin.Tests {
if (parent?.Name != name)
return false;
if (!(parent is Parameter || parent is AddItem))
if (!(parent is Parameter || parent is AddItem))
return false;
parent = parent.Parent as NamedNode;

Просмотреть файл

@ -9,10 +9,8 @@ using Xamarin.MacDev;
using Xamarin.Utils;
namespace Xamarin.Tests
{
public abstract class TestBase
{
namespace Xamarin.Tests {
public abstract class TestBase {
public ExecutionMode Mode = ExecutionMode.MSBuild;
public string Platform;
public string Config = "Debug";
@ -32,8 +30,7 @@ namespace Xamarin.Tests
Config = config;
}
protected static class TargetName
{
protected static class TargetName {
public static string Build = "Build";
public static string Clean = "Clean";
public static string CollectBundleResources = "_CollectBundleResources";
@ -74,7 +71,7 @@ namespace Xamarin.Tests
public string [] ExpectedAppFiles = { };
public string [] UnexpectedAppFiles = { "monotouch.dll" };
public string[] GetCoreAppFiles (string managedExe, string nativeExe)
public string [] GetCoreAppFiles (string managedExe, string nativeExe)
{
var coreFiles = new List<string> ();
@ -238,13 +235,13 @@ namespace Xamarin.Tests
get { return TargetFrameworkIdentifier == "Xamarin.TVOS"; }
}
public void TestFilesDoNotExist(string baseDir, IEnumerable<string> files)
public void TestFilesDoNotExist (string baseDir, IEnumerable<string> files)
{
foreach (var v in files.Select (s => Path.Combine (baseDir, s)))
Assert.IsFalse (File.Exists (v) || Directory.Exists (v), "Unexpected file: {0} exists", v);
}
public void TestFilesExists (string baseDir, string[] files)
public void TestFilesExists (string baseDir, string [] files)
{
foreach (var v in files.Select (s => Path.Combine (baseDir, s)))
Assert.IsTrue (File.Exists (v) || Directory.Exists (v), "Expected file: {0} does not exist", v);
@ -260,19 +257,19 @@ namespace Xamarin.Tests
}
}
public void TestStoryboardC (string path)
public void TestStoryboardC (string path)
{
Assert.IsTrue (Directory.Exists (path), "Storyboard {0} does not exist", path);
Assert.IsTrue (File.Exists (Path.Combine (path, "Info.plist")));
TestPList (path, new string [] {"CFBundleVersion", "CFBundleExecutable"});
TestPList (path, new string [] { "CFBundleVersion", "CFBundleExecutable" });
}
public void TestPList (string path, string[] keys)
public void TestPList (string path, string [] keys)
{
var plist = PDictionary.FromFile (Path.Combine (path, "Info.plist"));
foreach (var x in keys) {
Assert.IsTrue (plist.ContainsKey (x), "Key {0} is not present in {1} Info.plist", x, path);
Assert.IsNotEmpty (((PString)plist[x]).Value, "Key {0} is empty in {1} Info.plist", x, path);
Assert.IsNotEmpty (((PString) plist [x]).Value, "Key {0} is empty in {1} Info.plist", x, path);
}
}
@ -280,7 +277,7 @@ namespace Xamarin.Tests
{
var dir = Cache.CreateTemporaryDirectory ();
path = Path.Combine (dir, path);
using (new FileStream (path, FileMode.CreateNew)) {}
using (new FileStream (path, FileMode.CreateNew)) { }
return path;
}
@ -308,7 +305,7 @@ namespace Xamarin.Tests
public static bool IsAPFS {
get {
if (!is_apfs.HasValue) {
var exit_code = ExecutionHelper.Execute ("/bin/df", new string[] { "-t", "apfs", "/" }, out var output, TimeSpan.FromSeconds (10));
var exit_code = ExecutionHelper.Execute ("/bin/df", new string [] { "-t", "apfs", "/" }, out var output, TimeSpan.FromSeconds (10));
is_apfs = exit_code == 0 && output.Trim ().Split ('\n').Length >= 2;
}
return is_apfs.Value;
@ -350,7 +347,7 @@ namespace Xamarin.Tests
public static void NugetRestore (string project)
{
var rv = ExecutionHelper.Execute ("nuget", new string[] { "restore", project }, out var output);
var rv = ExecutionHelper.Execute ("nuget", new string [] { "restore", project }, out var output);
if (rv != 0) {
Console.WriteLine ("nuget restore failed:");
Console.WriteLine (output);

Просмотреть файл

@ -39,6 +39,7 @@ dotnet format whitespace "$SRC_DIR/tests/xtro-sharpie/u2todo/u2todo.csproj"
dotnet format whitespace "$SRC_DIR/tests/xtro-sharpie/xtro-report/xtro-report.csproj"
dotnet format whitespace "$SRC_DIR/tests/xtro-sharpie/xtro-sanity/xtro-sanity.csproj"
dotnet format whitespace --folder "$SRC_DIR/tests/monotouch-test"
dotnet format whitespace --folder "$SRC_DIR/tests/msbuild"
dotnet format whitespace --folder "$SRC_DIR/tests/xtro-sharpie"
dotnet format whitespace --folder "$SRC_DIR/src/Accelerate"