Skip to content

Commit

Permalink
only include benchmark unit test code with BENCH
Browse files Browse the repository at this point in the history
  • Loading branch information
Eddio0141 committed Nov 7, 2024
1 parent 67c6381 commit c77d8e7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
4 changes: 3 additions & 1 deletion UniTAS/Patcher.Tests/ManualServices/BenchTests.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if BENCH
using System.Linq;
using System.Threading;
using UniTAS.Patcher.ManualServices;
Expand Down Expand Up @@ -59,4 +60,5 @@ private static void SleepFunctionUsingDiscard()
using var _ = Bench.Measure();
Thread.Sleep(500);
}
}
}
#endif
11 changes: 10 additions & 1 deletion UniTAS/Patcher.Tests/Patcher.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,23 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>

<LangVersion>12</LangVersion>

<Configurations>Debug;Release;ReleaseBench</Configurations>

<Platforms>AnyCPU</Platforms>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<NoWarn>NU1701;NU1702;IL2121</NoWarn>
<DefineConstants>TRACE;BENCH</DefineConstants>
<DefineConstants>TRACE</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<NoWarn>NU1701;NU1702;IL2121</NoWarn>
<DefineConstants>TRACE</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'ReleaseBench' ">
<NoWarn>NU1701;NU1702;IL2121</NoWarn>
<DefineConstants>TRACE;BENCH</DefineConstants>
</PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions UniTAS/UniTAS.sln
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ Global
{0C767EFA-674E-47F9-AE27-BE49C56AC85C}.Release|Any CPU.Build.0 = Release|Any CPU
{0C767EFA-674E-47F9-AE27-BE49C56AC85C}.ReleaseTrace|Any CPU.ActiveCfg = Release|Any CPU
{0C767EFA-674E-47F9-AE27-BE49C56AC85C}.ReleaseTrace|Any CPU.Build.0 = Release|Any CPU
{0C767EFA-674E-47F9-AE27-BE49C56AC85C}.ReleaseBench|Any CPU.ActiveCfg = Release|Any CPU
{0C767EFA-674E-47F9-AE27-BE49C56AC85C}.ReleaseBench|Any CPU.Build.0 = Release|Any CPU
{0C767EFA-674E-47F9-AE27-BE49C56AC85C}.ReleaseBench|Any CPU.ActiveCfg = ReleaseBench|Any CPU
{0C767EFA-674E-47F9-AE27-BE49C56AC85C}.ReleaseBench|Any CPU.Build.0 = ReleaseBench|Any CPU
{91EA9B9D-FE03-4273-BDAF-8AD42EDE1E59}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{91EA9B9D-FE03-4273-BDAF-8AD42EDE1E59}.Debug|Any CPU.Build.0 = Debug|Any CPU
{91EA9B9D-FE03-4273-BDAF-8AD42EDE1E59}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down

0 comments on commit c77d8e7

Please sign in to comment.