Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions src/MLXSharp.Tests/ModelIntegrationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public sealed class ModelIntegrationTests
public async Task NativeBackendAnswersSimpleMathAsync()
{
TestEnvironment.EnsureInitialized();
EnsureAssetsOrSkip();
EnsureAssets();

var options = CreateOptions();
using var backend = MlxNativeBackend.Create(options);
Expand Down Expand Up @@ -59,18 +59,14 @@ private static MlxClientOptions CreateOptions()
return options;
}

private static void EnsureAssetsOrSkip()
private static void EnsureAssets()
{
var modelPath = Environment.GetEnvironmentVariable("MLXSHARP_MODEL_PATH");
if (string.IsNullOrWhiteSpace(modelPath) || !System.IO.Directory.Exists(modelPath))
{
Skip.If(true, "Native model bundle not found.");
}
Assert.False(string.IsNullOrWhiteSpace(modelPath), "Native model bundle path is not configured. Set MLXSHARP_MODEL_PATH to a valid directory.");
Assert.True(System.IO.Directory.Exists(modelPath), $"Native model bundle not found at '{modelPath}'.");

var library = Environment.GetEnvironmentVariable("MLXSHARP_LIBRARY");
if (string.IsNullOrWhiteSpace(library) || !System.IO.File.Exists(library))
{
Skip.If(true, "Native libmlxsharp library not configured.");
}
Assert.False(string.IsNullOrWhiteSpace(library), "Native libmlxsharp library is not configured. Set MLXSHARP_LIBRARY to the compiled native library.");
Assert.True(System.IO.File.Exists(library), $"Native libmlxsharp library not found at '{library}'.");
}
}
Loading