Skip to content

Commit

Permalink
Fix test targets for net9
Browse files Browse the repository at this point in the history
  • Loading branch information
cyanfish committed Aug 21, 2024
1 parent 069331e commit 715364f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions NAPS2.App.Tests/AppTestData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public IEnumerator<object[]> GetEnumerator()
#if NET6_0_OR_GREATER
if (OperatingSystem.IsWindows())
{
yield return new object[] { new WinNet462AppTestTarget() };
yield return new object[] { new WindowsAppTestTarget() };
}
else if (OperatingSystem.IsMacOS())
{
Expand All @@ -21,7 +21,7 @@ public IEnumerator<object[]> GetEnumerator()
yield return new object[] { new LinuxAppTestTarget() };
}
#else
yield return new object[] { new WinNet462AppTestTarget() };
yield return new object[] { new WindowsAppTestTarget() };
#endif
}

Expand Down
4 changes: 2 additions & 2 deletions NAPS2.App.Tests/Appium/AppiumTestData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public IEnumerator<object[]> GetEnumerator()
#if NET6_0_OR_GREATER
if (OperatingSystem.IsWindows())
{
yield return new object[] { new WinNet462AppTestTarget() };
yield return new object[] { new WindowsAppTestTarget() };
}
else if (OperatingSystem.IsMacOS())
{
Expand All @@ -21,7 +21,7 @@ public IEnumerator<object[]> GetEnumerator()
// No Appium impl yet
}
#else
yield return new object[] { new WinNet462AppTestTarget() };
yield return new object[] { new WindowsAppTestTarget() };
#endif
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace NAPS2.App.Tests.Targets;

public class WinNet462AppTestTarget : IAppTestTarget
public class WindowsAppTestTarget : IAppTestTarget
{
public AppTestExe Console => GetAppTestExe("NAPS2.App.Console", "NAPS2.Console.exe", null);
public AppTestExe Gui => GetAppTestExe("NAPS2.App.WinForms", "NAPS2.exe", null);
Expand All @@ -10,10 +10,10 @@ public class WinNet462AppTestTarget : IAppTestTarget
private AppTestExe GetAppTestExe(string project, string exeName, string testRootSubPath)
{
return new AppTestExe(
Path.Combine(AppTestHelper.SolutionRoot, project, "bin", "Debug", "net462"),
Path.Combine(AppTestHelper.SolutionRoot, project, "bin", "Debug", "met9-windows"),
exeName,
TestRootSubPath: testRootSubPath);
}

public override string ToString() => "Windows (net462)";
public override string ToString() => "Windows";
}
2 changes: 1 addition & 1 deletion NAPS2.Tools/Project/TestCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public int Run(TestOptions opts)
? $"NAPS2.App.Mac/bin/Debug/net8-macos10.15/osx-{arch}"
: OperatingSystem.IsLinux()
? $"NAPS2.App.Gtk/bin/Debug/net8/linux-{arch}"
: "NAPS2.App.WinForms/bin/Debug/net462";
: $"NAPS2.App.WinForms/bin/Debug/net9-windows/win-{arch}";
var frameworkArg = OperatingSystem.IsWindows() ? "" : "-f net8";

void RunTests(string project, bool isRetry = false)
Expand Down

0 comments on commit 715364f

Please sign in to comment.