Retarget testroms projects to `net48` to match EmuHawk

This commit is contained in:
YoshiRulz 2024-05-15 00:16:46 +10:00
parent 4f3e4e3642
commit 9fb98ef5ef
4 changed files with 20 additions and 7 deletions

View File

@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net48</TargetFramework>
</PropertyGroup>
<Import Project="../TestProjects.props" />
<PropertyGroup>
@ -9,6 +9,5 @@
<ItemGroup>
<ProjectReference Include="$(ProjectDir)../BizHawk.Tests.Testroms.GB/BizHawk.Tests.Testroms.GB.csproj" />
<EmbeddedResource Include="res/**/*" />
<RuntimeHostConfigurationOption Include="System.Drawing.EnableUnixSupport" Value="true" />
</ItemGroup>
</Project>

View File

@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net48</TargetFramework>
</PropertyGroup>
<Import Project="../TestProjects.props" />
<PropertyGroup>
@ -17,11 +17,20 @@
</PropertyGroup>
<!-- BIZHAWKTEST_SAVE_IMAGES=none => no extra defines -->
<ItemGroup>
<PackageReference Include="Magick.NET-Q8-AnyCPU" />
<PackageReference Include="Magick.NET-Q8-AnyCPU" GeneratePathProperty="true" />
<ProjectReference Include="$(ProjectDir)../BizHawk.Bizware.Graphics/BizHawk.Bizware.Graphics.csproj" />
<ProjectReference Include="$(ProjectDir)../BizHawk.Client.Common/BizHawk.Client.Common.csproj" />
<EmbeddedResource Include="res/**/*" />
<Content Include="$(ProjectDir)../../Assets/gamedb/**/*" LinkBase="gamedb" CopyToOutputDirectory="PreserveNewest" />
<RuntimeHostConfigurationOption Include="System.Drawing.EnableUnixSupport" Value="true" />
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition=" '$(OS)' != 'WINDOWS_NT' ">
<!-- ExcludeAssets="runtime" didn't work, making this necessary, and might as well do everything here -->
<!-- may be able to simplify copy in future, see https://github.com/dlemstra/Magick.NET/pull/1633, but would still want delete probably? -->
<ItemGroup>
<ToDelete Include="$(OutputPath)Magick.Native-*.dll" />
<ToCopy Include="$(PkgMagick_NET-Q8-AnyCPU)/runtimes/linux-x64/native/*.dll.so" />
</ItemGroup>
<Delete Files="@(ToDelete)" />
<Copy SourceFiles="@(ToCopy)" DestinationFiles="@(ToCopy->'$(OutputPath)lib%(Filename)%(Extension)')" /> <!-- not sure why they're using `*.dll.so` without the `lib*` part -->
</Target>
</Project>

View File

@ -217,7 +217,12 @@ namespace BizHawk.Tests.Testroms.GB.CPPTestroms
if (!ImageUtils.SkipFileIO(state))
{
ImageUtils.SaveScreenshot(NormaliseGBScreenshot(actualUnnormalised, testCase.Setup), (SUITE_ID, caseStr));
Console.WriteLine($"should read: {string.Join("\n", testCase.ExpectedValue.Chunk(40).Select(static a => string.Concat(a)))}");
Console.WriteLine("should read: ");
const int STR_FOLD_COL = 40;
for (var iEx = 0; iEx < testCase.ExpectedValue.Length; iEx += STR_FOLD_COL)
{
Console.WriteLine(testCase.ExpectedValue.Substring(startIndex: iEx, length: STR_FOLD_COL));
}
}
switch (state)
{

View File

@ -43,7 +43,7 @@ namespace BizHawk.Tests.Testroms.GB
public static void PrintPalette(Image imgA, string labelA, Image imgB, string labelB)
{
static IReadOnlySet<int> CollectPalette(Image img)
static HashSet<int> CollectPalette(Image img)
{
var b = img.AsBitmap();
HashSet<int> paletteE = new();