This repository has been archived by the owner on Jan 10, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Touch.Client] Add support for macOS. (#80)
- Loading branch information
1 parent
2d556a5
commit 9266732
Showing
7 changed files
with
269 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Reflection; | ||
using System.Threading.Tasks; | ||
|
||
using AppKit; | ||
using Foundation; | ||
|
||
namespace MonoTouch.NUnit.UI { | ||
public class MacRunner : BaseTouchRunner { | ||
public static async Task<int> MainAsync (IList<string> arguments, params Assembly[] assemblies) | ||
{ | ||
NSApplication.Init (); | ||
|
||
var options = new TouchOptions (arguments); | ||
TouchOptions.Current = options; | ||
return await RunTestsAsync (options, assemblies) ? 0 : 1; | ||
} | ||
|
||
static async Task<bool> RunTestsAsync (TouchOptions options, Assembly[] assemblies) | ||
{ | ||
var runner = new MacRunner (); | ||
if (assemblies == null || assemblies.Length == 0) | ||
assemblies = AppDomain.CurrentDomain.GetAssemblies (); | ||
|
||
foreach (var asm in assemblies) | ||
runner.Load (asm); | ||
|
||
await runner.RunAsync (); | ||
|
||
return !runner.Result.IsFailure (); | ||
} | ||
|
||
protected override void WriteDeviceInformation (TextWriter writer) | ||
{ | ||
var piinfo = NSProcessInfo.ProcessInfo; | ||
writer.WriteLine ("[macOS: {0}]", piinfo.OperatingSystemVersionString); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProjectGuid>{A1209F3A-3876-4EAC-ADA7-99F660002AB6}</ProjectGuid> | ||
<ProjectTypeGuids>{A3F8F2AB-B479-4A4A-A458-A89E7DC349F1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> | ||
<OutputType>Library</OutputType> | ||
<RootNamespace>Touch.Client</RootNamespace> | ||
<MonoMacResourcePrefix>Resources</MonoMacResourcePrefix> | ||
<AssemblyName>Touch.Client</AssemblyName> | ||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion> | ||
<UseXamMacFullFramework>true</UseXamMacFullFramework> | ||
<RestoreProjectStyle>PackageReference</RestoreProjectStyle> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> | ||
<OutputPath>bin\Debug</OutputPath> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<DefineConstants>DEBUG;NUNITLITE_NUGET</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' "> | ||
<OutputPath>bin\Release</OutputPath> | ||
<DebugType>full</DebugType> | ||
<Optimize>true</Optimize> | ||
<DefineConstants>NUNITLITE_NUGET</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
<MtouchVerbosity></MtouchVerbosity> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Xml" /> | ||
<Reference Include="System.Core" /> | ||
<Reference Include="Xamarin.Mac" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Folder Include="Resources\" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="..\..\..\NUnitLite\TouchRunner\HttpTextWriter.cs"> | ||
<Link>HttpTextWriter.cs</Link> | ||
</Compile> | ||
<Compile Include="..\..\..\NUnitLite\TouchRunner\NUnitOutputTextWriter.cs"> | ||
<Link>NUnitOutputTextWriter.cs</Link> | ||
</Compile> | ||
<Compile Include="..\..\..\NUnitLite\TouchRunner\Options.cs"> | ||
<Link>Options.cs</Link> | ||
</Compile> | ||
<Compile Include="..\..\..\NUnitLite\TouchRunner\TcpTextWriter.cs"> | ||
<Link>TcpTextWriter.cs</Link> | ||
</Compile> | ||
<Compile Include="..\..\..\NUnitLite\TouchRunner\TestRocks.cs"> | ||
<Link>TestRocks.cs</Link> | ||
</Compile> | ||
<Compile Include="..\..\..\NUnitLite\TouchRunner\TouchOptions.cs"> | ||
<Link>TouchOptions.cs</Link> | ||
</Compile> | ||
<Compile Include="..\..\..\NUnitLite\TouchRunner\TouchRunner.cs"> | ||
<Link>TouchRunner.cs</Link> | ||
</Compile> | ||
<Compile Include="..\..\..\NUnitLite\TouchRunner\MacRunner.cs"> | ||
<Link>MacRunner.cs</Link> | ||
</Compile> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<PackageReference Include="NUnitLite"> | ||
<Version>3.12.0</Version> | ||
</PackageReference> | ||
<PackageReference Include="NUnit.Extension.NUnitV2ResultWriter"> | ||
<Version>3.6.0</Version> | ||
</PackageReference> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Mac\Xamarin.Mac.CSharp.targets" /> | ||
</Project> |
78 changes: 78 additions & 0 deletions
78
Touch.Client/macOS/mobile/Touch.Client-macOS-mobile.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProjectGuid>{88A8A1AC-0829-4C98-8F4A-9FC23DC42A06}</ProjectGuid> | ||
<ProjectTypeGuids>{A3F8F2AB-B479-4A4A-A458-A89E7DC349F1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> | ||
<OutputType>Library</OutputType> | ||
<RootNamespace>Touch.Client</RootNamespace> | ||
<MonoMacResourcePrefix>Resources</MonoMacResourcePrefix> | ||
<AssemblyName>Touch.Client</AssemblyName> | ||
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion> | ||
<TargetFrameworkIdentifier>Xamarin.Mac</TargetFrameworkIdentifier> | ||
<RestoreProjectStyle>PackageReference</RestoreProjectStyle> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> | ||
<OutputPath>bin\Debug</OutputPath> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<DefineConstants>DEBUG;NUNITLITE_NUGET</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' "> | ||
<OutputPath>bin\Release</OutputPath> | ||
<DebugType>full</DebugType> | ||
<Optimize>true</Optimize> | ||
<DefineConstants>NUNITLITE_NUGET</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
<MtouchVerbosity></MtouchVerbosity> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Xml" /> | ||
<Reference Include="System.Core" /> | ||
<Reference Include="Xamarin.Mac" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Folder Include="Resources\" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="..\..\..\NUnitLite\TouchRunner\HttpTextWriter.cs"> | ||
<Link>HttpTextWriter.cs</Link> | ||
</Compile> | ||
<Compile Include="..\..\..\NUnitLite\TouchRunner\NUnitOutputTextWriter.cs"> | ||
<Link>NUnitOutputTextWriter.cs</Link> | ||
</Compile> | ||
<Compile Include="..\..\..\NUnitLite\TouchRunner\Options.cs"> | ||
<Link>Options.cs</Link> | ||
</Compile> | ||
<Compile Include="..\..\..\NUnitLite\TouchRunner\TcpTextWriter.cs"> | ||
<Link>TcpTextWriter.cs</Link> | ||
</Compile> | ||
<Compile Include="..\..\..\NUnitLite\TouchRunner\TestRocks.cs"> | ||
<Link>TestRocks.cs</Link> | ||
</Compile> | ||
<Compile Include="..\..\..\NUnitLite\TouchRunner\TouchOptions.cs"> | ||
<Link>TouchOptions.cs</Link> | ||
</Compile> | ||
<Compile Include="..\..\..\NUnitLite\TouchRunner\TouchRunner.cs"> | ||
<Link>TouchRunner.cs</Link> | ||
</Compile> | ||
<Compile Include="..\..\..\NUnitLite\TouchRunner\MacRunner.cs"> | ||
<Link>MacRunner.cs</Link> | ||
</Compile> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<PackageReference Include="NUnitLite"> | ||
<Version>3.12.0</Version> | ||
</PackageReference> | ||
<PackageReference Include="NUnit.Extension.NUnitV2ResultWriter"> | ||
<Version>3.6.0</Version> | ||
</PackageReference> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Mac\Xamarin.Mac.CSharp.targets" /> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters