-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Rebuild .Net Framework projects #2370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
cdb464a
Added `CsProjWithRoslynFallbackToolchain` for .Net Framework projects…
timcassell 99caff6
Move manual tests to separate solution.
timcassell 3f3f0a9
Test old frameworks and test that recompilation actually happens.
timcassell 29579af
Merge branch 'master' into csprojwithroslynfallbacktoolchain
timcassell 5dec2aa
Removed ClassicNetFramework project.
timcassell 28b671b
Removed `CsProjWithRoslynFallbackToolchain`, default to `CsProjClassi…
timcassell 39c4b9a
Use RoslynToolchain if dotnet SDK is not installed.
timcassell 392772e
Fix test.
timcassell 1f1a3f5
Revert xunit.runner.json.
timcassell 22c9437
Try to fix json file
timcassell 301e036
Removed redundant commented line.
timcassell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
...ltipleFrameworks/BenchmarkDotNet.IntegrationTests.ManualRunning.MultipleFrameworks.csproj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<Import Project="..\..\build\common.props" /> | ||
<PropertyGroup> | ||
<AssemblyTitle>BenchmarkDotNet.IntegrationTests.ManualRunning.MultipleFrameworks</AssemblyTitle> | ||
<!-- We test the oldest frameworks supported by BDN (net461 and netcoreapp2.0), as well as newer versions of those frameworks. --> | ||
<TargetFrameworks>net461;net48;netcoreapp2.0;net7.0</TargetFrameworks> | ||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> | ||
<AssemblyName>BenchmarkDotNet.IntegrationTests.ManualRunning.MultipleFrameworks</AssemblyName> | ||
<PackageId>BenchmarkDotNet.IntegrationTests.ManualRunning.MultipleFrameworks</PackageId> | ||
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles> | ||
<GenerateDocumentationFile>false</GenerateDocumentationFile> | ||
<PlatformTarget>AnyCPU</PlatformTarget> | ||
<DebugSymbols>true</DebugSymbols> | ||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="..\BenchmarkDotNet.IntegrationTests\BenchmarkTestExecutor.cs" Link="BenchmarkTestExecutor.cs" /> | ||
<Compile Include="..\BenchmarkDotNet.IntegrationTests\Xunit\MisconfiguredEnvironmentException.cs" Link="MisconfiguredEnvironmentException.cs" /> | ||
<Compile Include="..\BenchmarkDotNet.IntegrationTests\Xunit\Extensions.cs" Link="Extensions.cs" /> | ||
<Compile Include="..\BenchmarkDotNet.IntegrationTests\TestConfigs.cs" Link="TestConfigs.cs" /> | ||
<Compile Include="..\BenchmarkDotNet.Tests\Loggers\OutputLogger.cs" Link="OutputLogger.cs" /> | ||
<Compile Include="..\BenchmarkDotNet.Tests\XUnit\SmartAssert.cs" Link="SmartAssert.cs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<PackageReference Include="Microsoft.NETCore.Platforms" Version="5.0.0" /> | ||
<PackageReference Include="System.Memory" Version="4.5.5" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Content Include="..\BenchmarkDotNet.IntegrationTests.ManualRunning\xunit.runner.json"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</Content> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\..\src\BenchmarkDotNet.Annotations\BenchmarkDotNet.Annotations.csproj" /> | ||
<ProjectReference Include="..\..\src\BenchmarkDotNet\BenchmarkDotNet.csproj" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<!-- Microsoft.NET.Test.Sdk breaks netcoreapp2.0 --> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.3" Condition=" '$(TargetFramework)' != 'netcoreapp2.0' " /> | ||
<PackageReference Include="xunit" Version="2.5.0" /> | ||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
</ItemGroup> | ||
</Project> |
50 changes: 50 additions & 0 deletions
50
...nchmarkDotNet.IntegrationTests.ManualRunning.MultipleFrameworks/MultipleFrameworksTest.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
using System; | ||
using BenchmarkDotNet.Attributes; | ||
using BenchmarkDotNet.Configs; | ||
using BenchmarkDotNet.Extensions; | ||
using BenchmarkDotNet.Jobs; | ||
using Xunit; | ||
|
||
namespace BenchmarkDotNet.IntegrationTests | ||
{ | ||
public class MultipleFrameworksTest : BenchmarkTestExecutor | ||
{ | ||
private const string TfmEnvVarName = "TfmEnvVarName"; | ||
|
||
[Theory] | ||
[InlineData(RuntimeMoniker.Net461)] | ||
[InlineData(RuntimeMoniker.Net48)] | ||
[InlineData(RuntimeMoniker.NetCoreApp20)] | ||
[InlineData(RuntimeMoniker.Net70)] | ||
public void EachFrameworkIsRebuilt(RuntimeMoniker runtime) | ||
{ | ||
var config = ManualConfig.CreateEmpty().AddJob(Job.Dry.WithRuntime(runtime.GetRuntime()).WithEnvironmentVariable(TfmEnvVarName, runtime.ToString())); | ||
CanExecute<ValuePerTfm>(config); | ||
} | ||
|
||
public class ValuePerTfm | ||
{ | ||
private const RuntimeMoniker moniker = | ||
#if NET461 | ||
RuntimeMoniker.Net461; | ||
#elif NET48 | ||
RuntimeMoniker.Net48; | ||
#elif NETCOREAPP2_0 | ||
RuntimeMoniker.NetCoreApp20; | ||
#elif NET7_0 | ||
RuntimeMoniker.Net70; | ||
#else | ||
RuntimeMoniker.NotRecognized; | ||
#endif | ||
|
||
[Benchmark] | ||
public void ThrowWhenWrong() | ||
{ | ||
if (Environment.GetEnvironmentVariable(TfmEnvVarName) != moniker.ToString()) | ||
{ | ||
throw new InvalidOperationException($"Has not been recompiled, the value was {Environment.GetEnvironmentVariable(TfmEnvVarName)}"); | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.