Add failing test

This commit is contained in:
Dan Balasescu
2024-08-31 18:15:59 +09:00
committed by Caelan
parent 8fb1469e6e
commit 3c8ddf227c
2 changed files with 43 additions and 1 deletions

View File

@@ -0,0 +1,39 @@
using System.Runtime.Versioning;
using Velopack.Compression;
namespace Velopack.Packaging.Tests;
[SupportedOSPlatform("osx")]
public class OsxPackTests
{
private readonly ITestOutputHelper _output;
public OsxPackTests(ITestOutputHelper output)
{
_output = output;
}
[SkippableFact]
public void PackBuildUsesAppTitleAsBundleName()
{
Skip.IfNot(VelopackRuntimeInfo.IsOSX);
using var logger = _output.BuildLoggerFor<OsxPackTests>();
using var _1 = Utility.GetTempDirectory(out var tmpOutput);
using var _2 = Utility.GetTempDirectory(out var tmpReleaseDir);
using var _3 = Utility.GetTempDirectory(out var unzipDir);
const string id = "MyAppId";
const string title = "MyAppTitle";
const string channel = "asd123";
TestApp.PackTestApp(id, "0.0.1", string.Empty, tmpReleaseDir, logger, channel: channel, packTitle: title);
var portablePath = Path.Combine(tmpReleaseDir, $"{id}-{channel}-Portable.zip");
EasyZip.ExtractZipToDirectory(logger, portablePath, unzipDir);
var bundlePath = Path.Combine(unzipDir, $"{title}.app");
Assert.True(Directory.Exists(bundlePath));
}
}

View File

@@ -9,7 +9,7 @@ namespace Velopack.Packaging.Tests;
public static class TestApp
{
public static void PackTestApp(string id, string version, string testString, string releaseDir, ILogger logger,
string releaseNotes = null, string channel = null, RID targetRid = null)
string releaseNotes = null, string channel = null, RID targetRid = null, string packTitle = null)
{
targetRid ??= RID.Parse(VelopackRuntimeInfo.SystemRid);
@@ -40,6 +40,7 @@ public static class TestApp
var options = new WindowsPackOptions {
EntryExecutableName = "TestApp.exe",
ReleaseDir = new DirectoryInfo(releaseDir),
PackTitle = packTitle,
PackId = id,
TargetRuntime = targetRid,
PackVersion = version,
@@ -53,6 +54,7 @@ public static class TestApp
var options = new OsxPackOptions {
EntryExecutableName = "TestApp",
ReleaseDir = new DirectoryInfo(releaseDir),
PackTitle = packTitle,
PackId = id,
TargetRuntime = targetRid,
PackVersion = version,
@@ -70,6 +72,7 @@ public static class TestApp
var options = new LinuxPackOptions {
EntryExecutableName = "TestApp",
ReleaseDir = new DirectoryInfo(releaseDir),
PackTitle = packTitle,
PackId = id,
TargetRuntime = targetRid,
PackVersion = version,