Skip to content

Commit

Permalink
Add Chutzpah test case
Browse files Browse the repository at this point in the history
  • Loading branch information
smadala committed Nov 3, 2016
1 parent 1b756c8 commit 515385a
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 52 deletions.
27 changes: 15 additions & 12 deletions TestPlatform.sln
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.TestPlatform.TestUtilities", "test\Microsoft.TestPlatform.TestUtilities\Microsoft.TestPlatform.TestUtilities.xproj", "{F52A4D48-90B3-4004-8C98-D2786CC9B965}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "TestAssets", "TestAssets", "{50D7D355-08F6-4DFD-AEAA-9BCE41C94C18}"
ProjectSection(SolutionItems) = preProject
test\TestAssets\test.js = test\TestAssets\test.js
EndProjectSection
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "SimpleDataCollector", "test\TestAssets\SimpleDataCollector\SimpleDataCollector.xproj", "{D7F7A9F5-5646-44E7-990C-500844E9272E}"
EndProject
Expand All @@ -111,9 +114,9 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "testhost.UnitTests", "test\
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.TestPlatform.AcceptanceTests", "test\Integration\Microsoft.TestPlatform.AcceptanceTests\Microsoft.TestPlatform.AcceptanceTests.xproj", "{70A1644A-7434-48CD-A9DE-450C0DA88B3F}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "XUnitTestProject", "test\TestAssets\XUnitTestProject\XUnitTestProject.xproj", "{EC4D597C-3AC6-48EA-84FF-23CFECBA5F92}"
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "XUTestProject", "test\TestAssets\XUTestProject\XUTestProject.xproj", "{AC28D648-6AC1-4C80-8972-B58C8935414E}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "NUnitTestProject", "test\TestAssets\NUnitTestProject\NUnitTestProject.xproj", "{24EC916A-02FA-485D-B230-4E1974C99077}"
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "NUTestProject", "test\TestAssets\NUTestProject\NUTestProject.xproj", "{CC8C8F75-0DE0-4AF4-BFF8-92F0362BCF46}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -281,14 +284,14 @@ Global
{70A1644A-7434-48CD-A9DE-450C0DA88B3F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{70A1644A-7434-48CD-A9DE-450C0DA88B3F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{70A1644A-7434-48CD-A9DE-450C0DA88B3F}.Release|Any CPU.Build.0 = Release|Any CPU
{EC4D597C-3AC6-48EA-84FF-23CFECBA5F92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EC4D597C-3AC6-48EA-84FF-23CFECBA5F92}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EC4D597C-3AC6-48EA-84FF-23CFECBA5F92}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EC4D597C-3AC6-48EA-84FF-23CFECBA5F92}.Release|Any CPU.Build.0 = Release|Any CPU
{24EC916A-02FA-485D-B230-4E1974C99077}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{24EC916A-02FA-485D-B230-4E1974C99077}.Debug|Any CPU.Build.0 = Debug|Any CPU
{24EC916A-02FA-485D-B230-4E1974C99077}.Release|Any CPU.ActiveCfg = Release|Any CPU
{24EC916A-02FA-485D-B230-4E1974C99077}.Release|Any CPU.Build.0 = Release|Any CPU
{AC28D648-6AC1-4C80-8972-B58C8935414E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AC28D648-6AC1-4C80-8972-B58C8935414E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AC28D648-6AC1-4C80-8972-B58C8935414E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AC28D648-6AC1-4C80-8972-B58C8935414E}.Release|Any CPU.Build.0 = Release|Any CPU
{CC8C8F75-0DE0-4AF4-BFF8-92F0362BCF46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CC8C8F75-0DE0-4AF4-BFF8-92F0362BCF46}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CC8C8F75-0DE0-4AF4-BFF8-92F0362BCF46}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CC8C8F75-0DE0-4AF4-BFF8-92F0362BCF46}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -339,7 +342,7 @@ Global
{96B93E28-A33D-48E5-8793-73F686D3B999} = {50D7D355-08F6-4DFD-AEAA-9BCE41C94C18}
{09599F77-A1F2-4366-BB8A-B4B90E05BCBC} = {463031A2-7F16-4E38-9944-1F5161D04933}
{70A1644A-7434-48CD-A9DE-450C0DA88B3F} = {6DA46479-C688-4296-A6E7-F20C20CDA3A9}
{EC4D597C-3AC6-48EA-84FF-23CFECBA5F92} = {50D7D355-08F6-4DFD-AEAA-9BCE41C94C18}
{24EC916A-02FA-485D-B230-4E1974C99077} = {50D7D355-08F6-4DFD-AEAA-9BCE41C94C18}
{AC28D648-6AC1-4C80-8972-B58C8935414E} = {50D7D355-08F6-4DFD-AEAA-9BCE41C94C18}
{CC8C8F75-0DE0-4AF4-BFF8-92F0362BCF46} = {50D7D355-08F6-4DFD-AEAA-9BCE41C94C18}
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,6 @@ public class ExecutionTests : IntegrationTestBase
{
protected string framework = ".NETFramework,Version=v4.6";

[Ignore]
[TestMethod]
public void RunAllTestExecutionWithNETCoreApp()
{
var arguments = PrepareArguments(this.GetSampleTestAssembly(), this.GetTestAdapterPath(), string.Empty, this.framework);
arguments = string.Concat(arguments, " /Framework:.NETCoreApp,Version=v1.0");
this.InvokeVsTest(arguments);
this.ValidateSummaryStatus(1, 1, 1);

// TODO validate it is running .netcore
}

[TestMethod]
public void RunMultipleTestAssemblies()
{
Expand Down Expand Up @@ -93,12 +81,11 @@ public void RunSelectedTestsWithCategoryTrait()
this.ValidateSummaryStatus(0, 1, 0);
}

[Ignore]
[TestMethod]
public void RunSelectedTestsWithClassNameTrait()
{
var arguments = PrepareArguments(this.GetSampleTestAssembly(), this.GetTestAdapterPath(), string.Empty, this.framework);
arguments = string.Concat(arguments, " /TestCaseFilter:\"ClassName=UnitTest1\"");
arguments = string.Concat(arguments, " /TestCaseFilter:\"ClassName=SampleUnitTestProject.UnitTest1\"");
this.InvokeVsTest(arguments);
this.ValidateSummaryStatus(1, 1, 1);
}
Expand Down Expand Up @@ -256,19 +243,23 @@ public void NUnitRunAllTestExecution()
this.ValidateSummaryStatus(1, 1, 0);
}

