mirror of
https://github.com/velopack/velopack.git
synced 2025-10-25 15:19:22 +00:00
Patch osx tests
This commit is contained in:
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@@ -109,7 +109,7 @@ jobs:
|
||||
path: src/Rust/target/release
|
||||
|
||||
- name: Build .NET
|
||||
run: dotnet build -c Release
|
||||
run: dotnet build -c Release /p:PackRustAssets=true
|
||||
|
||||
- name: Upload Package Artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
|
||||
@@ -22,14 +22,16 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(Configuration)' == 'Debug'">
|
||||
<None Include="..\Rust\target\debug\update.exe" CopyToOutputDirectory="Always" />
|
||||
<None Include="..\Rust\target\debug\setup.exe" CopyToOutputDirectory="Always" />
|
||||
<None Include="..\Rust\target\debug\update" CopyToOutputDirectory="Always" Condition="$([MSBuild]::IsOSPlatform('OSX'))" />
|
||||
<None Include="..\Rust\target\debug\update.exe" CopyToOutputDirectory="Always" Condition="$([MSBuild]::IsOSPlatform('Windows'))" />
|
||||
<None Include="..\Rust\target\debug\setup.exe" CopyToOutputDirectory="Always" Condition="$([MSBuild]::IsOSPlatform('Windows'))" />
|
||||
<None Include="..\..\vendor\rcedit.exe" CopyToOutputDirectory="Always" />
|
||||
<None Include="..\..\vendor\signtool.exe" CopyToOutputDirectory="Always" />
|
||||
<None Include="..\..\Squirrel.entitlements" CopyToOutputDirectory="Always" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(Configuration)' == 'Release'">
|
||||
<ItemGroup Condition="'$(PackRustAssets)' == 'true'">
|
||||
<None Include="..\Rust\target\release\updatemac" Pack="true" PackagePath="vendor" />
|
||||
<None Include="..\Rust\target\release\update.exe" Pack="true" PackagePath="vendor" />
|
||||
<None Include="..\Rust\target\release\setup.exe" Pack="true" PackagePath="vendor" />
|
||||
<None Include="..\..\vendor\rcedit.exe" Pack="true" PackagePath="vendor" />
|
||||
|
||||
@@ -182,6 +182,10 @@ namespace Squirrel
|
||||
throw new Exception("Filename can either be an absolute HTTP[s] URL, *or* a file name");
|
||||
}
|
||||
|
||||
if (filename.IndexOfAny(new[] { '\"', '/', '\\', '<', '>', '|', '\0' }) > -1) {
|
||||
throw new Exception("Filename can either be an absolute HTTP[s] URL, *or* a file name");
|
||||
}
|
||||
|
||||
long size = Int64.Parse(m.Groups[3].Value);
|
||||
return new ReleaseEntry(m.Groups[1].Value, filename, size, baseUrl, query, stagingPercentage);
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace Squirrel.Tests
|
||||
_output = output;
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[SkippableTheory]
|
||||
[InlineData("file.txt", "file.txt")]
|
||||
[InlineData("file", "file")]
|
||||
[InlineData("/file", "\\file")]
|
||||
@@ -33,12 +33,13 @@ namespace Squirrel.Tests
|
||||
[InlineData("C:/AnApp/file/", "C:\\AnApp\\file")]
|
||||
public void PathIsNormalized(string input, string expected)
|
||||
{
|
||||
Skip.IfNot(SquirrelRuntimeInfo.IsWindows);
|
||||
var exp = Path.GetFullPath(expected);
|
||||
var normal = Utility.NormalizePath(input);
|
||||
Assert.Equal(exp, normal);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[SkippableTheory]
|
||||
[InlineData("C:\\AnApp", "C:\\AnApp\\file.exe", true)]
|
||||
[InlineData("C:\\AnApp\\", "C:\\AnApp\\file.exe", true)]
|
||||
[InlineData("C:\\AnApp", "C:\\AnApp\\sub\\dir\\file.exe", true)]
|
||||
@@ -50,6 +51,7 @@ namespace Squirrel.Tests
|
||||
[InlineData("AnAppThree", "AnAppThree\\file.exe", true)]
|
||||
public void FileIsInDirectory(string directory, string file, bool isIn)
|
||||
{
|
||||
Skip.IfNot(SquirrelRuntimeInfo.IsWindows);
|
||||
var fileInDir = Utility.IsFileInDirectory(file, directory);
|
||||
Assert.Equal(isIn, fileInDir);
|
||||
}
|
||||
@@ -172,13 +174,14 @@ namespace Squirrel.Tests
|
||||
Assert.Equal(result, Utility.FileIsLikelyPEImage(input));
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[SkippableTheory]
|
||||
[InlineData("C:\\Users\\bob\\temp\\pkgPath\\lib\\net45\\foo.exe", "C:\\Users\\bob\\temp\\pkgPath", true)]
|
||||
[InlineData("C:\\Users\\bob\\temp\\pkgPath\\lib\\net45\\node_modules\\foo.exe", "C:\\Users\\bob\\temp\\pkgPath", false)]
|
||||
[InlineData("C:\\Users\\bob\\temp\\pkgPath\\lib\\net45\\node_modules\\foo\\foo.exe", "C:\\Users\\bob\\temp\\pkgPath", false)]
|
||||
[InlineData("foo.png", "C:\\Users\\bob\\temp\\pkgPath", false)]
|
||||
public void IsFileTopLevelInPackageTest(string input, string packagePath, bool result)
|
||||
{
|
||||
Skip.IfNot(SquirrelRuntimeInfo.IsWindows);
|
||||
Assert.Equal(result, Utility.IsFileTopLevelInPackage(input, packagePath));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user