IntegrationTestHelpers and BenchmarkHelpers provide shared test logic for verifying end-to-end model loading, inference, tokenizer performance, and download performance. They are designed to be used by integration packages that supply their own Downloader and TokenizerLoader implementations.
The IntegrationTesting/IntegrationTesting.xcodeproj Xcode project in this repo uses Swift Hugging Face and Swift Transformers via the MLXHuggingFace macros to provide Downloader and TokenizerLoader implementations. Models are downloaded from Hugging Face Hub on first run and cached in ~/.cache/huggingface/.
To run integration tests, open IntegrationTesting/IntegrationTesting.xcodeproj in Xcode and run the test target (Cmd+U or via the Test Navigator), or use xcodebuild:
# Run all integration tests (requires macOS with Metal)
xcodebuild test \
-project IntegrationTesting/IntegrationTesting.xcodeproj \
-scheme IntegrationTesting \
-destination 'platform=macOS'
# Run a single test
xcodebuild test \
-project IntegrationTesting/IntegrationTesting.xcodeproj \
-scheme IntegrationTesting \
-destination 'platform=macOS' \
-only-testing:IntegrationTestingTests/ToolCallIntegrationTests/qwen35FormatAutoDetection\(\)These tests do not run in CI.
Integration tests and benchmarks can also be run from external packages: