Skip to content

Commit

Permalink
Prepare Antlr4.Runtime.Test for supporting multiple test targets
Browse files Browse the repository at this point in the history
  • Loading branch information
sharwell committed Jul 15, 2017
1 parent 61a38ae commit 65a34b6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 deletions.
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ build_script:
- cd ..
test_script:
- vstest.console /logger:Appveyor /TestCaseFilter:"TestCategory=runtime-suite" "C:\projects\antlr4cs\runtime\CSharp\Antlr4.Runtime.Test\bin\net45\%CONFIGURATION%\Antlr4.Runtime.Test.net45.dll"
- vstest.console /logger:Appveyor /TestCaseFilter:"TestCategory=runtime-suite" "C:\projects\antlr4cs\runtime\CSharp\Antlr4.Runtime.Test\bin\%CONFIGURATION%\net45\Antlr4.Runtime.Test.netstandard.dll"
- vstest.console /logger:Appveyor /TestCaseFilter:"TestCategory=runtime-suite" "C:\projects\antlr4cs\runtime\CSharp\Antlr4.Runtime.Test\bin\%CONFIGURATION%\net452\Antlr4.Runtime.Test.dll"
- vstest.console /logger:Appveyor /TestCaseFilter:"TestCategory=runtime-suite" "C:\projects\antlr4cs\runtime\CSharp\Antlr4.Runtime.Test\bin\portable-net40\%CONFIGURATION%\Antlr4.Runtime.Test.portable_net40.dll"
- vstest.console /logger:Appveyor /TestCaseFilter:"TestCategory=runtime-suite" "C:\projects\antlr4cs\runtime\CSharp\Antlr4.Runtime.Test\bin\net40\%CONFIGURATION%\Antlr4.Runtime.Test.net40_client.dll"
- vstest.console /logger:Appveyor /TestCaseFilter:"TestCategory=runtime-suite" "C:\projects\antlr4cs\runtime\CSharp\Antlr4.Runtime.Test\bin\net35\%CONFIGURATION%\Antlr4.Runtime.Test.net35_client.dll"
Expand Down
34 changes: 20 additions & 14 deletions runtime/CSharp/Antlr4.Runtime.Test/Antlr4.Runtime.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<AssemblyName>Antlr4.Runtime.Test.netstandard</AssemblyName>
<TargetFramework>net45</TargetFramework>
<!-- Note: net452 is used for testing the netstandard1.1 target. -->
<TargetFrameworks>net452</TargetFrameworks>
<EnableDefaultNoneItems>False</EnableDefaultNoneItems>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>

<Description>Unit tests for ANTLR 4.</Description>
<Copyright>Copyright © Sam Harwell 2013</Copyright>
<Company>Tunnel Vision Laboratories, LLC</Company>
<AssemblyTitle>Antlr4.Runtime.Test</AssemblyTitle>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand All @@ -23,9 +22,24 @@
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>

<PropertyGroup>
<DefineConstants>$(DefineConstants);PORTABLE;NET45;NET45PLUS;NET40PLUS;NET35PLUS;NET30PLUS;NET20PLUS</DefineConstants>
</PropertyGroup>
<Choose>
<When Condition="'$(TargetFramework)' == 'net452'">
<PropertyGroup>
<DefineConstants>$(DefineConstants);PORTABLE;NET45;NET45PLUS;NET40PLUS;NET35PLUS;NET30PLUS;NET20PLUS</DefineConstants>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MSTest.TestFramework" Version="1.1.18" />
<PackageReference Include="MSTest.TestAdapter" Version="1.1.18" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Antlr4.Runtime\Antlr4.Runtime.csproj">
<SetTargetFramework>TargetFramework=netstandard1.1</SetTargetFramework>
</ProjectReference>
</ItemGroup>
</When>
</Choose>

<PropertyGroup>
<SignAssembly>true</SignAssembly>
Expand All @@ -34,12 +48,6 @@

<ItemGroup>
<PackageReference Include="Antlr4.CodeGenerator" Version="4.6.4" PrivateAssets="all" />
<PackageReference Include="MSTest.TestFramework" Version="1.1.18" />
<PackageReference Include="MSTest.TestAdapter" Version="1.1.18" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Antlr4.Runtime\Antlr4.Runtime.csproj" />
</ItemGroup>

<ItemGroup>
Expand All @@ -65,6 +73,4 @@
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>

<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />

</Project>

0 comments on commit 65a34b6

Please sign in to comment.