Skip to content

Commit

Permalink
Ignore cpp test
Browse files Browse the repository at this point in the history
  • Loading branch information
smadala committed Dec 12, 2016
2 parents b621e4c + 0d2b9e0 commit e6bd574
Show file tree
Hide file tree
Showing 9 changed files with 133 additions and 111 deletions.
2 changes: 1 addition & 1 deletion TestPlatform.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.25929.2
VisualStudioVersion = 15.0.26008.9
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{ED0C35EB-7F31-4841-A24F-8EB708FFA959}"
EndProject
Expand Down
7 changes: 4 additions & 3 deletions scripts/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ Param(
[System.Boolean] $Localized = $false,

[Parameter(Mandatory=$false)]
[Alias("real")]
[System.Boolean] $RealBuild = $false
[Alias("ci")]
[Switch] $CIBuild = $false
)

$ErrorActionPreference = "Stop"
Expand Down Expand Up @@ -68,6 +68,7 @@ $TPB_Configuration = $Configuration
$TPB_TargetRuntime = $TargetRuntime
$TPB_Version = $Version
$TPB_VersionSuffix = $VersionSuffix
$TPB_CIBuild = $CIBuild

# Capture error state in any step globally to modify return code
$Script:ScriptFailed = $false
Expand Down Expand Up @@ -149,7 +150,7 @@ function Invoke-Build

Write-Log ".. .. Build: Source: $TPB_Solution"
Write-Verbose "$dotnetExe build $TPB_Solution --configuration $TPB_Configuration --version-suffix $TPB_VersionSuffix -v:minimal -p:Version=$TPB_Version"
& $dotnetExe build $TPB_Solution --configuration $TPB_Configuration --version-suffix $TPB_VersionSuffix -v:minimal -p:Version=$TPB_Version
& $dotnetExe build $TPB_Solution --configuration $TPB_Configuration --version-suffix $TPB_VersionSuffix -v:minimal -p:Version=$TPB_Version -p:CIBuild=$TPB_CIBuild
Write-Log ".. .. Build: Complete."

if ($lastExitCode -ne 0) {
Expand Down
4 changes: 2 additions & 2 deletions scripts/build/TestPlatform.Settings.targets
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
<VersionSuffix Condition="'$(VersionSuffix)' == ''">dev</VersionSuffix>

<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<PublicSign>true</PublicSign>
<!--<DelaySign>true</DelaySign>-->
<PublicSign Condition="'$(CIBuild)' == '' or '$(CIBuild)' == 'false'">true</PublicSign>
<DelaySign Condition="'$(CIBuild)' == 'true'">true</DelaySign>
<!--<GenerateDocumentationFile>true</GenerateDocumentationFile>-->
<AssemblyOriginatorKeyFile>$(TestPlatformRoot)scripts/key.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
Expand Down
39 changes: 27 additions & 12 deletions src/Microsoft.TestPlatform.Extensions.TrxLogger/TrxLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -366,20 +366,35 @@ internal void TestRunCompleteHandler(object sender, TestRunCompleteEventArgs e)
if (string.IsNullOrEmpty(trxFileName))
{
// save the xml to file in testResultsFolder
trxFileName = this.GetTrxFileName(TrxFileDirectory, this.testRun.RunConfiguration.RunDeploymentRootDirectory);
// [RunDeploymentRootDirectory] Replace white space with underscore from trx file name to make it command line friendly
trxFileName = this.GetTrxFileName(TrxFileDirectory, this.testRun.RunConfiguration.RunDeploymentRootDirectory.Replace(' ', '_'));
}

try
{
FileStream fs = File.OpenWrite(trxFileName);
rootElement.OwnerDocument.Save(fs);
String resultsFileMessage = String.Format(CultureInfo.CurrentCulture, TrxLoggerResources.TrxLoggerResultsFile, trxFileName);
Console.WriteLine(resultsFileMessage);
}
catch (System.UnauthorizedAccessException fileWriteException)
{
Console.WriteLine(fileWriteException.Message);
}
this.PopulateTrxFile(trxFileName, rootElement);
}
}

/// <summary>
/// populate trx file from the xmlelement
/// </summary>
/// <param name="trxFileName">
/// Trx full path
/// </param>
/// <param name="rootElement">
/// XmlElement.
/// </param>
internal virtual void PopulateTrxFile(string trxFileName, XmlElement rootElement)
{
try
{
FileStream fs = File.OpenWrite(trxFileName);
rootElement.OwnerDocument.Save(fs);
String resultsFileMessage = String.Format(CultureInfo.CurrentCulture, TrxLoggerResources.TrxLoggerResultsFile, trxFileName);
Console.WriteLine(resultsFileMessage);
}
catch (System.UnauthorizedAccessException fileWriteException)
{
Console.WriteLine(fileWriteException.Message);
}
}

Expand Down
39 changes: 14 additions & 25 deletions src/package/package.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--<Target Name="WorkAroundToSkipPreprocessingBinaries" BeforeTargets="RunProduceContentAssets">
<ItemGroup>
<FileDependencies>
<codeLanguage Condition="'%(FileDependencies.codeLanguage)' == 'any' and '%(FileDependencies.Extension)' == '.dll'">binary</codeLanguage>
</FileDependencies>
</ItemGroup>
</Target>-->
<PropertyGroup>
<TestPlatformRoot Condition="$(TestPlatformRoot) == ''">../../</TestPlatformRoot>
</PropertyGroup>
<Import Project="$(TestPlatformRoot)scripts/build/TestPlatform.Settings.targets" />

<PropertyGroup>
<TargetFrameworks>net46;netcoreapp1.0</TargetFrameworks>
<AssemblyName>package</AssemblyName>
Expand All @@ -21,13 +27,11 @@
<PropertyGroup Condition="'$(TargetFramework)' != 'netcoreapp1.0'">
<RuntimeIdentifier>win7-x64</RuntimeIdentifier>
</PropertyGroup>

<ItemGroup>
<Content Include="[Content_Types].xml;extension.vsixmanifest;License.rtf;TestPlatform.ObjectModel.manifest;TestPlatform.ObjectModel.x86.manifest">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</Content>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Microsoft.TestPlatform.Client\Microsoft.TestPlatform.Client.csproj" />
<ProjectReference Include="..\Microsoft.TestPlatform.Common\Microsoft.TestPlatform.Common.csproj" />
Expand All @@ -42,16 +46,7 @@
<FromP2P>true</FromP2P>
</ProjectReference>
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net46' ">
<!--<PackageReference Include="Microsoft.Internal.TestPlatform.Extensions">
<Version>15.0.0</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.Internal.Dia">
<Version>14.0.0</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>-->
<PackageReference Include="NuGet.CommandLine">
<Version>3.4.3</Version>
<PrivateAssets>All</PrivateAssets>
Expand All @@ -60,26 +55,20 @@
<Version>0.1.2</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="MicroBuild.Core">
<Version>0.2.0</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">
<PackageReference Include="Microsoft.NETCore.App">
<Version>1.0.0</Version>
</PackageReference>
</ItemGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DefineConstants>$(DefineConstants);RELEASE</DefineConstants>
</PropertyGroup>

<!--<Target Name="WorkAroundToSkipPreprocessingBinaries" BeforeTargets="RunProduceContentAssets">
<ItemGroup>
<FileDependencies>
<codeLanguage Condition="'%(FileDependencies.codeLanguage)' == 'any' and '%(FileDependencies.Extension)' == '.dll'">binary</codeLanguage>
</FileDependencies>
</ItemGroup>
</Target>-->
<Import Project="$(TestPlatformRoot)scripts\build\TestPlatform.targets" />
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public virtual void ChutzpahRunAllTestExecution()
this.ValidateSummaryStatus(1, 1, 0);
}

[Ignore]
[TestMethod]
public virtual void CPPRunAllTestExecution()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<Reference Include="System.Runtime" />
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
Expand Down
Loading

0 comments on commit e6bd574

Please sign in to comment.