nevans-iphone_testify 0.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +26 -0
- data/README.rdoc +90 -0
- data/Rakefile +34 -0
- data/bin/iphone_testify +9 -0
- data/lib/iphone_testify.rb +49 -0
- data/lib/iphone_testify/setup.rb +14 -0
- data/skeleton/Autotest.rake +26 -0
- data/skeleton/Rakefile +4 -0
- data/skeleton/UnitTests/put_unit_tests_here.txt +1 -0
- data/skeleton/autoiphonetest.rb +20 -0
- data/skeleton/autotest.rb +76 -0
- data/skeleton/autotest_images/fail.png +0 -0
- data/skeleton/autotest_images/pass.png +0 -0
- data/skeleton/gitignore +20 -0
- data/skeleton/google_testing/GTMDefines.h +268 -0
- data/skeleton/google_testing/GTMIPhoneUnitTestDelegate.h +38 -0
- data/skeleton/google_testing/GTMIPhoneUnitTestDelegate.m +206 -0
- data/skeleton/google_testing/GTMIPhoneUnitTestMain.m +33 -0
- data/skeleton/google_testing/GTMSenTestCase.h +1011 -0
- data/skeleton/google_testing/GTMSenTestCase.m +366 -0
- data/skeleton/google_testing/GoogleToolboxForMac.license +202 -0
- data/skeleton/google_testing/RunIPhoneUnitTest.sh +123 -0
- data/test/test_helper.rb +1 -0
- data/test/test_setup.rb +39 -0
- metadata +113 -0
@@ -0,0 +1,123 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
# RunIPhoneUnitTest.sh
|
3
|
+
# Copyright 2008 Google Inc.
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
6
|
+
# use this file except in compliance with the License. You may obtain a copy
|
7
|
+
# of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
13
|
+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
14
|
+
# License for the specific language governing permissions and limitations under
|
15
|
+
# the License.
|
16
|
+
#
|
17
|
+
# Runs all unittests through the iPhone simulator. We don't handle running them
|
18
|
+
# on the device. To run on the device just choose "run".
|
19
|
+
|
20
|
+
set -o errexit
|
21
|
+
set -o nounset
|
22
|
+
set -o verbose
|
23
|
+
|
24
|
+
# Controlling environment variables:
|
25
|
+
# GTM_DISABLE_ZOMBIES -
|
26
|
+
# Set to a non-zero value to turn on zombie checks. You will probably
|
27
|
+
# want to turn this off if you enable leaks.
|
28
|
+
GTM_DISABLE_ZOMBIES=${GTM_DISABLE_ZOMBIES:=1}
|
29
|
+
|
30
|
+
# GTM_ENABLE_LEAKS -
|
31
|
+
# Set to a non-zero value to turn on the leaks check. You will probably want
|
32
|
+
# to disable zombies, otherwise you will get a lot of false positives.
|
33
|
+
|
34
|
+
# GTM_DISABLE_TERMINATION
|
35
|
+
# Set to a non-zero value so that the app doesn't terminate when it's finished
|
36
|
+
# running tests. This is useful when using it with external tools such
|
37
|
+
# as Instruments.
|
38
|
+
|
39
|
+
# GTM_LEAKS_SYMBOLS_TO_IGNORE
|
40
|
+
# List of comma separated symbols that leaks should ignore. Mainly to control
|
41
|
+
# leaks in frameworks you don't have control over.
|
42
|
+
# Search this file for GTM_LEAKS_SYMBOLS_TO_IGNORE to see examples.
|
43
|
+
# Please feel free to add other symbols as you find them but make sure to
|
44
|
+
# reference Radars or other bug systems so we can track them.
|
45
|
+
|
46
|
+
# GTM_REMOVE_GCOV_DATA
|
47
|
+
# Before starting the test, remove any *.gcda files for the current run so
|
48
|
+
# you won't get errors when the source file has changed and the data can't
|
49
|
+
# be merged.
|
50
|
+
#
|
51
|
+
GTM_REMOVE_GCOV_DATA=${GTM_REMOVE_GCOV_DATA:=0}
|
52
|
+
|
53
|
+
ScriptDir=$(dirname "$(echo $0 | sed -e "s,^\([^/]\),$(pwd)/\1,")")
|
54
|
+
ScriptName=$(basename "$0")
|
55
|
+
ThisScript="${ScriptDir}/${ScriptName}"
|
56
|
+
|
57
|
+
GTMXcodeNote() {
|
58
|
+
echo ${ThisScript}:${1}: note: GTM ${2}
|
59
|
+
}
|
60
|
+
|
61
|
+
if [ "$PLATFORM_NAME" == "iphonesimulator" ]; then
|
62
|
+
# We kill the iPhone simulator because otherwise we run into issues where
|
63
|
+
# the unittests fail becuase the simulator is currently running, and
|
64
|
+
# at this time the iPhone SDK won't allow two simulators running at the same
|
65
|
+
# time.
|
66
|
+
set +e
|
67
|
+
/usr/bin/killall "iPhone Simulator"
|
68
|
+
set -e
|
69
|
+
|
70
|
+
if [ $GTM_REMOVE_GCOV_DATA -ne 0 ]; then
|
71
|
+
if [ "${OBJECT_FILE_DIR}-${CURRENT_VARIANT}" != "-" ]; then
|
72
|
+
if [ -d "${OBJECT_FILE_DIR}-${CURRENT_VARIANT}" ]; then
|
73
|
+
GTMXcodeNote ${LINENO} "Removing any .gcda files"
|
74
|
+
(cd "${OBJECT_FILE_DIR}-${CURRENT_VARIANT}" && \
|
75
|
+
find . -type f -name "*.gcda" -print0 | xargs -0 rm -f )
|
76
|
+
fi
|
77
|
+
fi
|
78
|
+
fi
|
79
|
+
|
80
|
+
export DYLD_ROOT_PATH="$SDKROOT"
|
81
|
+
export DYLD_FRAMEWORK_PATH="$CONFIGURATION_BUILD_DIR"
|
82
|
+
export IPHONE_SIMULATOR_ROOT="$SDKROOT"
|
83
|
+
export CFFIXED_USER_HOME="$TEMP_FILES_DIR/iPhone Simulator User Dir"
|
84
|
+
|
85
|
+
# See http://developer.apple.com/technotes/tn2004/tn2124.html for an
|
86
|
+
# explanation of these environment variables.
|
87
|
+
|
88
|
+
export MallocScribble=YES
|
89
|
+
export MallocPreScribble=YES
|
90
|
+
export MallocGuardEdges=YES
|
91
|
+
export MallocStackLogging=YES
|
92
|
+
export NSAutoreleaseFreedObjectCheckEnabled=YES
|
93
|
+
|
94
|
+
# Turn on the mostly undocumented OBJC_DEBUG stuff.
|
95
|
+
export OBJC_DEBUG_FRAGILE_SUPERCLASSES=YES
|
96
|
+
export OBJC_DEBUG_UNLOAD=YES
|
97
|
+
# Turned off due to the amount of false positives from NS classes.
|
98
|
+
# export OBJC_DEBUG_FINALIZERS=YES
|
99
|
+
export OBJC_DEBUG_NIL_SYNC=YES
|
100
|
+
export OBJC_PRINT_REPLACED_METHODS=YES
|
101
|
+
|
102
|
+
if [ $GTM_DISABLE_ZOMBIES -eq 0 ]; then
|
103
|
+
GTMXcodeNote ${LINENO} "Enabling zombies"
|
104
|
+
export CFZombieLevel=3
|
105
|
+
export NSZombieEnabled=YES
|
106
|
+
fi
|
107
|
+
|
108
|
+
# Cleanup user home and documents directory
|
109
|
+
if [ -d "$CFFIXED_USER_HOME" ]; then
|
110
|
+
rm -rf "$CFFIXED_USER_HOME"
|
111
|
+
fi
|
112
|
+
mkdir "$CFFIXED_USER_HOME"
|
113
|
+
mkdir "$CFFIXED_USER_HOME/Documents"
|
114
|
+
|
115
|
+
# 6251475 iPhone simulator leaks @ CFHTTPCookieStore shutdown if
|
116
|
+
# CFFIXED_USER_HOME empty
|
117
|
+
GTM_LEAKS_SYMBOLS_TO_IGNORE="CFHTTPCookieStore"
|
118
|
+
|
119
|
+
"$TARGET_BUILD_DIR/$EXECUTABLE_PATH" -RegisterForSystemEvents
|
120
|
+
else
|
121
|
+
GTMXcodeNote ${LINENO} "Skipping running of unittests for device build."
|
122
|
+
fi
|
123
|
+
exit 0
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + "/../lib/iphone_testify")
|
data/test/test_setup.rb
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require 'fileutils'
|
3
|
+
require 'tmpdir'
|
4
|
+
require File.expand_path(File.dirname(__FILE__)) + "/test_helper"
|
5
|
+
|
6
|
+
class TestSetup < Test::Unit::TestCase
|
7
|
+
include FileUtils
|
8
|
+
def setup
|
9
|
+
@testdir = Dir.tmpdir + "/iphone_testify_setup_test"
|
10
|
+
rm_rf @testdir
|
11
|
+
mkdir @testdir
|
12
|
+
cd @testdir
|
13
|
+
end
|
14
|
+
|
15
|
+
def teardown
|
16
|
+
rm_rf @testdir
|
17
|
+
end
|
18
|
+
|
19
|
+
def test_skeleton_copied
|
20
|
+
IphoneTestify::Setup::setup
|
21
|
+
%w(Rakefile autoiphonetest.rb google_testing/ google_testing/GTMDefines.h).each do |file|
|
22
|
+
assert File.exists?(@testdir + "/#{file}"), file
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_unit_test_directory_created
|
27
|
+
IphoneTestify::Setup::setup
|
28
|
+
assert File.exists?(@testdir + "/UnitTests"), "exists"
|
29
|
+
assert File.directory?(@testdir + "/UnitTests"), "directory"
|
30
|
+
end
|
31
|
+
|
32
|
+
def test_ok_if_already_exists
|
33
|
+
IphoneTestify::Setup::setup
|
34
|
+
IphoneTestify::Setup::setup
|
35
|
+
assert File.exists?(@testdir + "/UnitTests")
|
36
|
+
assert File.exists?(@testdir + "/Rakefile")
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
metadata
ADDED
@@ -0,0 +1,113 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: nevans-iphone_testify
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.14
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Paul Wilson
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-05-07 00:00:00 -07:00
|
13
|
+
default_executable: iphone_testify
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: paulanthonywilson-osx_watchfolder
|
17
|
+
type: :runtime
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 1.0.1
|
24
|
+
version:
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: rake
|
27
|
+
type: :runtime
|
28
|
+
version_requirement:
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.8.4
|
34
|
+
version:
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: bones
|
37
|
+
type: :development
|
38
|
+
version_requirement:
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: 2.5.0
|
44
|
+
version:
|
45
|
+
description: Utility to help set up and iPhone project for testing using code from {The Google Toolbox for Mac}[http://code.google.com/p/google-toolbox-for-mac/].
|
46
|
+
email: paul.wilson@merecomplexities.com
|
47
|
+
executables:
|
48
|
+
- iphone_testify
|
49
|
+
extensions: []
|
50
|
+
|
51
|
+
extra_rdoc_files:
|
52
|
+
- History.txt
|
53
|
+
- README.rdoc
|
54
|
+
- bin/iphone_testify
|
55
|
+
- skeleton/UnitTests/put_unit_tests_here.txt
|
56
|
+
files:
|
57
|
+
- History.txt
|
58
|
+
- README.rdoc
|
59
|
+
- Rakefile
|
60
|
+
- bin/iphone_testify
|
61
|
+
- lib/iphone_testify.rb
|
62
|
+
- lib/iphone_testify/setup.rb
|
63
|
+
- skeleton/Autotest.rake
|
64
|
+
- skeleton/Rakefile
|
65
|
+
- skeleton/UnitTests/put_unit_tests_here.txt
|
66
|
+
- skeleton/autoiphonetest.rb
|
67
|
+
- skeleton/autotest.rb
|
68
|
+
- skeleton/autotest_images/fail.png
|
69
|
+
- skeleton/autotest_images/pass.png
|
70
|
+
- skeleton/gitignore
|
71
|
+
- skeleton/google_testing/GTMDefines.h
|
72
|
+
- skeleton/google_testing/GTMIPhoneUnitTestDelegate.h
|
73
|
+
- skeleton/google_testing/GTMIPhoneUnitTestDelegate.m
|
74
|
+
- skeleton/google_testing/GTMIPhoneUnitTestMain.m
|
75
|
+
- skeleton/google_testing/GTMSenTestCase.h
|
76
|
+
- skeleton/google_testing/GTMSenTestCase.m
|
77
|
+
- skeleton/google_testing/GoogleToolboxForMac.license
|
78
|
+
- skeleton/google_testing/RunIPhoneUnitTest.sh
|
79
|
+
- test/test_helper.rb
|
80
|
+
- test/test_setup.rb
|
81
|
+
has_rdoc: true
|
82
|
+
homepage: http://github.com/paulanthonywilson/iphone_testify/
|
83
|
+
licenses:
|
84
|
+
post_install_message:
|
85
|
+
rdoc_options:
|
86
|
+
- --main
|
87
|
+
- README.rdoc
|
88
|
+
require_paths:
|
89
|
+
- lib
|
90
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
91
|
+
requirements:
|
92
|
+
- - ">="
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: "0"
|
95
|
+
version:
|
96
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
97
|
+
requirements:
|
98
|
+
- - ">="
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
version: "0"
|
101
|
+
version:
|
102
|
+
requirements: []
|
103
|
+
|
104
|
+
rubyforge_project: !binary |
|
105
|
+
AA==
|
106
|
+
|
107
|
+
rubygems_version: 1.3.5
|
108
|
+
signing_key:
|
109
|
+
specification_version: 3
|
110
|
+
summary: Utility to help set up and iPhone project for testing using code from {The Google Toolbox for Mac}[http://code
|
111
|
+
test_files:
|
112
|
+
- test/test_helper.rb
|
113
|
+
- test/test_setup.rb
|