Skip to content

Commit 145e30f

Browse files
committed
Add guard for executing model in coreml test to only run on apple machines.
1 parent 15a517a commit 145e30f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

onnxruntime/test/providers/coreml/coreml_basic_test.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,8 @@ TEST(CoreMLExecutionProviderTest, ExternalDataInitializer) {
549549
ASSERT_STATUS_OK(session.Load(model_path.native()));
550550
ASSERT_STATUS_OK(session.Initialize());
551551

552+
#if defined(__APPLE__)
553+
EXPECT_TRUE(session.GetRegisteredProviderTypes().count(kCoreMLExecutionProvider) > 0);
552554
std::vector<OrtValue> fetches;
553555
ASSERT_STATUS_OK(session.Run(run_options, feeds, output_names, &fetches));
554556

@@ -561,6 +563,7 @@ TEST(CoreMLExecutionProviderTest, ExternalDataInitializer) {
561563
EXPECT_NEAR(output_data[i], input_data[i] + initializer_data[i], 1e-5f)
562564
<< "Mismatch at index " << i;
563565
}
566+
#endif // defined(__APPLE__)
564567
}
565568
#endif // !(ORT_MINIMAL_BUILD)
566569

0 commit comments

Comments
 (0)