/*
[TestMethod]
public void ChutzpahRunAllTestExecution()
{
this.InvokeVsTestForExecution(this.GetAssetFullPath("ChutzpahTestProject.dll"), this.GetTestAdapterPath(UnitTestFramework.Chutzpah));
var testJSFileAbsolutePath = Path.Combine(this.testEnvironment.TestAssetsPath, "test.js");
this.InvokeVsTestForExecution(testJSFileAbsolutePath, this.GetTestAdapterPath(UnitTestFramework.Chutzpah));
this.ValidateSummaryStatus(1, 1, 0);
}

[Ignore]
[TestMethod]
public void CPPRunAllTestExecution()
{
this.InvokeVsTestForExecution(this.GetAssetFullPath("CPPUnitTestProject.dll"), this.GetTestAdapterPath(UnitTestFramework.CPP));
this.ValidateSummaryStatus(1, 1, 0);
}*/
var assemblyRelativePath =
@"microsoft.testplatform.testasset.nativecpp\1.0.0\contentFiles\any\any\Microsoft.TestPlatform.TestAsset.NativeCPP.dll";
var assemblyAbsolutePath = Path.Combine(this.testEnvironment.PackageDirectory, assemblyRelativePath);
this.InvokeVsTestForExecution(assemblyAbsolutePath, string.Empty);
this.ValidateSummaryStatus(1, 0, 0);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ namespace Microsoft.TestPlatform.AcceptanceTests

/*[TestClass]*/
//TODO enable netcore test when test asset project migrate to csproj
public class NetCoreExecutionTest:ExecutionTests

/// <summary>
/// Acceptance tests for netcore framework
/// </summary>
public class NetCoreExecutionTest : ExecutionTests
{
[TestInitialize]
public void SetTestFrameWork()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@
"version": "1.1.3-preview",
"exclude": "compile"
},

"StyleCop.Analyzers": {
"version": "1.0.0",
"type": "build"
},

"Microsoft.TestPlatform.TestUtilities": "15.0.0-*"
"StyleCop.Analyzers": {
"version": "1.0.0",
"type": "build"
},

"Microsoft.TestPlatform.TestUtilities": "15.0.0-*",
"Chutzpah": "4.2.4"
},

"frameworks": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public class IntegrationTestBase
private const string TestAdapterRelativePath = @"MSTest.TestAdapter\1.1.3-preview\build\_common";
private const string NUnitTestAdapterRelativePath = @"nunittestadapter\1.2.0\lib";
private const string XUnitTestAdapterRelativePath = @"xunit.runner.visualstudio\2.1.0\build\_common";
private const string ChutzpahTestAdapterRelativePath = @"chutzpah\4.2.4\tools";

public enum UnitTestFramework
{
Expand Down Expand Up @@ -216,6 +217,10 @@ protected string GetTestAdapterPath(UnitTestFramework testFramework = UnitTestFr
{
adapterRelativePath = XUnitTestAdapterRelativePath;
}
else if (testFramework == UnitTestFramework.Chutzpah)
{
adapterRelativePath = ChutzpahTestAdapterRelativePath;
}

return this.testEnvironment.GetNugetPackage(adapterRelativePath);
}
Expand Down
2 changes: 1 addition & 1 deletion test/TestAssets/NUTestProject/NUTestProject.xproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>24ec916a-02fa-485d-b230-4e1974c99077</ProjectGuid>
<ProjectGuid>cc8c8f75-0de0-4af4-bff8-92f0362bcf46</ProjectGuid>
<RootNamespace>xUnitTestProject</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\..\artifacts\</OutputPath>
Expand Down
9 changes: 0 additions & 9 deletions test/TestAssets/XUTestProject/XUTestProject.nuget.props

This file was deleted.

6 changes: 2 additions & 4 deletions test/TestAssets/XUTestProject/XUTestProject.xproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,16 @@
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>

<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>ec4d597c-3ac6-48ea-84ff-23cfecba5f92</ProjectGuid>
<ProjectGuid>ac28d648-6ac1-4c80-8972-b58c8935414e</ProjectGuid>
<RootNamespace>xUnitTestProject</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\..\artifacts\</OutputPath>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
</PropertyGroup>

<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>
</Project>
10 changes: 10 additions & 0 deletions test/TestAssets/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
test("TestMethod1", function () {
ok(true);

});

test("TestMethod2", function () {
ok(false);

});

0 comments on commit 515385a

Please sign in to comment.