Added Support for ios and wp81
This commit is contained in:
Родитель
a3554fbd28
Коммит
8f894a49dd
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -30,7 +30,6 @@ namespace NUnit.Runner.Services
|
|||
/// </summary>
|
||||
public class TestOptions
|
||||
{
|
||||
const string OutputFolderName = "NUnitTestOutput";
|
||||
const string OutputXmlReportName = "TestResults.xml";
|
||||
|
||||
private string _resultFilePath;
|
||||
|
@ -40,7 +39,7 @@ namespace NUnit.Runner.Services
|
|||
/// </summary>
|
||||
public TestOptions()
|
||||
{
|
||||
_resultFilePath = System.IO.Path.Combine(FileSystem.Current.LocalStorage.Path, OutputFolderName, OutputXmlReportName);
|
||||
_resultFilePath = System.IO.Path.Combine(FileSystem.Current.LocalStorage.Path, OutputXmlReportName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -24,12 +24,12 @@
|
|||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using NUnit.Framework.Interfaces;
|
||||
|
||||
using PCLStorage;
|
||||
|
||||
using CreationCollisionOption = PCLStorage.CreationCollisionOption;
|
||||
using FileAccess = PCLStorage.FileAccess;
|
||||
|
||||
namespace NUnit.Runner.Services
|
||||
|
@ -37,9 +37,7 @@ namespace NUnit.Runner.Services
|
|||
class XmlFileProcessor : TestResultProcessor
|
||||
{
|
||||
public XmlFileProcessor(TestOptions options)
|
||||
: base(options)
|
||||
{
|
||||
}
|
||||
: base(options) { }
|
||||
|
||||
public override async Task Process(ITestResult testResult)
|
||||
{
|
||||
|
@ -69,8 +67,11 @@ namespace NUnit.Runner.Services
|
|||
|
||||
await CreateFolderRecursive(outputFolderName);
|
||||
|
||||
IFolder outputFolder = new FileSystemFolder(outputFolderName);
|
||||
IFile xmlResultFile = await outputFolder.CreateFileAsync(outputXmlReportName, CreationCollisionOption.ReplaceExisting);
|
||||
IFolder outputFolder =
|
||||
await FileSystem.Current.GetFolderFromPathAsync(outputFolderName, CancellationToken.None);
|
||||
|
||||
IFile xmlResultFile =
|
||||
await outputFolder.CreateFileAsync(outputXmlReportName, CreationCollisionOption.ReplaceExisting);
|
||||
using (var resultFileStream = new StreamWriter(await xmlResultFile.OpenAsync(FileAccess.ReadAndWrite)))
|
||||
{
|
||||
string xmlString = testResult.ToXml(true).OuterXml;
|
||||
|
@ -92,13 +93,26 @@ namespace NUnit.Runner.Services
|
|||
|
||||
for (int i = 0; i < segments.Length - 1; i++)
|
||||
{
|
||||
IFolder folder = new FileSystemFolder(path);
|
||||
|
||||
var res = await folder.CheckExistsAsync(segments[i + 1]);
|
||||
if (res != ExistenceCheckResult.FolderExists)
|
||||
try
|
||||
{
|
||||
await folder.CreateFolderAsync(segments[i + 1], CreationCollisionOption.OpenIfExists);
|
||||
#if __DROID__
|
||||
IFolder folder = await FileSystem.Current.GetFolderFromPathAsync(path, CancellationToken.None);
|
||||
#elif __IOS__
|
||||
IFolder folder = await FileSystem.Current.GetFolderFromPathAsync(path, CancellationToken.None);
|
||||
#else
|
||||
IFolder folder = await FileSystem.Current.GetFolderFromPathAsync(path.Replace('/', '\\'), CancellationToken.None);
|
||||
#endif
|
||||
var res = await folder.CheckExistsAsync(segments[i + 1]);
|
||||
if (res != ExistenceCheckResult.FolderExists)
|
||||
{
|
||||
await folder.CreateFolderAsync(segments[i + 1], CreationCollisionOption.OpenIfExists);
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// ignore
|
||||
}
|
||||
|
||||
path = Path.Combine(path, segments[i + 1]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ namespace NUnit.Runner.Tests
|
|||
CreateXmlResultFile = true,
|
||||
|
||||
// Choose a diffrent path for the xml result file
|
||||
// ResultFilePath = Path.Combine(Environment.ExternalStorageDirectory.Path, Environment.DirectoryDownloads, "Nunit", "Results.xml")
|
||||
ResultFilePath = Path.Combine(Environment.ExternalStorageDirectory.Path, Environment.DirectoryDownloads, "Nunit_123", "Results.xml")
|
||||
};
|
||||
|
||||
LoadApplication(nunit);
|
||||
|
|
|
@ -21,6 +21,8 @@
|
|||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
// ***********************************************************************
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using Foundation;
|
||||
|
||||
using NUnit.Runner.Services;
|
||||
|
@ -64,7 +66,10 @@ namespace NUnit.Runner.Tests
|
|||
//TcpWriterParameters = new TcpWriterInfo("192.168.0.108", 13000),
|
||||
|
||||
// Creates a NUnit Xml result file on the host file system using PCLStorage library.
|
||||
CreateXmlResultFile = false
|
||||
CreateXmlResultFile = true,
|
||||
|
||||
// Choose a diffrent path for the xml result file (ios file share / library directory)
|
||||
ResultFilePath = Path.Combine(NSFileManager.DefaultManager.GetUrls(NSSearchPathDirectory.LibraryDirectory, NSSearchPathDomain.User)[0].Path, "Results.xml")
|
||||
};
|
||||
|
||||
LoadApplication(nunit);
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
</dict>
|
||||
<dict/>
|
||||
</plist>
|
||||
|
||||
|
|
|
@ -1,52 +1,56 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>UIDeviceFamily</key>
|
||||
<array>
|
||||
<integer>1</integer>
|
||||
<integer>2</integer>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>MinimumOSVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>nunit.runner</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.yourcompany.nunit.runner</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleIconFiles</key>
|
||||
<array>
|
||||
<string>Icon-60@2x</string>
|
||||
<string>Icon-60@3x</string>
|
||||
<string>Icon-76</string>
|
||||
<string>Icon-76@2x</string>
|
||||
<string>Default</string>
|
||||
<string>Default@2x</string>
|
||||
<string>Default-568h@2x</string>
|
||||
<string>Default-Portrait</string>
|
||||
<string>Default-Portrait@2x</string>
|
||||
<string>Icon-Small-40</string>
|
||||
<string>Icon-Small-40@2x</string>
|
||||
<string>Icon-Small-40@3x</string>
|
||||
<string>Icon-Small</string>
|
||||
<string>Icon-Small@2x</string>
|
||||
<string>Icon-Small@3x</string>
|
||||
</array>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>UIDeviceFamily</key>
|
||||
<array>
|
||||
<integer>1</integer>
|
||||
<integer>2</integer>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>MinimumOSVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>nunit.runner</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.yourcompany.nunit.runner</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleIconFiles</key>
|
||||
<array>
|
||||
<string>Icon-60@2x</string>
|
||||
<string>Icon-60@3x</string>
|
||||
<string>Icon-76</string>
|
||||
<string>Icon-76@2x</string>
|
||||
<string>Default</string>
|
||||
<string>Default@2x</string>
|
||||
<string>Default-568h@2x</string>
|
||||
<string>Default-Portrait</string>
|
||||
<string>Default-Portrait@2x</string>
|
||||
<string>Icon-Small-40</string>
|
||||
<string>Icon-Small-40@2x</string>
|
||||
<string>Icon-Small-40@3x</string>
|
||||
<string>Icon-Small</string>
|
||||
<string>Icon-Small@2x</string>
|
||||
<string>Icon-Small@3x</string>
|
||||
</array>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string></string>
|
||||
<key>UIFileSharingEnabled</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
|
@ -25,6 +25,8 @@
|
|||
<MtouchLink>None</MtouchLink>
|
||||
<MtouchDebug>true</MtouchDebug>
|
||||
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
|
||||
<CodesignKey>iPhone Developer: Christian Schmid (R65G567HMV)</CodesignKey>
|
||||
<CodesignProvision>dccfb495-a21d-4e42-8f9b-09f3126395e5</CodesignProvision>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
|
||||
<DebugType>none</DebugType>
|
||||
|
@ -47,9 +49,10 @@
|
|||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<MtouchArch>ARMv7, ARM64</MtouchArch>
|
||||
<CodesignKey>iPhone Developer</CodesignKey>
|
||||
<CodesignKey>iPhone Developer: Christian Schmid (R65G567HMV)</CodesignKey>
|
||||
<MtouchDebug>true</MtouchDebug>
|
||||
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
|
||||
<CodesignProvision>dccfb495-a21d-4e42-8f9b-09f3126395e5</CodesignProvision>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
|
||||
<DebugType>none</DebugType>
|
||||
|
@ -91,7 +94,9 @@
|
|||
<Compile Include="Main.cs" />
|
||||
<Compile Include="AppDelegate.cs" />
|
||||
<None Include="Entitlements.plist" />
|
||||
<None Include="Info.plist" />
|
||||
<None Include="Info.plist">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<ITunesArtwork Include="iTunesArtwork" />
|
||||
<None Include="packages.config" />
|
||||
|
|
|
@ -53,7 +53,11 @@ namespace NUnit.Runner.Tests
|
|||
//TcpWriterParameters = new TcpWriterInfo("192.168.0.108", 13000),
|
||||
|
||||
// Creates a NUnit Xml result file on the host file system using PCLStorage library.
|
||||
CreateXmlResultFile = false
|
||||
CreateXmlResultFile = false,
|
||||
|
||||
// Choose a diffrent path for the xml result file
|
||||
// Windows phone 8.1 no permission to create subfolder in Windows.Storage.ApplicationData.Current.LocalFolder
|
||||
// ResultFilePath = System.IO.Path.Combine(Windows.Storage.ApplicationData.Current.TemporaryFolder.Path, "Nunit", "Results.xml")
|
||||
};
|
||||
|
||||
LoadApplication(nunit);
|
||||
|
|
|
@ -25,5 +25,6 @@
|
|||
<Capabilities>
|
||||
<Capability Name="internetClient" />
|
||||
<Capability Name="privateNetworkClientServer" />
|
||||
<uap:Capability Name="removableStorage" />
|
||||
</Capabilities>
|
||||
</Package>
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -53,7 +53,11 @@ namespace NUnit.Runner.Tests
|
|||
//TcpWriterParameters = new TcpWriterInfo("192.168.0.108", 13000),
|
||||
|
||||
// Creates a NUnit Xml result file on the host file system using PCLStorage library.
|
||||
CreateXmlResultFile = false
|
||||
CreateXmlResultFile = false,
|
||||
|
||||
// Choose a diffrent path for the xml result file
|
||||
// Windows phone 8.1 no permission to create subfolder in Windows.Storage.ApplicationData.Current.LocalFolder
|
||||
// ResultFilePath = System.IO.Path.Combine(Windows.Storage.ApplicationData.Current.TemporaryFolder.Path, "Nunit", "Results.xml")
|
||||
};
|
||||
|
||||
LoadApplication(nunit);
|
||||
|
|
|
@ -1,44 +1,30 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest" xmlns:m2="http://schemas.microsoft.com/appx/2013/manifest" xmlns:m3="http://schemas.microsoft.com/appx/2014/manifest" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest">
|
||||
|
||||
<Identity Name="c537636a-785a-4fc3-9764-41ab4c6312da"
|
||||
Publisher="CN=Rob"
|
||||
Version="1.0.0.0" />
|
||||
|
||||
<mp:PhoneIdentity PhoneProductId="c537636a-785a-4fc3-9764-41ab4c6312da" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
|
||||
|
||||
<Identity Name="c537636a-785a-4fc3-9764-41ab4c6312da" Publisher="CN=Rob" Version="1.0.0.0" />
|
||||
<mp:PhoneIdentity PhoneProductId="c537636a-785a-4fc3-9764-41ab4c6312da" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
|
||||
<Properties>
|
||||
<DisplayName>nunit.runner.tests.wp81</DisplayName>
|
||||
<PublisherDisplayName>Rob</PublisherDisplayName>
|
||||
<Logo>Assets\StoreLogo.png</Logo>
|
||||
</Properties>
|
||||
|
||||
<Prerequisites>
|
||||
<OSMinVersion>6.3.1</OSMinVersion>
|
||||
<OSMaxVersionTested>6.3.1</OSMaxVersionTested>
|
||||
</Prerequisites>
|
||||
|
||||
<Resources>
|
||||
<Resource Language="x-generate"/>
|
||||
<Resource Language="x-generate" />
|
||||
</Resources>
|
||||
|
||||
<Applications>
|
||||
<Application Id="App"
|
||||
Executable="$targetnametoken$.exe"
|
||||
EntryPoint="nunit.runner.tests.wp81.App">
|
||||
<m3:VisualElements
|
||||
DisplayName="nunit.runner.tests.wp81"
|
||||
Square150x150Logo="Assets\Logo.png"
|
||||
Square44x44Logo="Assets\SmallLogo.png"
|
||||
Description="nunit.runner.tests.wp81"
|
||||
ForegroundText="light"
|
||||
BackgroundColor="transparent">
|
||||
<m3:DefaultTile Wide310x150Logo="Assets\WideLogo.png" Square71x71Logo="Assets\Square71x71Logo.png"/>
|
||||
<m3:SplashScreen Image="Assets\SplashScreen.png"/>
|
||||
</m3:VisualElements>
|
||||
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="nunit.runner.tests.wp81.App">
|
||||
<m3:VisualElements DisplayName="nunit.runner.tests.wp81" Square150x150Logo="Assets\Logo.png" Square44x44Logo="Assets\SmallLogo.png" Description="nunit.runner.tests.wp81" ForegroundText="light" BackgroundColor="transparent">
|
||||
<m3:DefaultTile Wide310x150Logo="Assets\WideLogo.png" Square71x71Logo="Assets\Square71x71Logo.png">
|
||||
</m3:DefaultTile>
|
||||
<m3:SplashScreen Image="Assets\SplashScreen.png" />
|
||||
</m3:VisualElements>
|
||||
</Application>
|
||||
</Applications>
|
||||
<Capabilities>
|
||||
<Capability Name="internetClientServer" />
|
||||
<Capability Name="removableStorage" />
|
||||
</Capabilities>
|
||||
</Package>
|
Загрузка…
Ссылка в новой задаче