Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 9b9e9e6

Browse files
committed
Merge pull request #2126 from mellinoe/add-diag.tools-tests
Add GeneratedCodeAttribute tests (System.Diagnostics.Tools partial facade)
2 parents bda22ee + 1a37f5b commit 9b9e9e6

File tree

5 files changed

+635
-0
lines changed

5 files changed

+635
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 2013
4+
VisualStudioVersion = 12.0.31101.0
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Diagnostics.Tools.CoreCLR", "src\System.Diagnostics.Tools.CoreCLR.csproj", "{0B68298B-4672-4CA0-AD25-2F9ABEA1FF95}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Diagnostics.Tools.Tests", "tests\System.Diagnostics.Tools.Tests.csproj", "{41BF89E4-8C67-45A6-8044-13009E363220}"
9+
EndProject
10+
Global
11+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
12+
Debug|Any CPU = Debug|Any CPU
13+
Release|Any CPU = Release|Any CPU
14+
EndGlobalSection
15+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
16+
{0B68298B-4672-4CA0-AD25-2F9ABEA1FF95}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17+
{0B68298B-4672-4CA0-AD25-2F9ABEA1FF95}.Debug|Any CPU.Build.0 = Debug|Any CPU
18+
{0B68298B-4672-4CA0-AD25-2F9ABEA1FF95}.Release|Any CPU.ActiveCfg = Release|Any CPU
19+
{0B68298B-4672-4CA0-AD25-2F9ABEA1FF95}.Release|Any CPU.Build.0 = Release|Any CPU
20+
{41BF89E4-8C67-45A6-8044-13009E363220}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21+
{41BF89E4-8C67-45A6-8044-13009E363220}.Debug|Any CPU.Build.0 = Debug|Any CPU
22+
{41BF89E4-8C67-45A6-8044-13009E363220}.Release|Any CPU.ActiveCfg = Release|Any CPU
23+
{41BF89E4-8C67-45A6-8044-13009E363220}.Release|Any CPU.Build.0 = Release|Any CPU
24+
EndGlobalSection
25+
GlobalSection(SolutionProperties) = preSolution
26+
HideSolutionNode = FALSE
27+
EndGlobalSection
28+
EndGlobal
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<OutputType>Library</OutputType>
8+
<RootNamespace>System</RootNamespace>
9+
<AssemblyName>System.Diagnostics.Tools.Tests</AssemblyName>
10+
<RestorePackages>true</RestorePackages>
11+
</PropertyGroup>
12+
<!-- Default configurations to help VS understand the configurations -->
13+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
14+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
15+
<ItemGroup>
16+
<Compile Include="System\CodeDom\Compiler\GeneratedCodeAttributeTests.cs" />
17+
</ItemGroup>
18+
<ItemGroup>
19+
<!-- Compile tests against the contract, but copy our local-built implementation for testing -->
20+
<ProjectReference Include="..\src\System.Diagnostics.Tools.CoreCLR.csproj">
21+
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
22+
<OutputItemType>Content</OutputItemType>
23+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
24+
<Targets>Build;DebugSymbolsProjectOutputGroup</Targets>
25+
</ProjectReference>
26+
</ItemGroup>
27+
<ItemGroup>
28+
<None Include="project.json" />
29+
</ItemGroup>
30+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
31+
</Project>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Copyright (c) Microsoft. All rights reserved.
2+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
3+
4+
using Xunit;
5+
6+
namespace System.CodeDom.Compiler
7+
{
8+
public static class GeneratedCodeAttributeTests
9+
{
10+
[Theory]
11+
[InlineData(null, null)]
12+
[InlineData("Tool", "Version")]
13+
public static void Constructor(string tool, string version)
14+
{
15+
GeneratedCodeAttribute gca = new GeneratedCodeAttribute(tool, version);
16+
17+
Assert.Equal(tool, gca.Tool);
18+
Assert.Equal(version, gca.Version);
19+
}
20+
}
21+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"dependencies": {
3+
"System.Diagnostics.Tools": "4.0.0-beta-*",
4+
"xunit": "2.0.0-beta5-build2785",
5+
"xunit.abstractions.netcore": "1.0.0-prerelease",
6+
"xunit.assert": "2.0.0-beta5-build2785",
7+
"xunit.core.netcore": "1.0.1-prerelease",
8+
"xunit.netcore.extensions": "1.0.0-prerelease-*"
9+
},
10+
"frameworks": {
11+
"dnxcore50": {}
12+
}
13+
}

0 commit comments

Comments
 (0)