Update native library tests and CI script

このコミットが含まれているのは:
Sergio Pedri committed 2023-10-12 00:59:34 +02:00
1 親 da267bcb26
コミット cf283c592e
5ファイル変更
+26 -28

検索条件に一致するファイルはありません

+3 -3
ファイルの表示
@@ -161,15 +161,15 @@ jobs:
- name: Build and run ComputeSharp.Sample
run: >
dotnet build samples\ComputeSharp.Sample\ComputeSharp.Sample.csproj -c Release -r win-x64 --no-self-contained -p:Platform=x64 -v n;
samples\ComputeSharp.Sample\bin\x64\Release\${{matrix.framework}}\win-x64\ComputeSharp.Sample.exe
samples\ComputeSharp.Sample\bin\x64\Release\net6.0\win-x64\ComputeSharp.Sample.exe
- name: Build and run ComputeSharp.Sample.FSharp
run: >
dotnet build samples\ComputeSharp.Sample.FSharp\ComputeSharp.Sample.FSharp.fsproj -c Release -r win-x64 --no-self-contained -p:Platform=x64 -v n;
samples\ComputeSharp.Sample.FSharp\bin\x64\Release\${{matrix.framework}}\win-x64\ComputeSharp.Sample.FSharp.exe
samples\ComputeSharp.Sample.FSharp\bin\x64\Release\net6.0\win-x64\ComputeSharp.Sample.FSharp.exe
- name: Build and run ComputeSharp.ImageProcessing.csproj
run: >
dotnet build samples\ComputeSharp.ImageProcessing\ComputeSharp.ImageProcessing.csproj -c Release -r win-x64 --no-self-contained -p:Platform=x64 -v n;
samples\ComputeSharp.ImageProcessing\bin\x64\Release\${{matrix.framework}}\win-x64\ComputeSharp.ImageProcessing.exe
samples\ComputeSharp.ImageProcessing\bin\x64\Release\net6.0\win-x64\ComputeSharp.ImageProcessing.exe
# Run the NativeAOT samples as well
run-samples-aot:
@@ -25,13 +25,12 @@ public class DynamicNativeLibrariesResolverTests : NativeLibrariesResolverTestsB
path = Path.GetDirectoryName(path)!;
}
string corePackagingProjectPath = Path.Combine(path, "src", "ComputeSharp.Core", "ComputeSharp.Core.msbuildproj");
string packagingProjectPath = Path.Combine(path, "src", "ComputeSharp.Package", "ComputeSharp.Package.msbuildproj");
string dynamicPackagingProjectPath = Path.Combine(path, "src", "ComputeSharp.Dynamic.Package", "ComputeSharp.Dynamic.Package.msbuildproj");
string coreProjectPath = Path.Combine(path, "src", "ComputeSharp.Core", "ComputeSharp.Core.csproj");
string projectPath = Path.Combine(path, "src", "ComputeSharp.Package", "ComputeSharp.Package.csproj");
string dynamicProjectPath = Path.Combine(path, "src", "ComputeSharp.Dynamic", "ComputeSharp.Dynamic.csproj");
// Run dotnet pack and on the packaging projects, to ensure the local NuGet packages are available
Process.Start("dotnet", $"pack {corePackagingProjectPath} -c Release").WaitForExit();
Process.Start("dotnet", $"pack {packagingProjectPath} -c Release").WaitForExit();
Process.Start("dotnet", $"pack {dynamicPackagingProjectPath} -c Release").WaitForExit();
Process.Start("dotnet", $"pack {coreProjectPath} -c Release").WaitForExit();
Process.Start("dotnet", $"pack {projectPath} -c Release").WaitForExit();
Process.Start("dotnet", $"pack {dynamicProjectPath} -c Release").WaitForExit();
}
}
@@ -42,7 +42,7 @@ public abstract class NativeLibrariesResolverTestsBase
{
CleanSampleProject(configuration, rid);
Assert.AreEqual(0, Exec(SampleProjectDirectory, "dotnet", $"run -c {configuration} -f net6.0 {ToOption(rid)}"));
Assert.AreEqual(0, Exec(SampleProjectDirectory, "dotnet", $"run -c {configuration} {ToOption(rid)}"));
}
[TestMethod]
@@ -55,7 +55,7 @@ public abstract class NativeLibrariesResolverTestsBase
CleanSampleProject(configuration, rid);
BuildSampleProject(configuration, rid);
string realtivePathToDll = Path.Combine("bin", $"{configuration}", "net6.0", $"{ToDirectory(rid)}", $"{SampleProjectName}.dll");
string realtivePathToDll = Path.Combine("bin", $"{configuration}", "net7.0", $"{ToDirectory(rid)}", $"{SampleProjectName}.dll");
Assert.AreEqual(0, Exec(SampleProjectDirectory, "dotnet", realtivePathToDll));
}
@@ -70,7 +70,7 @@ public abstract class NativeLibrariesResolverTestsBase
CleanSampleProject(configuration, rid);
BuildSampleProject(configuration, rid);
string pathToDllDirectory = Path.Combine(SampleProjectDirectory, "bin", $"{configuration}", "net6.0", $"{ToDirectory(rid)}");
string pathToDllDirectory = Path.Combine(SampleProjectDirectory, "bin", $"{configuration}", "net7.0", $"{ToDirectory(rid)}");
Assert.AreEqual(0, Exec(pathToDllDirectory, "dotnet", $"{SampleProjectName}.dll"));
}
@@ -85,7 +85,7 @@ public abstract class NativeLibrariesResolverTestsBase
CleanSampleProject(configuration, rid);
BuildSampleProject(configuration, rid);
string relativePathToAppHost = Path.Combine("bin", $"{configuration}", "net6.0", $"{ToDirectory(rid)}", $"{SampleProjectName}.exe");
string relativePathToAppHost = Path.Combine("bin", $"{configuration}", "net7.0", $"{ToDirectory(rid)}", $"{SampleProjectName}.exe");
Assert.AreEqual(0, Exec(SampleProjectDirectory, relativePathToAppHost, ""));
}
@@ -100,7 +100,7 @@ public abstract class NativeLibrariesResolverTestsBase
CleanSampleProject(configuration, rid);
BuildSampleProject(configuration, rid);
string pathToAppHostDirectory = Path.Combine(SampleProjectDirectory, "bin", $"{configuration}", "net6.0", $"{ToDirectory(rid)}");
string pathToAppHostDirectory = Path.Combine(SampleProjectDirectory, "bin", $"{configuration}", "net7.0", $"{ToDirectory(rid)}");
Assert.AreEqual(0, Exec(pathToAppHostDirectory, $"{SampleProjectName}.exe", ""));
}
@@ -118,9 +118,9 @@ public abstract class NativeLibrariesResolverTestsBase
// Furthermore, only publishing in Release mode is tested.
CleanSampleProject(Configuration.Release, RID.Win_x64);
_ = Exec(SampleProjectDirectory, "dotnet", $"publish -c Release -f net6.0 -r win-x64 {ToOption(publishMode)} {ToOption(deploymentMode)} {ToOption(nativeLibsDeploymentMode)} /bl");
_ = Exec(SampleProjectDirectory, "dotnet", $"publish -c Release -r win-x64 {ToOption(publishMode)} {ToOption(deploymentMode)} {ToOption(nativeLibsDeploymentMode)} /bl");
string pathToAppHost = Path.Combine("bin", $"Release", "net6.0", "win-x64", "publish", $"{SampleProjectName}.exe");
string pathToAppHost = Path.Combine("bin", $"Release", "net7.0", "win-x64", "publish", $"{SampleProjectName}.exe");
Assert.AreEqual(0, Exec(SampleProjectDirectory, pathToAppHost, ""));
}
+4 -5
ファイルの表示
@@ -25,11 +25,10 @@ public class NativeLibrariesResolverTests : NativeLibrariesResolverTestsBase
path = Path.GetDirectoryName(path)!;
}
string corePackagingProjectPath = Path.Combine(path, "src", "ComputeSharp.Core", "ComputeSharp.Core.msbuildproj");
string packagingProjectPath = Path.Combine(path, "src", "ComputeSharp.Package", "ComputeSharp.Package.msbuildproj");
string coreProjectPath = Path.Combine(path, "src", "ComputeSharp.Core", "ComputeSharp.Core.csproj");
string projectPath = Path.Combine(path, "src", "ComputeSharp", "ComputeSharp.csproj");
// Run dotnet pack and on the packaging projects, to ensure the local NuGet packages are available
Process.Start("dotnet", $"pack {corePackagingProjectPath} -c Release").WaitForExit();
Process.Start("dotnet", $"pack {packagingProjectPath} -c Release").WaitForExit();
Process.Start("dotnet", $"pack {coreProjectPath} -c Release").WaitForExit();
Process.Start("dotnet", $"pack {projectPath} -c Release").WaitForExit();
}
}
+6 -6
ファイルの表示
@@ -25,13 +25,13 @@ public class PixNativeLibrariesResolverTests : NativeLibrariesResolverTestsBase
path = Path.GetDirectoryName(path)!;
}
string corePackagingProjectPath = Path.Combine(path, "src", "ComputeSharp.Core", "ComputeSharp.Core.msbuildproj");
string packagingProjectPath = Path.Combine(path, "src", "ComputeSharp.Package", "ComputeSharp.Package.msbuildproj");
string pixPackagingProjectPath = Path.Combine(path, "src", "ComputeSharp.Pix.Package", "ComputeSharp.Pix.Package.msbuildproj");
string coreProjectPath = Path.Combine(path, "src", "ComputeSharp.Core", "ComputeSharp.Core.csproj");
string projectPath = Path.Combine(path, "src", "ComputeSharp.Package", "ComputeSharp.Package.csproj");
string pixProjectPath = Path.Combine(path, "src", "ComputeSharp.Pix", "ComputeSharp.Pix.csproj");
// Run dotnet pack and on the packaging projects, to ensure the local NuGet packages are available
Process.Start("dotnet", $"pack {corePackagingProjectPath} -c Release").WaitForExit();
Process.Start("dotnet", $"pack {packagingProjectPath} -c Release").WaitForExit();
Process.Start("dotnet", $"pack {pixPackagingProjectPath} -c Release").WaitForExit();
Process.Start("dotnet", $"pack {coreProjectPath} -c Release").WaitForExit();
Process.Start("dotnet", $"pack {projectPath} -c Release").WaitForExit();
Process.Start("dotnet", $"pack {pixProjectPath} -c Release").WaitForExit();
}
}