Skip to content

Commit

Permalink
Added Test Target to iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacakakpo1 committed Mar 13, 2024
1 parent 01feb0f commit 6ea6317
Show file tree
Hide file tree
Showing 10 changed files with 496 additions and 68 deletions.
6 changes: 5 additions & 1 deletion iosApp/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@ target 'iosApp' do
use_frameworks!
platform :ios, '14.1'
pod 'JanusMessageSDK', :path => '../shared'
end
target 'iosAppTests' do
inherit! :search_paths
pod 'JanusMessageSDK', :path => '../shared'
end
end
2 changes: 1 addition & 1 deletion iosApp/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
JanusMessageSDK: e76862260037deafcfdfb13f6ac5b07754fd1de5

PODFILE CHECKSUM: f49c83502265f613b705206e564445714899ea9d
PODFILE CHECKSUM: 6fea51417d55986c80504b56ffb30e6a2af72e4c

COCOAPODS: 1.14.3
2 changes: 1 addition & 1 deletion iosApp/Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

268 changes: 231 additions & 37 deletions iosApp/Pods/Pods.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

186 changes: 185 additions & 1 deletion iosApp/iosApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,50 @@
058557BB273AAA24004C7B11 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 058557BA273AAA24004C7B11 /* Assets.xcassets */; };
058557D9273AAEEB004C7B11 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 058557D8273AAEEB004C7B11 /* Preview Assets.xcassets */; };
0CC814A545E1C976EBA748C7 /* Pods_iosApp.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3AAAC2B578EAD20A246D793 /* Pods_iosApp.framework */; };
0D2BA5114965F6C30576ED91 /* Pods_iosAppTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA973524561F17A2C9E67CC5 /* Pods_iosAppTests.framework */; };
2152FB042600AC8F00CF470E /* iOSApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2152FB032600AC8F00CF470E /* iOSApp.swift */; };
3B3B303A2BA1E258006A34DA /* iosAppTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B3B30392BA1E258006A34DA /* iosAppTests.swift */; };
3BECF9042B97613100EBC393 /* TestJanusClasses.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3BECF9032B97613100EBC393 /* TestJanusClasses.swift */; };
7555FF83242A565900829871 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7555FF82242A565900829871 /* ContentView.swift */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
3B3B303B2BA1E258006A34DA /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 7555FF73242A565900829871 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 7555FF7A242A565900829871;
remoteInfo = iosApp;
};
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
058557BA273AAA24004C7B11 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
058557D8273AAEEB004C7B11 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
188DAF2FABBA37A32814B133 /* Pods-iosAppTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iosAppTests.release.xcconfig"; path = "Target Support Files/Pods-iosAppTests/Pods-iosAppTests.release.xcconfig"; sourceTree = "<group>"; };
2152FB032600AC8F00CF470E /* iOSApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iOSApp.swift; sourceTree = "<group>"; };
26EE13455C0D4F5F6E1837B9 /* Pods-iosApp.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iosApp.release.xcconfig"; path = "Target Support Files/Pods-iosApp/Pods-iosApp.release.xcconfig"; sourceTree = "<group>"; };
36D257ED647A079807C30562 /* Pods-iosApp.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iosApp.debug.xcconfig"; path = "Target Support Files/Pods-iosApp/Pods-iosApp.debug.xcconfig"; sourceTree = "<group>"; };
3B3B30372BA1E258006A34DA /* iosAppTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = iosAppTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
3B3B30392BA1E258006A34DA /* iosAppTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iosAppTests.swift; sourceTree = "<group>"; };
3BECF9032B97613100EBC393 /* TestJanusClasses.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestJanusClasses.swift; sourceTree = "<group>"; };
7555FF7B242A565900829871 /* iosApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = iosApp.app; sourceTree = BUILT_PRODUCTS_DIR; };
7555FF82242A565900829871 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
7555FF8C242A565B00829871 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
C3AAAC2B578EAD20A246D793 /* Pods_iosApp.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_iosApp.framework; sourceTree = BUILT_PRODUCTS_DIR; };
DA973524561F17A2C9E67CC5 /* Pods_iosAppTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_iosAppTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
ED2FC06C531A4F20948107E5 /* Pods-iosAppTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iosAppTests.debug.xcconfig"; path = "Target Support Files/Pods-iosAppTests/Pods-iosAppTests.debug.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
3B3B30342BA1E258006A34DA /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
0D2BA5114965F6C30576ED91 /* Pods_iosAppTests.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
5A35C69E100F3AE987E3B02B /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
Expand All @@ -52,14 +77,24 @@
isa = PBXGroup;
children = (
C3AAAC2B578EAD20A246D793 /* Pods_iosApp.framework */,
DA973524561F17A2C9E67CC5 /* Pods_iosAppTests.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
3B3B30382BA1E258006A34DA /* iosAppTests */ = {
isa = PBXGroup;
children = (
3B3B30392BA1E258006A34DA /* iosAppTests.swift */,
);
path = iosAppTests;
sourceTree = "<group>";
};
7555FF72242A565900829871 = {
isa = PBXGroup;
children = (
7555FF7D242A565900829871 /* iosApp */,
3B3B30382BA1E258006A34DA /* iosAppTests */,
7555FF7C242A565900829871 /* Products */,
9C999BCA5598C299F4953B82 /* Pods */,
3B10BEBC7D6ED4E1A732260C /* Frameworks */,
Expand All @@ -70,6 +105,7 @@
isa = PBXGroup;
children = (
7555FF7B242A565900829871 /* iosApp.app */,
3B3B30372BA1E258006A34DA /* iosAppTests.xctest */,
);
name = Products;
sourceTree = "<group>";
Expand All @@ -92,13 +128,35 @@
children = (
36D257ED647A079807C30562 /* Pods-iosApp.debug.xcconfig */,
26EE13455C0D4F5F6E1837B9 /* Pods-iosApp.release.xcconfig */,
ED2FC06C531A4F20948107E5 /* Pods-iosAppTests.debug.xcconfig */,
188DAF2FABBA37A32814B133 /* Pods-iosAppTests.release.xcconfig */,
);
path = Pods;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
3B3B30362BA1E258006A34DA /* iosAppTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 3B3B303F2BA1E258006A34DA /* Build configuration list for PBXNativeTarget "iosAppTests" */;
buildPhases = (
BB7291B8777F08E77C178188 /* [CP] Check Pods Manifest.lock */,
3B3B30332BA1E258006A34DA /* Sources */,
3B3B30342BA1E258006A34DA /* Frameworks */,
3B3B30352BA1E258006A34DA /* Resources */,
016C05B79399AC37C9A676CC /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
dependencies = (
3B3B303C2BA1E258006A34DA /* PBXTargetDependency */,
);
name = iosAppTests;
productName = iosAppTests;
productReference = 3B3B30372BA1E258006A34DA /* iosAppTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
7555FF7A242A565900829871 /* iosApp */ = {
isa = PBXNativeTarget;
buildConfigurationList = 7555FFA5242A565B00829871 /* Build configuration list for PBXNativeTarget "iosApp" */;
Expand All @@ -124,10 +182,14 @@
7555FF73242A565900829871 /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 1130;
LastSwiftUpdateCheck = 1520;
LastUpgradeCheck = 1130;
ORGANIZATIONNAME = orgName;
TargetAttributes = {
3B3B30362BA1E258006A34DA = {
CreatedOnToolsVersion = 15.2;
TestTargetID = 7555FF7A242A565900829871;
};
7555FF7A242A565900829871 = {
CreatedOnToolsVersion = 11.3.1;
};
Expand All @@ -147,11 +209,19 @@
projectRoot = "";
targets = (
7555FF7A242A565900829871 /* iosApp */,
3B3B30362BA1E258006A34DA /* iosAppTests */,
);
};
/* End PBXProject section */

/* Begin PBXResourcesBuildPhase section */
3B3B30352BA1E258006A34DA /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
7555FF79242A565900829871 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
Expand All @@ -164,6 +234,23 @@
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
016C05B79399AC37C9A676CC /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-iosAppTests/Pods-iosAppTests-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-iosAppTests/Pods-iosAppTests-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-iosAppTests/Pods-iosAppTests-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
ACFE0D7A4827DF13A85C133C /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand Down Expand Up @@ -203,9 +290,39 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
BB7291B8777F08E77C178188 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-iosAppTests-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
3B3B30332BA1E258006A34DA /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
3B3B303A2BA1E258006A34DA /* iosAppTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
7555FF77242A565900829871 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
Expand All @@ -218,7 +335,65 @@
};
/* End PBXSourcesBuildPhase section */

/* Begin PBXTargetDependency section */
3B3B303C2BA1E258006A34DA /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 7555FF7A242A565900829871 /* iosApp */;
targetProxy = 3B3B303B2BA1E258006A34DA /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */

/* Begin XCBuildConfiguration section */
3B3B303D2BA1E258006A34DA /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = ED2FC06C531A4F20948107E5 /* Pods-iosAppTests.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
BUNDLE_LOADER = "$(TEST_HOST)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu17;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 17.2;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = utopia.iosAppTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
SWIFT_EMIT_LOC_STRINGS = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/iosApp.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/iosApp";
};
name = Debug;
};
3B3B303E2BA1E258006A34DA /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 188DAF2FABBA37A32814B133 /* Pods-iosAppTests.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
BUNDLE_LOADER = "$(TEST_HOST)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu17;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 17.2;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = utopia.iosAppTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/iosApp.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/iosApp";
};
name = Release;
};
7555FFA3242A565B00829871 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
Expand Down Expand Up @@ -378,6 +553,15 @@
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
3B3B303F2BA1E258006A34DA /* Build configuration list for PBXNativeTarget "iosAppTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
3B3B303D2BA1E258006A34DA /* Debug */,
3B3B303E2BA1E258006A34DA /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
7555FF76242A565900829871 /* Build configuration list for PBXProject "iosApp" */ = {
isa = XCConfigurationList;
buildConfigurations = (
Expand Down
26 changes: 1 addition & 25 deletions iosApp/iosApp/TestJanusClasses.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,7 @@ func testJanus(){
//CreateTransaction(janus: String, transaction: <#T##String#>)
let createTransaction = CreateTransaction(transaction: "").default()
//let result = try! JanusUtils().encode(cls: createTransaction)
JanusKt.decodeJanusMessage(message: "{\n" +
" \"janus\": \"event\",\n" +
" \"plugindata\": {\n" +
" \"data\": {\n" +
" \"result\": {\n" +
" \"event\": \"registered\",\n" +
" \"headers\": {},\n" +
" \"master_id\": 2656454203,\n" +
" \"register_sent\": true,\n" +
" \"username\": \"isaac28055\"\n" +
" },\n" +
" \"sip\": \"event\"\n" +
" },\n" +
" \"plugin\": \"janus.plugin.sip\"\n" +
" },\n" +
" \"sender\": 485245946375374,\n" +
" \"session_id\": 2496119861992003\n" +
"}") { method, base in
if(method == JanusEvent.registered){
var mom = base as! RegisterSuccess
print("Transaction => \(mom.sessionId)" )

}
print("method : \(method)")
}

print("Transaction => " + createTransaction.encode() )

//JanusUtils.encode(createTransaction.default())
Expand Down
Loading

0 comments on commit 6ea6317

Please sign in to comment.