Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions poc/TestOfTestFramework/nano.runsettings
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@
</RunConfiguration>
<nanoFrameworkAdapter>
<Logging>None</Logging>
<IsRealHardware>True</IsRealHardware>
<RealHardwarePort></RealHardwarePort>
</nanoFrameworkAdapter>
</RunSettings>
35 changes: 35 additions & 0 deletions source/TestAdapter/DeploymentAssembly.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
//
// Copyright (c) .NET Foundation and Contributors
// See LICENSE file in the project root for full license information.
//

using System.Collections.Generic;

namespace nanoFramework.TestPlatform.TestAdapter
{
public class DeploymentAssembly
{
/// <summary>
/// Path to the EXE or DLL file.
/// </summary>
public string Path { get; set; }

/// <summary>
/// Assembly version of the EXE or DLL.
/// </summary>
public string Version { get; set; }

/// <summary>
/// Required version of the native implementation of the class library.
/// Only used in class libraries. Can be empty on the core library and user EXE and DLLs.
/// </summary>
public string NativeVersion { get; set; }

public DeploymentAssembly(string path, string version, string nativeVersion)
{
Path = path;
Version = version;
NativeVersion = nativeVersion;
}
}
}
451 changes: 393 additions & 58 deletions source/TestAdapter/Executor.cs

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions source/TestAdapter/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace nanoFramework.TestPlatform.TestAdapter
{
/// <summary>
/// Settings for the nanoFramweork tests
/// Settings for the nanoFramework tests
/// </summary>
public class Settings
{
Expand All @@ -23,12 +23,12 @@ public class Settings
/// <summary>
/// True to run the tests on real hardware
/// </summary>
public bool IsRealHarware { get; set; } = false;
public bool IsRealHardware { get; set; } = false;

/// <summary>
/// The serial port number to run the tests on a real hardware
/// </summary>
public string RealHarwarePort { get; set; } = string.Empty;
public string RealHardwarePort { get; set; } = string.Empty;

/// <summary>
/// Level of logging for test execution.
Expand All @@ -55,16 +55,16 @@ public static Settings Extract(XmlNode node)
}
}

var isrealhard = node.SelectSingleNode(nameof(IsRealHarware))?.FirstChild;
var isrealhard = node.SelectSingleNode(nameof(IsRealHardware))?.FirstChild;
if (isrealhard != null && isrealhard.NodeType == XmlNodeType.Text)
{
settings.IsRealHarware = isrealhard.Value.ToLower() == "true" ? true : false;
settings.IsRealHardware = isrealhard.Value.ToLower() == "true" ? true : false;
}

var realhardport = node.SelectSingleNode(nameof(RealHarwarePort))?.FirstChild;
var realhardport = node.SelectSingleNode(nameof(RealHardwarePort))?.FirstChild;
if (realhardport != null && realhardport.NodeType == XmlNodeType.Text)
{
settings.RealHarwarePort = realhardport.Value;
settings.RealHardwarePort = realhardport.Value;
}

var loggingLevel = node.SelectSingleNode(nameof(Logging))?.FirstChild;
Expand Down
27 changes: 27 additions & 0 deletions source/TestAdapter/nanoFramework - Backup.TestAdapter.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<Project Sdk="Microsoft.NET.Sdk">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ellerbach you need to remove this BACKUP file... 😁


<PropertyGroup>
<TargetFramework>net4.8</TargetFramework>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.TestPlatform.ObjectModel" Version="16.9.1" />
<PackageReference Include="nanoFramework.nanoCLR.Win32" GeneratePathProperty="true">
<Version>1.6.1-preview.223</Version>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Nerdbank.GitVersioning">
<Version>3.3.37</Version>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
<Target Name="SetNanoCLRLocation" AfterTargets="Build">
<Copy SourceFiles="$(PkgnanoFramework_nanoCLR_Win32)\tools\nanoFramework.nanoCLR.exe" DestinationFolder="$(TargetDir)" SkipUnchangedFiles="false">
</Copy>
</Target>
<Import Project="..\TestFrameworkShared\TestFrameworkShared.projitems" Label="Shared" />
</Project>
4 changes: 3 additions & 1 deletion source/TestAdapter/nanoFramework.TestAdapter.csproj
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net4.6</TargetFramework>
<TargetFramework>net4.8</TargetFramework>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ICSharpCode.Decompiler" Version="6.2.1.6137" />
<PackageReference Include="Microsoft.TestPlatform.ObjectModel" Version="16.9.1" />
<PackageReference Include="nanoFramework.nanoCLR.Win32" GeneratePathProperty="true">
<Version>1.6.1-preview.223</Version>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="nanoFramework.Tools.Debugger.Net" Version="1.29.0-preview.1" />
<PackageReference Include="Nerdbank.GitVersioning">
<Version>3.3.37</Version>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
4 changes: 2 additions & 2 deletions source/package.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
</packageTypes>
</metadata>
<files>
<file src="TestAdapter\bin\Debug\net4.6\*.dll" target="lib/net46" />
<file src="TestAdapter\bin\Debug\net4.6\*.*" target="lib/net46" />
<file src="TestAdapter\bin\Debug\net4.8\*.dll" target="lib/net48" />
<file src="TestAdapter\bin\Debug\net4.8\*.*" target="lib/net48" />

<file src="UnitTestLauncher\bin\Debug\nanoFramework.TestFramework.*" target="lib" />
<file src="UnitTestLauncher\bin\Debug\nanoFramework.UnitTestLauncher.*" target="lib" />
Expand Down
3 changes: 2 additions & 1 deletion source/runsettings/nano.runsettings
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<TargetFrameworkVersion>Framework40</TargetFrameworkVersion>
</RunConfiguration>
<nanoFrameworkAdapter>
<Logging>None</Logging>
<Logging>None</Logging>
<IsRealHardware>False</IsRealHardware>
</nanoFrameworkAdapter>
</RunSettings>