Skip to content

Commit

Permalink
iOS: Testplan tweaks and support next Cordova major (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
dpogue authored Aug 19, 2024
1 parent f240f44 commit 9ce3f01
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 4 deletions.
14 changes: 14 additions & 0 deletions tests/ios/App/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,18 @@ import Cordova

@UIApplicationMain
class AppDelegate: CDVAppDelegate {
var _window : UIWindow?;

override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
let bounds = UIScreen.main.bounds;

let window = UIWindow(frame: bounds);
window.autoresizesSubviews = true;
window.rootViewController = CDVViewController();
window.makeKeyAndVisible();

self._window = window;

return true;
}
}
4 changes: 3 additions & 1 deletion tests/ios/OAuthPluginTests.xcodeproj/DeviceTests.xctestplan
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@
],
"defaultOptions" : {
"codeCoverage" : false,
"repeatInNewRunnerProcess" : true,
"targetForVariableExpansion" : {
"containerPath" : "container:OAuthPluginTests.xcodeproj",
"identifier" : "905131B827F1631300AC00FC",
"name" : "OAuthPluginTest"
}
},
"testRepetitionMode" : "retryOnFailure"
},
"testTargets" : [
{
Expand Down
4 changes: 3 additions & 1 deletion tests/ios/OAuthPluginTests.xcodeproj/UnitTests.xctestplan
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@
],
"defaultOptions" : {
"codeCoverage" : true,
"repeatInNewRunnerProcess" : true,
"targetForVariableExpansion" : {
"containerPath" : "container:OAuthPluginTests.xcodeproj",
"identifier" : "905131B827F1631300AC00FC",
"name" : "OAuthPluginTest"
}
},
"testRepetitionMode" : "retryOnFailure"
},
"testTargets" : [
{
Expand Down
4 changes: 4 additions & 0 deletions tests/ios/OAuthPluginTests.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
Expand Down Expand Up @@ -341,6 +342,7 @@
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
Expand Down Expand Up @@ -370,6 +372,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
Expand Down Expand Up @@ -402,6 +405,7 @@
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
Expand Down
4 changes: 2 additions & 2 deletions tests/ios/Tests/Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@ class OAuthPluginTests: XCTestCase {
var plugin: OAuthPlugin!
var cmdDlg: MockCommandDelegate!
var webEngine: MockWebViewEngine!
var vc: UIViewController!
var vc: CDVViewController!

override func setUpWithError() throws {
// Always reset this to the default
OAuthPlugin.forcedVersion = UInt32.max

vc = UIViewController()
vc = CDVViewController()
cmdDlg = MockCommandDelegate()
webEngine = MockWebViewEngine(frame: CGRect(x: 0, y: 0, width: 0, height: 0))

Expand Down

0 comments on commit 9ce3f01

Please sign in to comment.