diff --git a/samples/ComputeSharp.Sample.NuGet/nuget.config b/samples/ComputeSharp.Sample.NuGet/nuget.config
deleted file mode 100644
index 995d3a62..00000000
--- a/samples/ComputeSharp.Sample.NuGet/nuget.config
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/tests/ComputeSharp.Tests.NativeLibrariesResolver/ComputeSharp.Tests.NativeLibrariesResolver.csproj b/tests/ComputeSharp.Tests.NativeLibrariesResolver/ComputeSharp.Tests.NativeLibrariesResolver.csproj
index cb3020de..8f6ea8d8 100644
--- a/tests/ComputeSharp.Tests.NativeLibrariesResolver/ComputeSharp.Tests.NativeLibrariesResolver.csproj
+++ b/tests/ComputeSharp.Tests.NativeLibrariesResolver/ComputeSharp.Tests.NativeLibrariesResolver.csproj
@@ -11,4 +11,9 @@
+
+
+
+
+
diff --git a/tests/ComputeSharp.Tests.NativeLibrariesResolver/NativeLibrariesResolverTests.cs b/tests/ComputeSharp.Tests.NativeLibrariesResolver/NativeLibrariesResolverTests.cs
index c949a9f3..c1c9d50a 100644
--- a/tests/ComputeSharp.Tests.NativeLibrariesResolver/NativeLibrariesResolverTests.cs
+++ b/tests/ComputeSharp.Tests.NativeLibrariesResolver/NativeLibrariesResolverTests.cs
@@ -19,17 +19,24 @@ public class NativeLibrariesResolverTests
{
string path = Path.GetDirectoryName(typeof(NativeLibrariesResolverTests).Assembly.Location)!;
+ while (Path.GetFileName(path) is not "ComputeSharp.Tests.NativeLibrariesResolver")
+ {
+ path = Path.GetDirectoryName(path)!;
+ }
+
+ SampleProjectDirectory = Path.Combine(path, "Project", "ComputeSharp.Sample.NuGet");
+
while (Path.GetFileName(path) is not "ComputeSharp")
{
path = Path.GetDirectoryName(path)!;
}
- SampleProjectDirectory = Path.Combine(path, "samples", "ComputeSharp.Sample.NuGet");
-
+ 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");
// 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();
}
diff --git a/samples/ComputeSharp.Sample.NuGet/ComputeSharp.Sample.NuGet.csproj b/tests/ComputeSharp.Tests.NativeLibrariesResolver/Project/ComputeSharp.Sample.NuGet.csproj
similarity index 82%
rename from samples/ComputeSharp.Sample.NuGet/ComputeSharp.Sample.NuGet.csproj
rename to tests/ComputeSharp.Tests.NativeLibrariesResolver/Project/ComputeSharp.Sample.NuGet.csproj
index f75aab80..6bd747f3 100644
--- a/samples/ComputeSharp.Sample.NuGet/ComputeSharp.Sample.NuGet.csproj
+++ b/tests/ComputeSharp.Tests.NativeLibrariesResolver/Project/ComputeSharp.Sample.NuGet.csproj
@@ -4,6 +4,7 @@
Exe
net472;netcoreapp3.1;net6.0
AnyCPU;x64;ARM64
+ $(PackageOutputPath)
@@ -12,6 +13,4 @@
-
-
diff --git a/tests/ComputeSharp.Tests.NativeLibrariesResolver/Project/Program.cs b/tests/ComputeSharp.Tests.NativeLibrariesResolver/Project/Program.cs
new file mode 100644
index 00000000..31b654f0
--- /dev/null
+++ b/tests/ComputeSharp.Tests.NativeLibrariesResolver/Project/Program.cs
@@ -0,0 +1,35 @@
+using System.Diagnostics;
+using System.Linq;
+using ComputeSharp;
+
+float[] array = Enumerable.Range(1, 100).Select(static i => (float)i).ToArray();
+
+// Create the graphics buffer
+using ReadWriteBuffer gpuBuffer = GraphicsDevice.Default.AllocateReadWriteBuffer(array);
+
+// Run the shader
+GraphicsDevice.Default.For(100, new MultiplyByTwo(gpuBuffer));
+
+// Get the data back
+float[] result = gpuBuffer.ToArray();
+
+// Validate results
+for (int i = 0; i < array.Length; i++)
+{
+ Trace.Assert(result[i] == array[i] * 2);
+}
+
+///
+/// A sample kernel that requires dynamic compilation, as it's not precompiled.
+///
+[AutoConstructor]
+internal readonly partial struct MultiplyByTwo : IComputeShader
+{
+ public readonly ReadWriteBuffer buffer;
+
+ ///
+ public void Execute()
+ {
+ buffer[ThreadIds.X] *= 2;
+ }
+}