Repository: cordova-plugins Updated Branches: refs/heads/master d53522252 -> 6130d49e4
CLI utility to create Obj-C unit tests and js stub for a plugin. i.e. create-test-files CDVMyPlugin cordova-plugin-my Project: http://git-wip-us.apache.org/repos/asf/cordova-plugins/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugins/commit/6130d49e Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugins/tree/6130d49e Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugins/diff/6130d49e Branch: refs/heads/master Commit: 6130d49e4d3f8ad0810c41ea8d616f0a999ae09e Parents: d535222 Author: Shazron Abdullah <[email protected]> Authored: Tue Jun 28 18:00:13 2016 -0700 Committer: Shazron Abdullah <[email protected]> Committed: Tue Jun 28 18:00:13 2016 -0700 ---------------------------------------------------------------------- create-test-files/create-test-files.js | 155 ++++++ create-test-files/package.json | 15 + create-test-files/tests-template/ios/README.md | 40 ++ .../contents.xcworkspacedata | 7 + .../__PROJECT_NAME__Test.xccheckout | 41 ++ .../xcshareddata/xcschemes/CordovaLib.xcscheme | 77 +++ .../ios/__PROJECT_NAME__Test/.gitignore | 1 + .../__PROJECT_NAME__LibTests/Info.plist | 44 ++ .../__PROJECT_NAME__Test.m | 57 +++ .../project.pbxproj | 499 +++++++++++++++++++ .../contents.xcworkspacedata | 7 + .../__PROJECT_NAME__Test.xccheckout | 41 ++ .../xcschemes/__PROJECT_NAME__Lib.xcscheme | 77 +++ .../xcschemes/__PROJECT_NAME__LibTests.xcscheme | 96 ++++ .../tests-template/ios/package.json | 13 + create-test-files/tests-template/plugin.xml | 29 ++ create-test-files/tests-template/tests.js | 44 ++ 17 files changed, 1243 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/6130d49e/create-test-files/create-test-files.js ---------------------------------------------------------------------- diff --git a/create-test-files/create-test-files.js b/create-test-files/create-test-files.js new file mode 100755 index 0000000..eafe668 --- /dev/null +++ b/create-test-files/create-test-files.js @@ -0,0 +1,155 @@ +#!/usr/bin/env node + +/* + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +*/ + +var shell = require('shelljs'); +var path = require('path'); +var argv = require('nopt')({ + 'help' : Boolean, + 'template-path' : String +}); + +var projectName = argv.argv.remain[0]; +var repoName = argv.argv.remain[1]; + +if (argv.help || !projectName || !repoName) { + console.log('Usage: $0 [--template-path] <project_name> <repo_name>'); + console.log(' <project_name>: Plugin name, i.e. CDVFoo'); + console.log(' <repo_name>: Repo name'); + console.log(' [--template-path]: Path to test template (override).'); + process.exit(0); +} + +var tests_template_folder = argv.template-path || path.join(__dirname, "tests-template"); + +processTemplateFiles(projectName, repoName); + +function processTemplateFiles(project_name, repo_name) { + + var project_name_esc = project_name.replace(/&/g, '\\&'); + var repo_name_esc = repo_name.replace(/&/g, '\\&'); + + /* + tests-template/ios/__PROJECT_NAME__Test/__PROJECT_NAME__LibTests/__PROJECT_NAME__Test.m + tests-template/ios/__PROJECT_NAME__Test/__PROJECT_NAME__LibTests/Info.plist + tests-template/ios/__PROJECT_NAME__Test/__PROJECT_NAME__Test.xcodeproj/project.pbxproj + tests-template/ios/__PROJECT_NAME__Test/__PROJECT_NAME__Test.xcodeproj/project.xcworkspace/contents.xcworkspacedata + tests-template/ios/__PROJECT_NAME__Test/__PROJECT_NAME__Test.xcodeproj/project.xcworkspace/xcshareddata/__PROJECT_NAME__Test.xccheckout + tests-template/ios/__PROJECT_NAME__Test/__PROJECT_NAME__Test.xcodeproj/xcshareddata/xcschemes/__PROJECT_NAME__Lib.xcscheme + tests-template/ios/__PROJECT_NAME__Test/__PROJECT_NAME__Test.xcodeproj/xcshareddata/xcschemes/__PROJECT_NAME__LibTests.xcscheme + tests-template/ios/__PROJECT_NAME__Test.xcworkspace/xcshareddata/__PROJECT_NAME__Test.xccheckout + tests-template/ios/__PROJECT_NAME__Test.xcworkspace/contents.xcworkspacedata + tests-template/ios/package.json + tests-template/ios/README.md + tests-template/plugin.xml + tests-template/tests.js + */ + + // substitute token __PROJECT_NAME__ in files + var r = tests_template_folder; + + shell.sed('-i', /__PROJECT_NAME__/g, project_name_esc, path.join(r, 'plugin.xml')); + shell.sed('-i', /__PROJECT_NAME__/g, project_name_esc, path.join(r, 'tests.js')); + shell.sed('-i', /__PROJECT_NAME__/g, project_name_esc, path.join(r, 'ios', 'README.md')); + shell.sed('-i', /__PROJECT_NAME__/g, project_name_esc, path.join(r, 'ios', 'package.json')); + shell.sed('-i', /__PROJECT_NAME__/g, project_name_esc, path.join(r, 'ios', '__PROJECT_NAME__Test.xcworkspace', 'contents.xcworkspacedata')); + shell.sed('-i', /__PROJECT_NAME__/g, project_name_esc, path.join(r, 'ios', '__PROJECT_NAME__Test.xcworkspace', 'xcshareddata', '__PROJECT_NAME__Test.xccheckout')); + + var x = path.join(r, 'ios', '__PROJECT_NAME__Test', '__PROJECT_NAME__Test.xcodeproj'); + + shell.sed('-i', /__PROJECT_NAME__/g, project_name_esc, path.join(x, 'xcshareddata', 'xcschemes', '__PROJECT_NAME__LibTests.xcscheme')); + shell.sed('-i', /__PROJECT_NAME__/g, project_name_esc, path.join(x, 'xcshareddata', 'xcschemes', '__PROJECT_NAME__Lib.xcscheme')); + shell.sed('-i', /__PROJECT_NAME__/g, project_name_esc, path.join(x, 'project.xcworkspace', 'xcshareddata','__PROJECT_NAME__Test.xccheckout')); + shell.sed('-i', /__PROJECT_NAME__/g, project_name_esc, path.join(x, 'project.xcworkspace', 'contents.xcworkspacedata')); + shell.sed('-i', /__PROJECT_NAME__/g, project_name_esc, path.join(x, 'project.pbxproj')); + + var l = path.join(r, 'ios', '__PROJECT_NAME__Test', '__PROJECT_NAME__LibTests'); + + shell.sed('-i', /__PROJECT_NAME__/g, project_name_esc, path.join(l, 'Info.plist')); + shell.sed('-i', /__PROJECT_NAME__/g, project_name_esc, path.join(l, '__PROJECT_NAME__Test.m')); + + // substitute token __REPO_NAME__ in files + + shell.sed('-i', /__REPO_NAME__/g, repo_name_esc, path.join(r, 'plugin.xml')); + shell.sed('-i', /__REPO_NAME__/g, repo_name_esc, path.join(r, 'tests.js')); + shell.sed('-i', /__REPO_NAME__/g, repo_name_esc, path.join(r, 'ios', 'README.md')); + shell.sed('-i', /__REPO_NAME__/g, repo_name_esc, path.join(r, 'ios', 'package.json')); + shell.sed('-i', /__REPO_NAME__/g, repo_name_esc, path.join(r, 'ios', '__PROJECT_NAME__Test.xcworkspace', 'contents.xcworkspacedata')); + shell.sed('-i', /__REPO_NAME__/g, repo_name_esc, path.join(r, 'ios', '__PROJECT_NAME__Test.xcworkspace', 'xcshareddata', '__PROJECT_NAME__Test.xccheckout')); + + shell.sed('-i', /__REPO_NAME__/g, repo_name_esc, path.join(x, 'xcshareddata', 'xcschemes', '__PROJECT_NAME__LibTests.xcscheme')); + shell.sed('-i', /__REPO_NAME__/g, repo_name_esc, path.join(x, 'xcshareddata', 'xcschemes', '__PROJECT_NAME__Lib.xcscheme')); + shell.sed('-i', /__REPO_NAME__/g, repo_name_esc, path.join(x, 'project.xcworkspace', 'xcshareddata','__PROJECT_NAME__Test.xccheckout')); + shell.sed('-i', /__REPO_NAME__/g, repo_name_esc, path.join(x, 'project.xcworkspace', 'contents.xcworkspacedata')); + shell.sed('-i', /__REPO_NAME__/g, repo_name_esc, path.join(x, 'project.pbxproj')); + + shell.sed('-i', /__REPO_NAME__/g, repo_name_esc, path.join(l, 'Info.plist')); + shell.sed('-i', /__REPO_NAME__/g, repo_name_esc, path.join(l, '__PROJECT_NAME__Test.m')); + + /* + tests-template/ios/__PROJECT_NAME__/__PROJECT_NAME__Test.xcodeproj/project.xcworkspace/xcshareddata/__PROJECT_NAME__Test.xccheckout + tests-template/ios/__PROJECT_NAME__/__PROJECT_NAME__Test.xcodeproj/xcshareddata/xcschemes/__PROJECT_NAME__Lib.xcscheme + tests-template/ios/__PROJECT_NAME__/__PROJECT_NAME__Test.xcodeproj/xcshareddata/xcschemes/__PROJECT_NAME__LibTests.xcscheme + tests-template/ios/__PROJECT_NAME__/__PROJECT_NAME__Test.xcodeproj + tests-template/ios/__PROJECT_NAME__Test.xcworkspace/xcshareddata/__PROJECT_NAME__Test.xccheckout + tests-template/ios/__PROJECT_NAME__Test.xcworkspace + tests-template/ios/__PROJECT_NAME__/__PROJECT_NAME__LibTests/__PROJECT_NAME__Test.m + tests-template/ios/__PROJECT_NAME__/__PROJECT_NAME__LibTests + tests-template/ios/__PROJECT_NAME__ + */ + + // rename folders + + shell.mv('-f', + path.join(x, 'project.xcworkspace', 'xcshareddata', '__PROJECT_NAME__Test.xccheckout'), + path.join(x, 'project.xcworkspace', 'xcshareddata', project_name_esc + 'Test.xccheckout') + ); + shell.mv('-f', + path.join(x, 'xcshareddata', 'xcschemes', '__PROJECT_NAME__Lib.xcscheme'), + path.join(x, 'xcshareddata', 'xcschemes', project_name_esc + 'Lib.xcscheme') + ); + shell.mv('-f', + path.join(x, 'xcshareddata', 'xcschemes', '__PROJECT_NAME__LibTests.xcscheme'), + path.join(x, 'xcshareddata', 'xcschemes', project_name_esc + 'LibTests.xcscheme') + ); + shell.mv('-f', + path.join(r, 'ios', '__PROJECT_NAME__Test', '__PROJECT_NAME__Test.xcodeproj'), + path.join(r, 'ios', '__PROJECT_NAME__Test', project_name_esc + 'Test.xcodeproj') + ); + shell.mv('-f', + path.join(r, 'ios', '__PROJECT_NAME__Test.xcworkspace', 'xcshareddata', '__PROJECT_NAME__Test.xccheckout'), + path.join(r, 'ios', '__PROJECT_NAME__Test.xcworkspace', 'xcshareddata', project_name_esc + 'Test.xccheckout') + ); + shell.mv('-f', + path.join(r, 'ios', '__PROJECT_NAME__Test.xcworkspace'), + path.join(r, 'ios', project_name_esc + 'Test.xcworkspace') + ); + shell.mv('-f', + path.join(r, 'ios', '__PROJECT_NAME__Test', '__PROJECT_NAME__LibTests', '__PROJECT_NAME__Test.m'), + path.join(r, 'ios', '__PROJECT_NAME__Test', '__PROJECT_NAME__LibTests', project_name_esc + 'Test.m') + ); + shell.mv('-f', + path.join(r, 'ios', '__PROJECT_NAME__Test', '__PROJECT_NAME__LibTests'), + path.join(r, 'ios', '__PROJECT_NAME__Test', project_name_esc + 'LibTests') + ); + shell.mv('-f', + path.join(r, 'ios', '__PROJECT_NAME__Test'), + path.join(r, 'ios', project_name_esc + "Test") + ); +} + http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/6130d49e/create-test-files/package.json ---------------------------------------------------------------------- diff --git a/create-test-files/package.json b/create-test-files/package.json new file mode 100644 index 0000000..5e0e81d --- /dev/null +++ b/create-test-files/package.json @@ -0,0 +1,15 @@ +{ + "name": "create-test-files", + "version": "1.0.0", + "description": "Create Obj-C test files and js test stub for a plugin.", + "main": "create-test-files.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "Apache-2.0", + "dependencies": { + "nopt": "^3.0.6", + "shelljs": "^0.7.0" + } +} http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/6130d49e/create-test-files/tests-template/ios/README.md ---------------------------------------------------------------------- diff --git a/create-test-files/tests-template/ios/README.md b/create-test-files/tests-template/ios/README.md new file mode 100644 index 0000000..0949a43 --- /dev/null +++ b/create-test-files/tests-template/ios/README.md @@ -0,0 +1,40 @@ +<!-- +# license: Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +--> + +# iOS Tests for __PROJECT_NAME__ + +You need to install `node.js` to pull in `cordova-ios`. + +First install cordova-ios: + + npm install + +... in the current folder. + + +# Testing from Xcode + +1. Launch the `__PROJECT_NAME__Test.xcworkspace` file. +2. Choose "__PROJECT_NAME__LibTests" from the scheme drop-down menu +3. Click and hold on the `Play` button, and choose the `Wrench` icon to run the tests + + +# Testing from the command line + + npm test http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/6130d49e/create-test-files/tests-template/ios/__PROJECT_NAME__Test.xcworkspace/contents.xcworkspacedata ---------------------------------------------------------------------- diff --git a/create-test-files/tests-template/ios/__PROJECT_NAME__Test.xcworkspace/contents.xcworkspacedata b/create-test-files/tests-template/ios/__PROJECT_NAME__Test.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..6e3ea30 --- /dev/null +++ b/create-test-files/tests-template/ios/__PROJECT_NAME__Test.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Workspace + version = "1.0"> + <FileRef + location = "container:__PROJECT_NAME__Test/__PROJECT_NAME__Test.xcodeproj"> + </FileRef> +</Workspace> http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/6130d49e/create-test-files/tests-template/ios/__PROJECT_NAME__Test.xcworkspace/xcshareddata/__PROJECT_NAME__Test.xccheckout ---------------------------------------------------------------------- diff --git a/create-test-files/tests-template/ios/__PROJECT_NAME__Test.xcworkspace/xcshareddata/__PROJECT_NAME__Test.xccheckout b/create-test-files/tests-template/ios/__PROJECT_NAME__Test.xcworkspace/xcshareddata/__PROJECT_NAME__Test.xccheckout new file mode 100644 index 0000000..b923e92 --- /dev/null +++ b/create-test-files/tests-template/ios/__PROJECT_NAME__Test.xcworkspace/xcshareddata/__PROJECT_NAME__Test.xccheckout @@ -0,0 +1,41 @@ +<?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>IDESourceControlProjectFavoriteDictionaryKey</key> + <false/> + <key>IDESourceControlProjectIdentifier</key> + <string>6BE9AD73-1B9F-4362-98D7-DC631BEC6185</string> + <key>IDESourceControlProjectName</key> + <string>__PROJECT_NAME__Test</string> + <key>IDESourceControlProjectOriginsDictionary</key> + <dict> + <key>BEF5A5D0FF64801E558286389440357A9233D7DB</key> + <string>https://git-wip-us.apache.org/repos/asf/__REPO_NAME__.git</string> + </dict> + <key>IDESourceControlProjectPath</key> + <string>tests/ios/__PROJECT_NAME__Test/__PROJECT_NAME__Test.xcodeproj</string> + <key>IDESourceControlProjectRelativeInstallPathDictionary</key> + <dict> + <key>BEF5A5D0FF64801E558286389440357A9233D7DB</key> + <string>../../../../..</string> + </dict> + <key>IDESourceControlProjectURL</key> + <string>https://git-wip-us.apache.org/repos/asf/__REPO_NAME__.git</string> + <key>IDESourceControlProjectVersion</key> + <integer>111</integer> + <key>IDESourceControlProjectWCCIdentifier</key> + <string>BEF5A5D0FF64801E558286389440357A9233D7DB</string> + <key>IDESourceControlProjectWCConfigurations</key> + <array> + <dict> + <key>IDESourceControlRepositoryExtensionIdentifierKey</key> + <string>public.vcs.git</string> + <key>IDESourceControlWCCIdentifierKey</key> + <string>BEF5A5D0FF64801E558286389440357A9233D7DB</string> + <key>IDESourceControlWCCName</key> + <string>__REPO_NAME__</string> + </dict> + </array> +</dict> +</plist> http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/6130d49e/create-test-files/tests-template/ios/__PROJECT_NAME__Test.xcworkspace/xcshareddata/xcschemes/CordovaLib.xcscheme ---------------------------------------------------------------------- diff --git a/create-test-files/tests-template/ios/__PROJECT_NAME__Test.xcworkspace/xcshareddata/xcschemes/CordovaLib.xcscheme b/create-test-files/tests-template/ios/__PROJECT_NAME__Test.xcworkspace/xcshareddata/xcschemes/CordovaLib.xcscheme new file mode 100644 index 0000000..13f9a15 --- /dev/null +++ b/create-test-files/tests-template/ios/__PROJECT_NAME__Test.xcworkspace/xcshareddata/xcschemes/CordovaLib.xcscheme @@ -0,0 +1,77 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Scheme + LastUpgradeVersion = "0600" + version = "1.3"> + <BuildAction + parallelizeBuildables = "YES" + buildImplicitDependencies = "YES"> + <BuildActionEntries> + <BuildActionEntry + buildForTesting = "YES" + buildForRunning = "YES" + buildForProfiling = "YES" + buildForArchiving = "YES" + buildForAnalyzing = "YES"> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "D2AAC07D0554694100DB518D" + BuildableName = "libCordova.a" + BlueprintName = "CordovaLib" + ReferencedContainer = "container:node_modules/cordova-ios/CordovaLib/CordovaLib.xcodeproj"> + </BuildableReference> + </BuildActionEntry> + </BuildActionEntries> + </BuildAction> + <TestAction + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + shouldUseLaunchSchemeArgsEnv = "YES" + buildConfiguration = "Debug"> + <Testables> + </Testables> + </TestAction> + <LaunchAction + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + launchStyle = "0" + useCustomWorkingDirectory = "NO" + buildConfiguration = "Debug" + ignoresPersistentStateOnLaunch = "NO" + debugDocumentVersioning = "YES" + allowLocationSimulation = "YES"> + <MacroExpansion> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "D2AAC07D0554694100DB518D" + BuildableName = "libCordova.a" + BlueprintName = "CordovaLib" + ReferencedContainer = "container:node_modules/cordova-ios/CordovaLib/CordovaLib.xcodeproj"> + </BuildableReference> + </MacroExpansion> + <AdditionalOptions> + </AdditionalOptions> + </LaunchAction> + <ProfileAction + shouldUseLaunchSchemeArgsEnv = "YES" + savedToolIdentifier = "" + useCustomWorkingDirectory = "NO" + buildConfiguration = "Release" + debugDocumentVersioning = "YES"> + <MacroExpansion> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "D2AAC07D0554694100DB518D" + BuildableName = "libCordova.a" + BlueprintName = "CordovaLib" + ReferencedContainer = "container:node_modules/cordova-ios/CordovaLib/CordovaLib.xcodeproj"> + </BuildableReference> + </MacroExpansion> + </ProfileAction> + <AnalyzeAction + buildConfiguration = "Debug"> + </AnalyzeAction> + <ArchiveAction + buildConfiguration = "Release" + revealArchiveInOrganizer = "YES"> + </ArchiveAction> +</Scheme> http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/6130d49e/create-test-files/tests-template/ios/__PROJECT_NAME__Test/.gitignore ---------------------------------------------------------------------- diff --git a/create-test-files/tests-template/ios/__PROJECT_NAME__Test/.gitignore b/create-test-files/tests-template/ios/__PROJECT_NAME__Test/.gitignore new file mode 100644 index 0000000..c795b05 --- /dev/null +++ b/create-test-files/tests-template/ios/__PROJECT_NAME__Test/.gitignore @@ -0,0 +1 @@ +build \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/6130d49e/create-test-files/tests-template/ios/__PROJECT_NAME__Test/__PROJECT_NAME__LibTests/Info.plist ---------------------------------------------------------------------- diff --git a/create-test-files/tests-template/ios/__PROJECT_NAME__Test/__PROJECT_NAME__LibTests/Info.plist b/create-test-files/tests-template/ios/__PROJECT_NAME__Test/__PROJECT_NAME__LibTests/Info.plist new file mode 100644 index 0000000..95c8add --- /dev/null +++ b/create-test-files/tests-template/ios/__PROJECT_NAME__Test/__PROJECT_NAME__LibTests/Info.plist @@ -0,0 +1,44 @@ +<?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"> +<!-- +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +--> +<plist version="1.0"> +<dict> + <key>CFBundleDevelopmentRegion</key> + <string>en</string> + <key>CFBundleExecutable</key> + <string>$(EXECUTABLE_NAME)</string> + <key>CFBundleIdentifier</key> + <string>org.apache.cordova.$(PRODUCT_NAME:rfc1034identifier)</string> + <key>CFBundleInfoDictionaryVersion</key> + <string>6.0</string> + <key>CFBundleName</key> + <string>$(PRODUCT_NAME)</string> + <key>CFBundlePackageType</key> + <string>BNDL</string> + <key>CFBundleShortVersionString</key> + <string>1.0</string> + <key>CFBundleSignature</key> + <string>????</string> + <key>CFBundleVersion</key> + <string>1</string> +</dict> +</plist> http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/6130d49e/create-test-files/tests-template/ios/__PROJECT_NAME__Test/__PROJECT_NAME__LibTests/__PROJECT_NAME__Test.m ---------------------------------------------------------------------- diff --git a/create-test-files/tests-template/ios/__PROJECT_NAME__Test/__PROJECT_NAME__LibTests/__PROJECT_NAME__Test.m b/create-test-files/tests-template/ios/__PROJECT_NAME__Test/__PROJECT_NAME__LibTests/__PROJECT_NAME__Test.m new file mode 100644 index 0000000..eb2a80c --- /dev/null +++ b/create-test-files/tests-template/ios/__PROJECT_NAME__Test/__PROJECT_NAME__LibTests/__PROJECT_NAME__Test.m @@ -0,0 +1,57 @@ +/* + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + */ + +#import <UIKit/UIKit.h> +#import <XCTest/XCTest.h> +#import "__PROJECT_NAME__.h" + +@interface __PROJECT_NAME__Test : XCTestCase + +@property (nonatomic, strong) __PROJECT_NAME__* plugin; + +@end + +@interface __PROJECT_NAME__ () + +// TODO: expose private interface, if needed + +@end + +@implementation __PROJECT_NAME__Test + +- (void)setUp { + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. + + self.plugin = [[__PROJECT_NAME__ alloc] init]; +} + +- (void)tearDown { + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void) test__PROJECT_NAME__ { + + // Failing tests + XCTAssertTrue(NO); + XCTAssertFalse(YES); +} + +@end http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/6130d49e/create-test-files/tests-template/ios/__PROJECT_NAME__Test/__PROJECT_NAME__Test.xcodeproj/project.pbxproj ---------------------------------------------------------------------- diff --git a/create-test-files/tests-template/ios/__PROJECT_NAME__Test/__PROJECT_NAME__Test.xcodeproj/project.pbxproj b/create-test-files/tests-template/ios/__PROJECT_NAME__Test/__PROJECT_NAME__Test.xcodeproj/project.pbxproj new file mode 100644 index 0000000..e3dc61d --- /dev/null +++ b/create-test-files/tests-template/ios/__PROJECT_NAME__Test/__PROJECT_NAME__Test.xcodeproj/project.pbxproj @@ -0,0 +1,499 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 7E9F51AB19DA10AE00DA31AC /* __PROJECT_NAME__.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E9F51A919DA10AE00DA31AC /* __PROJECT_NAME__.m */; }; + 7E9F51B119DA114400DA31AC /* __PROJECT_NAME__Test.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E9F51B019DA114400DA31AC /* __PROJECT_NAME__Test.m */; }; + 7E9F51B319DA116500DA31AC /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7E9F51B219DA116500DA31AC /* Foundation.framework */; }; + 7E9F51B519DA127E00DA31AC /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7E9F51B419DA127E00DA31AC /* UIKit.framework */; }; + 7E9F51B919DA1B1600DA31AC /* lib__PROJECT_NAME__Lib.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7E9F519519DA102000DA31AC /* lib__PROJECT_NAME__Lib.a */; }; + 7E9F51BA19DA1B2000DA31AC /* libCordova.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7E9F519019DA0F8300DA31AC /* libCordova.a */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 7E9F518F19DA0F8300DA31AC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 7E9F518B19DA0F8300DA31AC /* CordovaLib.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 68A32D7114102E1C006B237C; + remoteInfo = CordovaLib; + }; + 7E9F51AC19DA10DE00DA31AC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 7E9F517219DA09CE00DA31AC /* Project object */; + proxyType = 1; + remoteGlobalIDString = 7E9F519419DA102000DA31AC; + remoteInfo = __PROJECT_NAME__Lib; + }; + 7E9F51AE19DA10E100DA31AC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 7E9F518B19DA0F8300DA31AC /* CordovaLib.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = D2AAC07D0554694100DB518D; + remoteInfo = CordovaLib; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 7E9F519319DA102000DA31AC /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "include/$(PRODUCT_NAME)"; + dstSubfolderSpec = 16; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 7E9F518B19DA0F8300DA31AC /* CordovaLib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = CordovaLib.xcodeproj; path = "../node_modules/cordova-ios/CordovaLib/CordovaLib.xcodeproj"; sourceTree = "<group>"; }; + 7E9F519519DA102000DA31AC /* lib__PROJECT_NAME__Lib.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = lib__PROJECT_NAME__Lib.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 7E9F519F19DA102000DA31AC /* __PROJECT_NAME__LibTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = __PROJECT_NAME__LibTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 7E9F51A219DA102000DA31AC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; + 7E9F51A919DA10AE00DA31AC /* __PROJECT_NAME__.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = __PROJECT_NAME__.m; path = ../../../src/ios/__PROJECT_NAME__.m; sourceTree = SOURCE_ROOT; }; + 7E9F51AA19DA10AE00DA31AC /* __PROJECT_NAME__.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = __PROJECT_NAME__.h; path = ../../../src/ios/__PROJECT_NAME__.h; sourceTree = SOURCE_ROOT; }; + 7E9F51B019DA114400DA31AC /* __PROJECT_NAME__Test.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = __PROJECT_NAME__Test.m; sourceTree = "<group>"; }; + 7E9F51B219DA116500DA31AC /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.0.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; + 7E9F51B419DA127E00DA31AC /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.0.sdk/System/Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 7E9F519219DA102000DA31AC /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 7E9F519C19DA102000DA31AC /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 7E9F51BA19DA1B2000DA31AC /* libCordova.a in Frameworks */, + 7E9F51B919DA1B1600DA31AC /* lib__PROJECT_NAME__Lib.a in Frameworks */, + 7E9F51B519DA127E00DA31AC /* UIKit.framework in Frameworks */, + 7E9F51B319DA116500DA31AC /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 7E9F517119DA09CE00DA31AC = { + isa = PBXGroup; + children = ( + 7E9F51B419DA127E00DA31AC /* UIKit.framework */, + 7E9F51B219DA116500DA31AC /* Foundation.framework */, + 7E9F518B19DA0F8300DA31AC /* CordovaLib.xcodeproj */, + 7E9F519619DA102000DA31AC /* __PROJECT_NAME__Lib */, + 7E9F51A019DA102000DA31AC /* __PROJECT_NAME__LibTests */, + 7E9F517D19DA0A0A00DA31AC /* Products */, + ); + sourceTree = "<group>"; + }; + 7E9F517D19DA0A0A00DA31AC /* Products */ = { + isa = PBXGroup; + children = ( + 7E9F519519DA102000DA31AC /* lib__PROJECT_NAME__Lib.a */, + 7E9F519F19DA102000DA31AC /* __PROJECT_NAME__LibTests.xctest */, + ); + name = Products; + sourceTree = "<group>"; + }; + 7E9F518C19DA0F8300DA31AC /* Products */ = { + isa = PBXGroup; + children = ( + 7E9F519019DA0F8300DA31AC /* libCordova.a */, + ); + name = Products; + sourceTree = "<group>"; + }; + 7E9F519619DA102000DA31AC /* __PROJECT_NAME__Lib */ = { + isa = PBXGroup; + children = ( + 7E9F51A919DA10AE00DA31AC /* __PROJECT_NAME__.m */, + 7E9F51AA19DA10AE00DA31AC /* __PROJECT_NAME__.h */, + ); + path = __PROJECT_NAME__Lib; + sourceTree = SOURCE_ROOT; + }; + 7E9F51A019DA102000DA31AC /* __PROJECT_NAME__LibTests */ = { + isa = PBXGroup; + children = ( + 7E9F51A119DA102000DA31AC /* Supporting Files */, + 7E9F51B019DA114400DA31AC /* __PROJECT_NAME__Test.m */, + ); + path = __PROJECT_NAME__LibTests; + sourceTree = "<group>"; + }; + 7E9F51A119DA102000DA31AC /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 7E9F51A219DA102000DA31AC /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = "<group>"; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 7E9F519419DA102000DA31AC /* __PROJECT_NAME__Lib */ = { + isa = PBXNativeTarget; + buildConfigurationList = 7E9F51A319DA102000DA31AC /* Build configuration list for PBXNativeTarget "__PROJECT_NAME__Lib" */; + buildPhases = ( + 7E9F519119DA102000DA31AC /* Sources */, + 7E9F519219DA102000DA31AC /* Frameworks */, + 7E9F519319DA102000DA31AC /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = __PROJECT_NAME__Lib; + productName = __PROJECT_NAME__Lib; + productReference = 7E9F519519DA102000DA31AC /* lib__PROJECT_NAME__Lib.a */; + productType = "com.apple.product-type.library.static"; + }; + 7E9F519E19DA102000DA31AC /* __PROJECT_NAME__LibTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 7E9F51A619DA102000DA31AC /* Build configuration list for PBXNativeTarget "__PROJECT_NAME__LibTests" */; + buildPhases = ( + 7E9F519B19DA102000DA31AC /* Sources */, + 7E9F519C19DA102000DA31AC /* Frameworks */, + 7E9F519D19DA102000DA31AC /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 7E9F51AF19DA10E100DA31AC /* PBXTargetDependency */, + 7E9F51AD19DA10DE00DA31AC /* PBXTargetDependency */, + ); + name = __PROJECT_NAME__LibTests; + productName = __PROJECT_NAME__LibTests; + productReference = 7E9F519F19DA102000DA31AC /* __PROJECT_NAME__LibTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 7E9F517219DA09CE00DA31AC /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0600; + TargetAttributes = { + 7E9F519419DA102000DA31AC = { + CreatedOnToolsVersion = 6.0; + }; + 7E9F519E19DA102000DA31AC = { + CreatedOnToolsVersion = 6.0; + }; + }; + }; + buildConfigurationList = 7E9F517519DA09CE00DA31AC /* Build configuration list for PBXProject "__PROJECT_NAME__Test" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 7E9F517119DA09CE00DA31AC; + productRefGroup = 7E9F517D19DA0A0A00DA31AC /* Products */; + projectDirPath = ""; + projectReferences = ( + { + ProductGroup = 7E9F518C19DA0F8300DA31AC /* Products */; + ProjectRef = 7E9F518B19DA0F8300DA31AC /* CordovaLib.xcodeproj */; + }, + ); + projectRoot = ""; + targets = ( + 7E9F519419DA102000DA31AC /* __PROJECT_NAME__Lib */, + 7E9F519E19DA102000DA31AC /* __PROJECT_NAME__LibTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXReferenceProxy section */ + 7E9F519019DA0F8300DA31AC /* libCordova.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libCordova.a; + remoteRef = 7E9F518F19DA0F8300DA31AC /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; +/* End PBXReferenceProxy section */ + +/* Begin PBXResourcesBuildPhase section */ + 7E9F519D19DA102000DA31AC /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 7E9F519119DA102000DA31AC /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 7E9F51AB19DA10AE00DA31AC /* __PROJECT_NAME__.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 7E9F519B19DA102000DA31AC /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 7E9F51B119DA114400DA31AC /* __PROJECT_NAME__Test.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 7E9F51AD19DA10DE00DA31AC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 7E9F519419DA102000DA31AC /* __PROJECT_NAME__Lib */; + targetProxy = 7E9F51AC19DA10DE00DA31AC /* PBXContainerItemProxy */; + }; + 7E9F51AF19DA10E100DA31AC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = CordovaLib; + targetProxy = 7E9F51AE19DA10E100DA31AC /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 7E9F517619DA09CE00DA31AC /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + }; + name = Debug; + }; + 7E9F517719DA09CE00DA31AC /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + }; + name = Release; + }; + 7E9F51A419DA102000DA31AC /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + 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; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "\"$(TARGET_BUILD_DIR)/usr/local/lib/include\"", + "\"$(OBJROOT)/UninstalledProducts/include\"", + "\"$(BUILT_PRODUCTS_DIR)\"", + ); + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + 7E9F51A519DA102000DA31AC /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + 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; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "\"$(TARGET_BUILD_DIR)/usr/local/lib/include\"", + "\n\"$(OBJROOT)/UninstalledProducts/include\"\n\"$(BUILT_PRODUCTS_DIR)\"", + ); + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MTL_ENABLE_DEBUG_INFO = NO; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 7E9F51A719DA102000DA31AC /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + 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; + INFOPLIST_FILE = __PROJECT_NAME__LibTests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 7E9F51A819DA102000DA31AC /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + GCC_C_LANGUAGE_STANDARD = gnu99; + 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; + INFOPLIST_FILE = __PROJECT_NAME__LibTests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 7E9F517519DA09CE00DA31AC /* Build configuration list for PBXProject "__PROJECT_NAME__Test" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 7E9F517619DA09CE00DA31AC /* Debug */, + 7E9F517719DA09CE00DA31AC /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 7E9F51A319DA102000DA31AC /* Build configuration list for PBXNativeTarget "__PROJECT_NAME__Lib" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 7E9F51A419DA102000DA31AC /* Debug */, + 7E9F51A519DA102000DA31AC /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 7E9F51A619DA102000DA31AC /* Build configuration list for PBXNativeTarget "__PROJECT_NAME__LibTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 7E9F51A719DA102000DA31AC /* Debug */, + 7E9F51A819DA102000DA31AC /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 7E9F517219DA09CE00DA31AC /* Project object */; +} http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/6130d49e/create-test-files/tests-template/ios/__PROJECT_NAME__Test/__PROJECT_NAME__Test.xcodeproj/project.xcworkspace/contents.xcworkspacedata ---------------------------------------------------------------------- diff --git a/create-test-files/tests-template/ios/__PROJECT_NAME__Test/__PROJECT_NAME__Test.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/create-test-files/tests-template/ios/__PROJECT_NAME__Test/__PROJECT_NAME__Test.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..9856853 --- /dev/null +++ b/create-test-files/tests-template/ios/__PROJECT_NAME__Test/__PROJECT_NAME__Test.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Workspace + version = "1.0"> + <FileRef + location = "self:__PROJECT_NAME__Test.xcodeproj"> + </FileRef> +</Workspace> http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/6130d49e/create-test-files/tests-template/ios/__PROJECT_NAME__Test/__PROJECT_NAME__Test.xcodeproj/project.xcworkspace/xcshareddata/__PROJECT_NAME__Test.xccheckout ---------------------------------------------------------------------- diff --git a/create-test-files/tests-template/ios/__PROJECT_NAME__Test/__PROJECT_NAME__Test.xcodeproj/project.xcworkspace/xcshareddata/__PROJECT_NAME__Test.xccheckout b/create-test-files/tests-template/ios/__PROJECT_NAME__Test/__PROJECT_NAME__Test.xcodeproj/project.xcworkspace/xcshareddata/__PROJECT_NAME__Test.xccheckout new file mode 100644 index 0000000..b923e92 --- /dev/null +++ b/create-test-files/tests-template/ios/__PROJECT_NAME__Test/__PROJECT_NAME__Test.xcodeproj/project.xcworkspace/xcshareddata/__PROJECT_NAME__Test.xccheckout @@ -0,0 +1,41 @@ +<?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>IDESourceControlProjectFavoriteDictionaryKey</key> + <false/> + <key>IDESourceControlProjectIdentifier</key> + <string>6BE9AD73-1B9F-4362-98D7-DC631BEC6185</string> + <key>IDESourceControlProjectName</key> + <string>__PROJECT_NAME__Test</string> + <key>IDESourceControlProjectOriginsDictionary</key> + <dict> + <key>BEF5A5D0FF64801E558286389440357A9233D7DB</key> + <string>https://git-wip-us.apache.org/repos/asf/__REPO_NAME__.git</string> + </dict> + <key>IDESourceControlProjectPath</key> + <string>tests/ios/__PROJECT_NAME__Test/__PROJECT_NAME__Test.xcodeproj</string> + <key>IDESourceControlProjectRelativeInstallPathDictionary</key> + <dict> + <key>BEF5A5D0FF64801E558286389440357A9233D7DB</key> + <string>../../../../..</string> + </dict> + <key>IDESourceControlProjectURL</key> + <string>https://git-wip-us.apache.org/repos/asf/__REPO_NAME__.git</string> + <key>IDESourceControlProjectVersion</key> + <integer>111</integer> + <key>IDESourceControlProjectWCCIdentifier</key> + <string>BEF5A5D0FF64801E558286389440357A9233D7DB</string> + <key>IDESourceControlProjectWCConfigurations</key> + <array> + <dict> + <key>IDESourceControlRepositoryExtensionIdentifierKey</key> + <string>public.vcs.git</string> + <key>IDESourceControlWCCIdentifierKey</key> + <string>BEF5A5D0FF64801E558286389440357A9233D7DB</string> + <key>IDESourceControlWCCName</key> + <string>__REPO_NAME__</string> + </dict> + </array> +</dict> +</plist> http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/6130d49e/create-test-files/tests-template/ios/__PROJECT_NAME__Test/__PROJECT_NAME__Test.xcodeproj/xcshareddata/xcschemes/__PROJECT_NAME__Lib.xcscheme ---------------------------------------------------------------------- diff --git a/create-test-files/tests-template/ios/__PROJECT_NAME__Test/__PROJECT_NAME__Test.xcodeproj/xcshareddata/xcschemes/__PROJECT_NAME__Lib.xcscheme b/create-test-files/tests-template/ios/__PROJECT_NAME__Test/__PROJECT_NAME__Test.xcodeproj/xcshareddata/xcschemes/__PROJECT_NAME__Lib.xcscheme new file mode 100644 index 0000000..666abac --- /dev/null +++ b/create-test-files/tests-template/ios/__PROJECT_NAME__Test/__PROJECT_NAME__Test.xcodeproj/xcshareddata/xcschemes/__PROJECT_NAME__Lib.xcscheme @@ -0,0 +1,77 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Scheme + LastUpgradeVersion = "0600" + version = "1.3"> + <BuildAction + parallelizeBuildables = "YES" + buildImplicitDependencies = "YES"> + <BuildActionEntries> + <BuildActionEntry + buildForTesting = "YES" + buildForRunning = "YES" + buildForProfiling = "YES" + buildForArchiving = "YES" + buildForAnalyzing = "YES"> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "7E9F519419DA102000DA31AC" + BuildableName = "lib__PROJECT_NAME__Lib.a" + BlueprintName = "__PROJECT_NAME__Lib" + ReferencedContainer = "container:__PROJECT_NAME__Test.xcodeproj"> + </BuildableReference> + </BuildActionEntry> + </BuildActionEntries> + </BuildAction> + <TestAction + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + shouldUseLaunchSchemeArgsEnv = "YES" + buildConfiguration = "Debug"> + <Testables> + </Testables> + </TestAction> + <LaunchAction + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + launchStyle = "0" + useCustomWorkingDirectory = "NO" + buildConfiguration = "Debug" + ignoresPersistentStateOnLaunch = "NO" + debugDocumentVersioning = "YES" + allowLocationSimulation = "YES"> + <MacroExpansion> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "7E9F519419DA102000DA31AC" + BuildableName = "lib__PROJECT_NAME__Lib.a" + BlueprintName = "__PROJECT_NAME__Lib" + ReferencedContainer = "container:__PROJECT_NAME__Test.xcodeproj"> + </BuildableReference> + </MacroExpansion> + <AdditionalOptions> + </AdditionalOptions> + </LaunchAction> + <ProfileAction + shouldUseLaunchSchemeArgsEnv = "YES" + savedToolIdentifier = "" + useCustomWorkingDirectory = "NO" + buildConfiguration = "Release" + debugDocumentVersioning = "YES"> + <MacroExpansion> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "7E9F519419DA102000DA31AC" + BuildableName = "lib__PROJECT_NAME__Lib.a" + BlueprintName = "__PROJECT_NAME__Lib" + ReferencedContainer = "container:__PROJECT_NAME__Test.xcodeproj"> + </BuildableReference> + </MacroExpansion> + </ProfileAction> + <AnalyzeAction + buildConfiguration = "Debug"> + </AnalyzeAction> + <ArchiveAction + buildConfiguration = "Release" + revealArchiveInOrganizer = "YES"> + </ArchiveAction> +</Scheme> http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/6130d49e/create-test-files/tests-template/ios/__PROJECT_NAME__Test/__PROJECT_NAME__Test.xcodeproj/xcshareddata/xcschemes/__PROJECT_NAME__LibTests.xcscheme ---------------------------------------------------------------------- diff --git a/create-test-files/tests-template/ios/__PROJECT_NAME__Test/__PROJECT_NAME__Test.xcodeproj/xcshareddata/xcschemes/__PROJECT_NAME__LibTests.xcscheme b/create-test-files/tests-template/ios/__PROJECT_NAME__Test/__PROJECT_NAME__Test.xcodeproj/xcshareddata/xcschemes/__PROJECT_NAME__LibTests.xcscheme new file mode 100644 index 0000000..c83241a --- /dev/null +++ b/create-test-files/tests-template/ios/__PROJECT_NAME__Test/__PROJECT_NAME__Test.xcodeproj/xcshareddata/xcschemes/__PROJECT_NAME__LibTests.xcscheme @@ -0,0 +1,96 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Scheme + LastUpgradeVersion = "0600" + version = "1.3"> + <BuildAction + parallelizeBuildables = "YES" + buildImplicitDependencies = "YES"> + <BuildActionEntries> + <BuildActionEntry + buildForTesting = "YES" + buildForRunning = "YES" + buildForProfiling = "NO" + buildForArchiving = "NO" + buildForAnalyzing = "YES"> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "7E9F519E19DA102000DA31AC" + BuildableName = "__PROJECT_NAME__LibTests.xctest" + BlueprintName = "__PROJECT_NAME__LibTests" + ReferencedContainer = "container:__PROJECT_NAME__Test.xcodeproj"> + </BuildableReference> + </BuildActionEntry> + </BuildActionEntries> + </BuildAction> + <TestAction + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + shouldUseLaunchSchemeArgsEnv = "YES" + buildConfiguration = "Debug"> + <Testables> + <TestableReference + skipped = "NO"> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "7E9F519E19DA102000DA31AC" + BuildableName = "__PROJECT_NAME__LibTests.xctest" + BlueprintName = "__PROJECT_NAME__LibTests" + ReferencedContainer = "container:__PROJECT_NAME__Test.xcodeproj"> + </BuildableReference> + </TestableReference> + </Testables> + <MacroExpansion> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "7E9F519E19DA102000DA31AC" + BuildableName = "__PROJECT_NAME__LibTests.xctest" + BlueprintName = "__PROJECT_NAME__LibTests" + ReferencedContainer = "container:__PROJECT_NAME__Test.xcodeproj"> + </BuildableReference> + </MacroExpansion> + </TestAction> + <LaunchAction + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + launchStyle = "0" + useCustomWorkingDirectory = "NO" + buildConfiguration = "Debug" + ignoresPersistentStateOnLaunch = "NO" + debugDocumentVersioning = "YES" + allowLocationSimulation = "YES"> + <MacroExpansion> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "7E9F519E19DA102000DA31AC" + BuildableName = "__PROJECT_NAME__LibTests.xctest" + BlueprintName = "__PROJECT_NAME__LibTests" + ReferencedContainer = "container:__PROJECT_NAME__Test.xcodeproj"> + </BuildableReference> + </MacroExpansion> + <AdditionalOptions> + </AdditionalOptions> + </LaunchAction> + <ProfileAction + shouldUseLaunchSchemeArgsEnv = "YES" + savedToolIdentifier = "" + useCustomWorkingDirectory = "NO" + buildConfiguration = "Release" + debugDocumentVersioning = "YES"> + <MacroExpansion> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "7E9F519E19DA102000DA31AC" + BuildableName = "__PROJECT_NAME__LibTests.xctest" + BlueprintName = "__PROJECT_NAME__LibTests" + ReferencedContainer = "container:__PROJECT_NAME__Test.xcodeproj"> + </BuildableReference> + </MacroExpansion> + </ProfileAction> + <AnalyzeAction + buildConfiguration = "Debug"> + </AnalyzeAction> + <ArchiveAction + buildConfiguration = "Release" + revealArchiveInOrganizer = "YES"> + </ArchiveAction> +</Scheme> http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/6130d49e/create-test-files/tests-template/ios/package.json ---------------------------------------------------------------------- diff --git a/create-test-files/tests-template/ios/package.json b/create-test-files/tests-template/ios/package.json new file mode 100644 index 0000000..d05fd19 --- /dev/null +++ b/create-test-files/tests-template/ios/package.json @@ -0,0 +1,13 @@ +{ + "name": "__REPO_NAME__-test-ios", + "version": "1.0.0", + "description": "iOS Unit Tests for __REPO_NAME__ Plugin", + "author": "Apache Software Foundation", + "license": "Apache Version 2.0", + "dependencies": { + "cordova-ios": "*" + }, + "scripts": { + "test": "xcodebuild test -workspace __PROJECT_NAME__Test.xcworkspace -scheme __PROJECT_NAME__LibTests -destination 'platform=iOS Simulator,name=iPhone 5' CONFIGURATION_BUILD_DIR='/tmp' HEADER_SEARCH_PATHS='$(OBJROOT)/UninstalledProducts/$(PLATFORM_NAME)/include'" + } +} http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/6130d49e/create-test-files/tests-template/plugin.xml ---------------------------------------------------------------------- diff --git a/create-test-files/tests-template/plugin.xml b/create-test-files/tests-template/plugin.xml new file mode 100644 index 0000000..52fc2ba --- /dev/null +++ b/create-test-files/tests-template/plugin.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> + +<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" + id="__REPO_NAME__-tests" + version="1.0.0-dev"> + <name>__REPO_NAME__ Tests</name> + <license>Apache 2.0</license> + + <js-module src="tests.js" name="tests"> + </js-module> +</plugin> http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/6130d49e/create-test-files/tests-template/tests.js ---------------------------------------------------------------------- diff --git a/create-test-files/tests-template/tests.js b/create-test-files/tests-template/tests.js new file mode 100644 index 0000000..b94d56c --- /dev/null +++ b/create-test-files/tests-template/tests.js @@ -0,0 +1,44 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ + +/* jshint jasmine: true */ + +exports.defineAutoTests = function () { + describe('__REPO_NAME__ (cordova)', function () { + it("__REPO_NAME__.spec.1 should exist", function () { + //expect(window).toBeDefined(); + }); + }); +}; + +exports.defineManualTests = function (contentEl, createActionButton) { + + contentEl.innerHTML = 'Your HTML instructions here'; + + createActionButton('Do something 1', function () { + // do something 1; + }, 'do-something-1'); + + createActionButton('Do something 2', function () { + // do something 2; + }, 'do-something-2'); + +}; --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
