Add test for iOS package (#7816)

* Add test for iOS package

* Add readme

* fix pep8 warning

* Addressed CR comments, fixed CI failure

* Address CR comments

* Update readme.md

* Update package name and readme, added comments to the podspec
This commit is contained in:
Guoyu Wang 2021-06-01 11:01:37 -07:00 committed by GitHub
parent 81ed6c55bf
commit e7e200ee59
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 1084 additions and 10 deletions

View file

@ -0,0 +1,26 @@
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
## User settings
xcuserdata/
## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
*.xcscmblueprint
*.xccheckout
## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
build/
DerivedData/
*.moved-aside
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
## Gcc Patch
/*.gcno

View file

@ -0,0 +1,15 @@
platform :ios, '13.0'
target 'ios_package_test' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for ios_package_test
pod 'onnxruntime-mobile', :podspec => './onnxruntime-mobile.podspec'
target 'ios_package_testTests' do
inherit! :search_paths
# Pods for testing
end
end

View file

@ -0,0 +1,47 @@
# iOS End-to-End Test App for ORT-Mobile
This End-to-End test app for iOS will test ORT Mobile C/C++ API framework using XCode and CocoaPods
## Requirements
- [Prerequisites for building ORT-Mobile for iOS](http://www.onnxruntime.ai/docs/how-to/build/android-ios.html#prerequisites-1)
- [CocoaPods](https://cocoapods.org/)
## iOS End-to-End Test App Overview
The iOS End-to-End Test App will use CocoaPods to install the Onnx Runtime C/C++ framework, and run basic End-to-End tests of Onnx Runtime C and C++ API.
### Model used
- [sigmoid ONNX model](https://github.com/onnx/onnx/blob/f9b0cc99344869c246b8f4011b8586a39841284c/onnx/backend/test/data/node/test_sigmoid/model.onnx) converted to ORT format
Here's the [document](http://www.onnxruntime.ai/docs/how-to/deploy-on-mobile.html#1-create-ort-format-model-and-configuration-file-with-required-operators) about how you can convert an ONNX model into ORT format.
### Tests
- [Tests for C API ](./ios_package_testTests/ios_package_test_c_api.m)
- [Tests for C++ API ](./ios_package_testTests/ios_package_test_cpp_api.mm)
## Build and Test iOS Framework using [build.py](../../../../../tools/ci_build/build.py)
Use the [build for iOS simulator](http://www.onnxruntime.ai/docs/how-to/build/android-ios.html#cross-build-for-ios-simulator) with `--build_apple_framework`
## Run the iOS End-to-End Test App standalone
### Requirements
- A pre-built ORT Mobile iOS framework, which can be built using the [instruction](#build-and-test-ios-framework-using-buildpy) above. The framework can be found as `<build_dir>/iOS/<build-config>/<build-config>-iphonesimulator/onnxruntime.framework`
### Steps
1. Go to this folder
2. Copy the [onnxruntime-mobile.podspec.template](./onnxruntime-mobile.podspec.template) to `onnxruntime-mobile.podspec`
3. Update the `onnxruntime-mobile.podspec`, replace `${ORT_BASE_FRAMEWORK_ARCHIVE}` with the path of a zip archive contains the pre-built ORT Mobile iOS framework
4. Run `pod install` to install the pre-built ORT Mobile iOS framework
5. Run the following command to perform the test
```
xcrun xcodebuild \
-workspace ./ios_package_test.xcworkspace \
-destination '<Your choice of test target device>' \
-scheme ios_package_test \
test
```

View file

@ -0,0 +1,474 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objects = {
/* Begin PBXBuildFile section */
229E5921265869BF006E41AE /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 229E5920265869BF006E41AE /* AppDelegate.m */; };
229E592A265869BF006E41AE /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 229E5928265869BF006E41AE /* Main.storyboard */; };
229E592F265869C2006E41AE /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 229E592D265869C2006E41AE /* LaunchScreen.storyboard */; };
229E5932265869C2006E41AE /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 229E5931265869C2006E41AE /* main.m */; };
229E593C265869C2006E41AE /* ios_package_test_cpp_api.mm in Sources */ = {isa = PBXBuildFile; fileRef = 229E593B265869C2006E41AE /* ios_package_test_cpp_api.mm */; };
229E595926586B4A006E41AE /* sigmoid.ort in Resources */ = {isa = PBXBuildFile; fileRef = 229E595826586B4A006E41AE /* sigmoid.ort */; };
229E595A26586B4A006E41AE /* sigmoid.ort in Resources */ = {isa = PBXBuildFile; fileRef = 229E595826586B4A006E41AE /* sigmoid.ort */; };
22DEADEE265905A7005CBD1C /* ios_package_test_c_api.m in Sources */ = {isa = PBXBuildFile; fileRef = 22DEADED265905A7005CBD1C /* ios_package_test_c_api.m */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
229E5938265869C2006E41AE /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 229E5914265869BF006E41AE /* Project object */;
proxyType = 1;
remoteGlobalIDString = 229E591B265869BF006E41AE;
remoteInfo = ios_package_test;
};
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
229E591C265869BF006E41AE /* ios_package_test.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ios_package_test.app; sourceTree = BUILT_PRODUCTS_DIR; };
229E591F265869BF006E41AE /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
229E5920265869BF006E41AE /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
229E5929265869BF006E41AE /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
229E592E265869C2006E41AE /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
229E5930265869C2006E41AE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
229E5931265869C2006E41AE /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
229E5937265869C2006E41AE /* ios_package_testTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ios_package_testTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
229E593B265869C2006E41AE /* ios_package_test_cpp_api.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = ios_package_test_cpp_api.mm; sourceTree = "<group>"; };
229E593D265869C2006E41AE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
229E595826586B4A006E41AE /* sigmoid.ort */ = {isa = PBXFileReference; lastKnownFileType = file; path = sigmoid.ort; sourceTree = "<group>"; };
22DEADED265905A7005CBD1C /* ios_package_test_c_api.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ios_package_test_c_api.m; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
229E5919265869BF006E41AE /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
229E5934265869C2006E41AE /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
229E5913265869BF006E41AE = {
isa = PBXGroup;
children = (
229E595426586A77006E41AE /* models */,
229E591E265869BF006E41AE /* ios_package_test */,
229E593A265869C2006E41AE /* ios_package_testTests */,
229E591D265869BF006E41AE /* Products */,
);
sourceTree = "<group>";
};
229E591D265869BF006E41AE /* Products */ = {
isa = PBXGroup;
children = (
229E591C265869BF006E41AE /* ios_package_test.app */,
229E5937265869C2006E41AE /* ios_package_testTests.xctest */,
);
name = Products;
sourceTree = "<group>";
};
229E591E265869BF006E41AE /* ios_package_test */ = {
isa = PBXGroup;
children = (
229E591F265869BF006E41AE /* AppDelegate.h */,
229E5920265869BF006E41AE /* AppDelegate.m */,
229E5928265869BF006E41AE /* Main.storyboard */,
229E592D265869C2006E41AE /* LaunchScreen.storyboard */,
229E5930265869C2006E41AE /* Info.plist */,
229E5931265869C2006E41AE /* main.m */,
);
path = ios_package_test;
sourceTree = "<group>";
};
229E593A265869C2006E41AE /* ios_package_testTests */ = {
isa = PBXGroup;
children = (
229E593B265869C2006E41AE /* ios_package_test_cpp_api.mm */,
229E593D265869C2006E41AE /* Info.plist */,
22DEADED265905A7005CBD1C /* ios_package_test_c_api.m */,
);
path = ios_package_testTests;
sourceTree = "<group>";
};
229E595426586A77006E41AE /* models */ = {
isa = PBXGroup;
children = (
229E595826586B4A006E41AE /* sigmoid.ort */,
);
path = models;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
229E591B265869BF006E41AE /* ios_package_test */ = {
isa = PBXNativeTarget;
buildConfigurationList = 229E594B265869C2006E41AE /* Build configuration list for PBXNativeTarget "ios_package_test" */;
buildPhases = (
229E5918265869BF006E41AE /* Sources */,
229E5919265869BF006E41AE /* Frameworks */,
229E591A265869BF006E41AE /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = ios_package_test;
productName = ios_package_test;
productReference = 229E591C265869BF006E41AE /* ios_package_test.app */;
productType = "com.apple.product-type.application";
};
229E5936265869C2006E41AE /* ios_package_testTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 229E594E265869C2006E41AE /* Build configuration list for PBXNativeTarget "ios_package_testTests" */;
buildPhases = (
229E5933265869C2006E41AE /* Sources */,
229E5934265869C2006E41AE /* Frameworks */,
229E5935265869C2006E41AE /* Resources */,
);
buildRules = (
);
dependencies = (
229E5939265869C2006E41AE /* PBXTargetDependency */,
);
name = ios_package_testTests;
productName = ios_package_testTests;
productReference = 229E5937265869C2006E41AE /* ios_package_testTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
229E5914265869BF006E41AE /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1250;
TargetAttributes = {
229E591B265869BF006E41AE = {
CreatedOnToolsVersion = 12.5;
};
229E5936265869C2006E41AE = {
CreatedOnToolsVersion = 12.5;
TestTargetID = 229E591B265869BF006E41AE;
};
};
};
buildConfigurationList = 229E5917265869BF006E41AE /* Build configuration list for PBXProject "ios_package_test" */;
compatibilityVersion = "Xcode 9.3";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 229E5913265869BF006E41AE;
productRefGroup = 229E591D265869BF006E41AE /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
229E591B265869BF006E41AE /* ios_package_test */,
229E5936265869C2006E41AE /* ios_package_testTests */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
229E591A265869BF006E41AE /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
229E592F265869C2006E41AE /* LaunchScreen.storyboard in Resources */,
229E595926586B4A006E41AE /* sigmoid.ort in Resources */,
229E592A265869BF006E41AE /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
229E5935265869C2006E41AE /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
229E595A26586B4A006E41AE /* sigmoid.ort in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
229E5918265869BF006E41AE /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
229E5921265869BF006E41AE /* AppDelegate.m in Sources */,
229E5932265869C2006E41AE /* main.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
229E5933265869C2006E41AE /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
229E593C265869C2006E41AE /* ios_package_test_cpp_api.mm in Sources */,
22DEADEE265905A7005CBD1C /* ios_package_test_c_api.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
229E5939265869C2006E41AE /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 229E591B265869BF006E41AE /* ios_package_test */;
targetProxy = 229E5938265869C2006E41AE /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
229E5928265869BF006E41AE /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
229E5929265869BF006E41AE /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
229E592D265869C2006E41AE /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
229E592E265869C2006E41AE /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
229E5949265869C2006E41AE /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
};
name = Debug;
};
229E594A265869C2006E41AE /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
};
name = Release;
};
229E594C265869C2006E41AE /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = ios_package_test/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = "ai.onnxruntime.tests.ios-package-test";
PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
229E594D265869C2006E41AE /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = ios_package_test/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = "ai.onnxruntime.tests.ios-package-test";
PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
229E594F265869C2006E41AE /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = ios_package_testTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = "ai.onnxruntime.tests.ios-package-testTests";
PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ios_package_test.app/ios_package_test";
};
name = Debug;
};
229E5950265869C2006E41AE /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = ios_package_testTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = "ai.onnxruntime.tests.ios-package-testTests";
PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ios_package_test.app/ios_package_test";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
229E5917265869BF006E41AE /* Build configuration list for PBXProject "ios_package_test" */ = {
isa = XCConfigurationList;
buildConfigurations = (
229E5949265869C2006E41AE /* Debug */,
229E594A265869C2006E41AE /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
229E594B265869C2006E41AE /* Build configuration list for PBXNativeTarget "ios_package_test" */ = {
isa = XCConfigurationList;
buildConfigurations = (
229E594C265869C2006E41AE /* Debug */,
229E594D265869C2006E41AE /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
229E594E265869C2006E41AE /* Build configuration list for PBXNativeTarget "ios_package_testTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
229E594F265869C2006E41AE /* Debug */,
229E5950265869C2006E41AE /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 229E5914265869BF006E41AE /* Project object */;
}

View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:">
</FileRef>
</Workspace>

View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>

View file

@ -0,0 +1,14 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
//
// AppDelegate.h
// ios_package_test
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@end

View file

@ -0,0 +1,40 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
//
// AppDelegate.m
// ios_package_test
//
#import "AppDelegate.h"
@interface AppDelegate ()
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
return YES;
}
#pragma mark - UISceneSession lifecycle
- (UISceneConfiguration *)application:(UIApplication *)application configurationForConnectingSceneSession:(UISceneSession *)connectingSceneSession options:(UISceneConnectionOptions *)options {
// Called when a new scene session is being created.
// Use this method to select a configuration to create the new scene with.
return [[UISceneConfiguration alloc] initWithName:@"Default Configuration" sessionRole:connectingSceneSession.role];
}
- (void)application:(UIApplication *)application didDiscardSceneSessions:(NSSet<UISceneSession *> *)sceneSessions {
// Called when the user discards a scene session.
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
}
@end

View file

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" xcode11CocoaTouchSystemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
</document>

View file

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="ViewController" customModuleProvider="" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" xcode11CocoaTouchSystemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
</document>

View file

@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<false/>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneConfigurationName</key>
<string>Default Configuration</string>
<key>UISceneDelegateClassName</key>
<string>SceneDelegate</string>
<key>UISceneStoryboardFile</key>
<string>Main</string>
</dict>
</array>
</dict>
</dict>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>

View file

@ -0,0 +1,18 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
//
// main.m
// ios_package_test
//
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int argc, char * argv[]) {
NSString * appDelegateClassName;
@autoreleasepool {
// Setup code that might create autoreleased objects goes here.
appDelegateClassName = NSStringFromClass([AppDelegate class]);
}
return UIApplicationMain(argc, argv, nil, appDelegateClassName);
}

View file

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>

View file

@ -0,0 +1,97 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
//
// ios_package_test_c_api.m
// ios_package_testTests
//
// This file hosts the tests of ORT C API, for tests of ORT C++ API, please see ios_package_test_cpp_api.mm
//
#import <XCTest/XCTest.h>
#include <math.h>
#include <onnxruntime/onnxruntime_c_api.h>
#define ASSERT_ON_ERROR(expr) \
do { \
OrtStatus* status = (expr); \
XCTAssertEqual(NULL, status, @"Failed with error message: %@", \
@(ort_env_->GetErrorMessage(status))); \
} while (0)
@interface ios_package_test_c_api : XCTestCase {
const OrtApi* ort_env_;
}
@end
@implementation ios_package_test_c_api
- (void)setUp {
// Put setup code here. This method is called before the invocation of each test method in the class.
ort_env_ = OrtGetApiBase()->GetApi(ORT_API_VERSION);
}
- (void)tearDown {
// Put teardown code here. This method is called after the invocation of each test method in the class.
}
- (void)testCAPI {
// This is an e2e test for ORT C API
OrtEnv* env = NULL;
ASSERT_ON_ERROR(ort_env_->CreateEnv(ORT_LOGGING_LEVEL_WARNING, "testCAPI", &env));
// initialize session options if needed
OrtSessionOptions* session_options;
ASSERT_ON_ERROR(ort_env_->CreateSessionOptions(&session_options));
ASSERT_ON_ERROR(ort_env_->SetIntraOpNumThreads(session_options, 1));
OrtSession* session;
NSString* ns_model_path = [[NSBundle mainBundle] pathForResource:@"sigmoid" ofType:@"ort"];
ASSERT_ON_ERROR(ort_env_->CreateSession(env, ns_model_path.UTF8String, session_options, &session));
size_t input_tensor_size = 3 * 4 * 5;
float input_tensor_values[input_tensor_size];
float expected_output_values[input_tensor_size];
const char* input_node_names[] = {"x"};
const char* output_node_names[] = {"y"};
const int64_t input_node_dims[] = {3, 4, 5};
for (size_t i = 0; i < input_tensor_size; i++) {
input_tensor_values[i] = (float)i - 30;
expected_output_values[i] = 1.0f / (1 + exp(-input_tensor_values[i]));
}
OrtMemoryInfo* memory_info;
ASSERT_ON_ERROR(ort_env_->CreateCpuMemoryInfo(OrtArenaAllocator, OrtMemTypeDefault, &memory_info));
OrtValue* input_tensor = NULL;
ASSERT_ON_ERROR(ort_env_->CreateTensorWithDataAsOrtValue(
memory_info, input_tensor_values, input_tensor_size * sizeof(float),
input_node_dims, 3, ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT, &input_tensor));
int is_tensor;
ASSERT_ON_ERROR(ort_env_->IsTensor(input_tensor, &is_tensor));
XCTAssertNotEqual(is_tensor, 0);
ort_env_->ReleaseMemoryInfo(memory_info);
OrtValue* output_tensor = NULL;
ASSERT_ON_ERROR(ort_env_->Run(session, NULL, input_node_names,
(const OrtValue* const*)&input_tensor, 1,
output_node_names, 1, &output_tensor));
ASSERT_ON_ERROR(ort_env_->IsTensor(output_tensor, &is_tensor));
XCTAssertNotEqual(is_tensor, 0);
// Get pointer to output tensor float values
float* output_values;
ASSERT_ON_ERROR(ort_env_->GetTensorMutableData(output_tensor, (void**)&output_values));
for (size_t i = 0; i < input_tensor_size; i++) {
XCTAssertEqualWithAccuracy(expected_output_values[i], output_values[i], 1e-6);
}
ort_env_->ReleaseValue(output_tensor);
ort_env_->ReleaseValue(input_tensor);
ort_env_->ReleaseSession(session);
ort_env_->ReleaseSessionOptions(session_options);
ort_env_->ReleaseEnv(env);
}
@end

View file

@ -0,0 +1,68 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
//
// ios_package_test_cpp_api.mm
// ios_package_testTests
//
// This file hosts the tests of ORT C++ API, for tests of ORT C API, please see ios_package_test_c_api.mm
//
#import <XCTest/XCTest.h>
#include <math.h>
#include <onnxruntime/onnxruntime_cxx_api.h>
@interface ios_package_test_cpp_api : XCTestCase
@end
@implementation ios_package_test_cpp_api
- (void)setUp {
// Put setup code here. This method is called before the invocation of each test method in the class.
}
- (void)tearDown {
// Put teardown code here. This method is called after the invocation of each test method in the class.
}
- (void)testCppAPI {
// This is an e2e test for ORT C++ API
Ort::Env env(ORT_LOGGING_LEVEL_WARNING, "testCppAPI");
// initialize session options if needed
Ort::SessionOptions session_options;
session_options.SetIntraOpNumThreads(1);
NSString* ns_model_path = [[NSBundle mainBundle] pathForResource:@"sigmoid" ofType:@"ort"];
Ort::Session session(env, ns_model_path.UTF8String, session_options);
size_t input_tensor_size = 3 * 4 * 5;
float input_tensor_values[input_tensor_size];
float expected_output_values[input_tensor_size];
const char* input_node_names[] = {"x"};
const char* output_node_names[] = {"y"};
const int64_t input_node_dims[] = {3, 4, 5};
for (size_t i = 0; i < input_tensor_size; i++) {
input_tensor_values[i] = (float)i - 30;
expected_output_values[i] = 1.0f / (1 + exp(-input_tensor_values[i]));
}
auto memory_info = Ort::MemoryInfo::CreateCpu(OrtArenaAllocator, OrtMemTypeDefault);
Ort::Value input_tensor =
Ort::Value::CreateTensor<float>(memory_info, input_tensor_values, input_tensor_size, input_node_dims, 3);
XCTAssert(input_tensor.IsTensor());
auto output_tensors = session.Run(Ort::RunOptions{nullptr}, input_node_names,
&input_tensor, 1, output_node_names, 1);
XCTAssertEqual(output_tensors.size(), 1);
XCTAssert(output_tensors.front().IsTensor());
// Get pointer to output tensor float values
float* output_values = output_tensors.front().GetTensorMutableData<float>();
for (size_t i = 0; i < input_tensor_size; i++) {
XCTAssertEqualWithAccuracy(expected_output_values[i], output_values[i], 1e-6);
}
}
@end

View file

@ -0,0 +1,18 @@
# This pod spec template is used to generate podspec file for running ios_package_test project,
# this is not a podspec template used by onnxruntime-mobile official CocoaPods package
Pod::Spec.new do |spec|
spec.name = "onnxruntime-mobile"
spec.version = "${ORT_VERSION}"
spec.summary = "Onnx Runtime C/C++ Package"
spec.description = <<-DESC
Onnx Runtime C/C++ framework pod.
DESC
spec.homepage = "https://github.com/microsoft/onnxruntime"
spec.license = { :type => 'MIT' }
spec.authors = { "ONNX Runtime" => "onnxruntime@microsoft.com" }
spec.platform = :ios, '13.0'
# if you are going to use a file as the spec.source, add 'file:' before your file path
spec.source = { :http => '${ORT_BASE_FRAMEWORK_ARCHIVE}' }
spec.vendored_frameworks = 'onnxruntime.framework'
end

View file

@ -1257,16 +1257,20 @@ def run_android_tests(args, source_dir, build_dir, config, cwd):
def run_ios_tests(args, source_dir, config, cwd):
cpr = run_subprocess(["xcodebuild", "test-without-building", "-project", "./onnxruntime.xcodeproj",
"-configuration", config,
"-scheme", "onnxruntime_test_all_xc", "-destination",
"platform=iOS Simulator,OS=latest,name=iPhone SE (2nd generation)"], cwd=cwd)
if cpr.returncode == 0:
cpr = run_subprocess(["xcodebuild", "test-without-building", "-project", "./onnxruntime.xcodeproj",
"-configuration", config,
"-scheme", "onnxruntime_shared_lib_test_xc", "-destination",
"platform=iOS Simulator,OS=latest,name=iPhone SE (2nd generation)"], cwd=cwd)
cpr.check_returncode()
run_subprocess(["xcodebuild", "test-without-building", "-project", "./onnxruntime.xcodeproj",
"-configuration", config,
"-scheme", "onnxruntime_test_all_xc", "-destination",
"platform=iOS Simulator,OS=latest,name=iPhone SE (2nd generation)"], cwd=cwd)
run_subprocess(["xcodebuild", "test-without-building", "-project", "./onnxruntime.xcodeproj",
"-configuration", config,
"-scheme", "onnxruntime_shared_lib_test_xc", "-destination",
"platform=iOS Simulator,OS=latest,name=iPhone SE (2nd generation)"], cwd=cwd)
if args.build_apple_framework:
package_test_py = os.path.join(source_dir, 'tools', 'ci_build', 'github', 'apple', 'test_ios_packages.py')
framework_dir = os.path.join(cwd, config + '-' + args.ios_sysroot)
run_subprocess([sys.executable, package_test_py, '--c_framework_dir', framework_dir], cwd=cwd)
def run_orttraining_test_orttrainer_frontend_separately(cwd):

View file

@ -0,0 +1,99 @@
#!/usr/bin/env python3
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import argparse
import os
import pathlib
import shutil
import subprocess
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
REPO_DIR = os.path.normpath(os.path.join(SCRIPT_DIR, "..", "..", "..", ".."))
def _test_ios_packages(args):
# check if CocoaPods is installed
if shutil.which('pod') is None:
if args.fail_if_cocoapods_missing:
raise ValueError('CocoaPods is required for this test')
else:
print('CocoaPods is not installed, ignore this test')
return
# Now we need to create a zip file contains the framework and the podspec file, both of these 2 files
# should be under the c_framework_dir
c_framework_dir = args.c_framework_dir.resolve()
if not c_framework_dir.is_dir():
raise FileNotFoundError('c_framework_dir {} is not a folder.'.format(c_framework_dir))
framework_path = os.path.join(c_framework_dir, 'onnxruntime.framework')
if not pathlib.Path(framework_path).exists():
raise FileNotFoundError('{} does not have onnxruntime.framework'.format(c_framework_dir))
# create a temp folder
import tempfile
with tempfile.TemporaryDirectory() as temp_dir:
# create a zip file contains the framework
# TODO, move this into a util function
local_pods_dir = os.path.join(temp_dir, 'local_pods')
os.makedirs(local_pods_dir, exist_ok=True)
# shutil.make_archive require target file as full path without extension
zip_base_filename = os.path.join(local_pods_dir, 'onnxruntime-mobile')
zip_file_path = zip_base_filename + '.zip'
shutil.make_archive(zip_base_filename, 'zip', root_dir=c_framework_dir, base_dir='onnxruntime.framework')
# copy the test project to the temp_dir
test_proj_path = os.path.join(REPO_DIR, 'onnxruntime', 'test', 'platform', 'ios', 'ios_package_test')
target_proj_path = os.path.join(temp_dir, 'ios_package_test')
shutil.copytree(test_proj_path, target_proj_path)
# update the podspec to point to the local framework zip file
local_podspec_path = os.path.join(target_proj_path, 'onnxruntime-mobile.podspec')
local_podspec_template = os.path.join(target_proj_path, 'onnxruntime-mobile.podspec.template')
with open(local_podspec_template, 'r') as file:
file_data = file.read()
# replace the target strings
file_data = file_data.replace('${ORT_BASE_FRAMEWORK_ARCHIVE}', 'file:' + zip_file_path)
with open(os.path.join(REPO_DIR, 'VERSION_NUMBER')) as version_file:
file_data = file_data.replace('${ORT_VERSION}', version_file.readline().strip())
# write the updated podspec
with open(local_podspec_path, 'w') as file:
file.write(file_data)
# install pods first
subprocess.run(['pod', 'install'], shell=False, check=True, cwd=target_proj_path)
# run the tests
subprocess.run(['xcrun', 'xcodebuild', 'test',
'-workspace', './ios_package_test.xcworkspace',
'-scheme', 'ios_package_test',
'-destination', 'platform=iOS Simulator,OS=latest,name=iPhone SE (2nd generation)'],
shell=False, check=True, cwd=target_proj_path)
def parse_args():
parser = argparse.ArgumentParser(
os.path.basename(__file__),
description='Test iOS framework using CocoaPods package.'
)
parser.add_argument('--fail_if_cocoapods_missing', action='store_true',
help='This script will fail if CocoaPods is not installed, '
'will not throw error unless fail_if_cocoapod_missing is set.')
parser.add_argument('--c_framework_dir', type=pathlib.Path, required=True,
help='Provide the parent directory for C/C++ framework')
return parser.parse_args()
def main():
args = parse_args()
_test_ios_packages(args)
if __name__ == '__main__':
main()

View file

@ -13,6 +13,7 @@ jobs:
--apple_deploy_target 12.1 \
--use_xcode \
--config RelWithDebInfo \
--build_apple_framework \
--parallel
displayName: (CPU EP) Build onnxruntime for iOS x86_64 and run tests using simulator
- script: |
@ -25,5 +26,6 @@ jobs:
--apple_deploy_target 12.1 \
--use_xcode \
--config RelWithDebInfo \
--build_apple_framework \
--parallel
displayName: (CoreML EP) Build onnxruntime for iOS x86_64 and run tests using simulator