paulanthonywilson-iphone_testify 0.0.6 → 0.1.02
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +7 -0
- data/README.rdoc +3 -2
- data/Rakefile +1 -1
- data/lib/iphone_testify.rb +1 -1
- data/lib/iphone_testify/setup.rb +1 -0
- data/skeleton/Autotest.rake +76 -0
- data/skeleton/Rakefile +1 -68
- data/skeleton/gitignore +20 -0
- metadata +5 -8
- data/iphone_testify.gemspec +0 -0
data/History.txt
CHANGED
@@ -8,3 +8,10 @@
|
|
8
8
|
|
9
9
|
* Adding growl pass/fail images for autotesting
|
10
10
|
* Adding UnitTests directory as part of skeleton
|
11
|
+
|
12
|
+
== 0.0.7
|
13
|
+
|
14
|
+
* added .gitignore
|
15
|
+
* detects more failure conditions in growl message: segmentation faults, more build errors
|
16
|
+
* moved bulk of Rake into separate file
|
17
|
+
* changed tasks to auto:test, an auto:test:all
|
data/README.rdoc
CHANGED
@@ -42,11 +42,12 @@ To autocompile/autorun all tests every time code changes
|
|
42
42
|
|
43
43
|
To compile and run tests if code has changed since the last run
|
44
44
|
|
45
|
-
% rake
|
45
|
+
% rake auto:test
|
46
46
|
|
47
47
|
To compile and run all tests even if nothing has changed since the last time
|
48
48
|
|
49
|
-
% rake
|
49
|
+
% rake auto:test:all
|
50
|
+
|
50
51
|
|
51
52
|
|
52
53
|
== REQUIREMENTS:
|
data/Rakefile
CHANGED
@@ -24,7 +24,7 @@ PROJ.email = 'paul.wilson@merecomplexities.com'
|
|
24
24
|
PROJ.url = 'http://github.com/paulanthonywilson/iphone_testify/'
|
25
25
|
PROJ.version = IphoneTestify::VERSION
|
26
26
|
|
27
|
-
PROJ.exclude
|
27
|
+
PROJ.exclude += ['\.gitignore', '\.DS_Store', '\.gem']
|
28
28
|
PROJ.notes.exclude = %w(^README\.txt$ ^data/)
|
29
29
|
PROJ.readme_file = 'README.rdoc'
|
30
30
|
|
data/lib/iphone_testify.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
module IphoneTestify
|
3
3
|
GEMDIR = File.expand_path(File.dirname(__FILE__) + "/..")
|
4
4
|
# :stopdoc:
|
5
|
-
VERSION = '0.
|
5
|
+
VERSION = '0.1.02'
|
6
6
|
LIBPATH = ::File.expand_path(::File.dirname(__FILE__)) + ::File::SEPARATOR
|
7
7
|
PATH = ::File.dirname(LIBPATH) + ::File::SEPARATOR
|
8
8
|
# :startdoc:
|
data/lib/iphone_testify/setup.rb
CHANGED
@@ -0,0 +1,76 @@
|
|
1
|
+
IPHONE_SDK_VERSION = '2.2.1' unless Object::const_defined?("IPHONE_SDK_VERSION")
|
2
|
+
|
3
|
+
puts "SDK Version: #{IPHONE_SDK_VERSION}"
|
4
|
+
|
5
|
+
|
6
|
+
BUILD_STATUS_FILE=".built"
|
7
|
+
|
8
|
+
class String
|
9
|
+
attr_accessor :colour
|
10
|
+
RESET="\e[00;m"
|
11
|
+
|
12
|
+
def coloured(colour = nil)
|
13
|
+
colour||=@colour
|
14
|
+
"#{colour_code(colour)}#{self}#{RESET}"
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
def colour_code colour
|
19
|
+
case colour
|
20
|
+
when :red : "\e[01;31m"
|
21
|
+
when :green : "\e[01;32m"
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
file BUILD_STATUS_FILE => Dir.glob("Classes/*.[hm]") + Dir.glob("UnitTests/*.m") do
|
27
|
+
failure_line = AutoTest::test
|
28
|
+
if failure_line
|
29
|
+
notice = ['Fail', failure_line.chomp]
|
30
|
+
else
|
31
|
+
notice = ['Pass']
|
32
|
+
end
|
33
|
+
AutoTest::growl *notice
|
34
|
+
File.open(BUILD_STATUS_FILE, 'w') {|f| f.write(notice * ": ")}
|
35
|
+
end
|
36
|
+
|
37
|
+
|
38
|
+
task 'auto:remove_built_file' do
|
39
|
+
FileUtils.rm_f(BUILD_STATUS_FILE)
|
40
|
+
end
|
41
|
+
|
42
|
+
desc "build and run the tests "
|
43
|
+
task 'auto:test:all'=>['auto:remove_built_file', 'auto:test']
|
44
|
+
|
45
|
+
desc "build and run the tests if changed"
|
46
|
+
task 'auto:test'=>[BUILD_STATUS_FILE] do
|
47
|
+
out = File.open('.built') {|f| f.read}
|
48
|
+
print out.coloured(out =~ /Pass/ ? :green : :red) + "\n"
|
49
|
+
end
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
module AutoTest
|
54
|
+
def self.test
|
55
|
+
output = `xcodebuild -target "Unit Test" -configuration Debug -sdk iphonesimulator#{IPHONE_SDK_VERSION} 2>&1`
|
56
|
+
failure_line = nil
|
57
|
+
output.each do |line|
|
58
|
+
if line =~ /error:|^Executed.*(\d+) failures|Undefined symbols|PurpleSystemEventPort|FAILED|Segmentation fault/
|
59
|
+
if $1.nil? || $1.to_i > 0
|
60
|
+
failure_line||= line
|
61
|
+
line.colour = :red
|
62
|
+
else
|
63
|
+
line.colour = :green
|
64
|
+
end
|
65
|
+
end
|
66
|
+
print line.coloured unless line =~/Merge mismatch|setenv/
|
67
|
+
end
|
68
|
+
failure_line
|
69
|
+
end
|
70
|
+
|
71
|
+
def self.growl title, msg =""
|
72
|
+
img = "~/.autotest_images/#{title.downcase}.png"
|
73
|
+
`growlnotify -H localhost -n autotest --image #{img} -p 0 -m #{msg.inspect} #{title}`
|
74
|
+
end
|
75
|
+
|
76
|
+
end
|
data/skeleton/Rakefile
CHANGED
@@ -1,68 +1 @@
|
|
1
|
-
|
2
|
-
BUILD_STATUS_FILE=".built"
|
3
|
-
|
4
|
-
class String
|
5
|
-
attr_accessor :colour
|
6
|
-
RESET="\e[00;m"
|
7
|
-
|
8
|
-
def coloured(colour = nil)
|
9
|
-
colour||=@colour
|
10
|
-
"#{colour_code(colour)}#{self}#{RESET}"
|
11
|
-
end
|
12
|
-
|
13
|
-
private
|
14
|
-
def colour_code colour
|
15
|
-
case colour
|
16
|
-
when :red : "\e[01;31m"
|
17
|
-
when :green : "\e[01;32m"
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
file BUILD_STATUS_FILE => Dir.glob("Classes/*.[hm]") + Dir.glob("UnitTests/*.m") do
|
23
|
-
failure_line = test
|
24
|
-
if failure_line
|
25
|
-
notice = ['Fail', failure_line.chomp]
|
26
|
-
else
|
27
|
-
notice = ['Pass']
|
28
|
-
end
|
29
|
-
growl *notice
|
30
|
-
File.open(BUILD_STATUS_FILE, 'w') {|f| f.write(notice * ": ")}
|
31
|
-
end
|
32
|
-
|
33
|
-
task :remove_built_file do
|
34
|
-
FileUtils.rm_f(BUILD_STATUS_FILE)
|
35
|
-
end
|
36
|
-
|
37
|
-
task :test_all=>[:remove_built_file, :test]
|
38
|
-
|
39
|
-
task :test=>[BUILD_STATUS_FILE] do
|
40
|
-
out = File.open('.built') {|f| f.read}
|
41
|
-
print out.coloured(out =~ /Pass/ ? :green : :red) + "\n"
|
42
|
-
end
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
task :default => [:test]
|
47
|
-
|
48
|
-
def test
|
49
|
-
output = `xcodebuild -target "Unit Test" -configuration Debug -sdk iphonesimulator2.1`
|
50
|
-
failure_line = nil
|
51
|
-
output.each do |line|
|
52
|
-
if line =~ /error:|^Executed.*(\d+) failures/
|
53
|
-
if $1.nil? || $1.to_i > 0
|
54
|
-
failure_line||= line
|
55
|
-
line.colour = :red
|
56
|
-
else
|
57
|
-
line.colour = :green
|
58
|
-
end
|
59
|
-
end
|
60
|
-
print line.coloured
|
61
|
-
end
|
62
|
-
failure_line
|
63
|
-
end
|
64
|
-
|
65
|
-
def growl title, msg =""
|
66
|
-
img = "~/.autotest_images/#{title.downcase}.png"
|
67
|
-
`growlnotify -H localhost -n autotest --image #{img} -p 0 -m #{msg.inspect} #{title}`
|
68
|
-
end
|
1
|
+
load 'Autotest.rake'
|
data/skeleton/gitignore
ADDED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paulanthonywilson-iphone_testify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.1.02
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Wilson
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-04-13 00:00:00 -07:00
|
13
13
|
default_executable: iphone_testify
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -40,7 +40,7 @@ dependencies:
|
|
40
40
|
requirements:
|
41
41
|
- - ">="
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
version: 2.4.
|
43
|
+
version: 2.4.2
|
44
44
|
version:
|
45
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
46
|
email: paul.wilson@merecomplexities.com
|
@@ -58,18 +58,15 @@ files:
|
|
58
58
|
- README.rdoc
|
59
59
|
- Rakefile
|
60
60
|
- bin/iphone_testify
|
61
|
-
- iphone_testify-0.0.2.gem
|
62
|
-
- iphone_testify-0.0.4.gem
|
63
|
-
- iphone_testify.gemspec
|
64
61
|
- lib/iphone_testify.rb
|
65
62
|
- lib/iphone_testify/setup.rb
|
66
|
-
- skeleton
|
63
|
+
- skeleton/Autotest.rake
|
67
64
|
- skeleton/Rakefile
|
68
65
|
- skeleton/UnitTests/put_unit_tests_here.txt
|
69
66
|
- skeleton/autoiphonetest.rb
|
70
|
-
- skeleton/autotest_images/.DS_Store
|
71
67
|
- skeleton/autotest_images/fail.png
|
72
68
|
- skeleton/autotest_images/pass.png
|
69
|
+
- skeleton/gitignore
|
73
70
|
- skeleton/google_testing/GTMDefines.h
|
74
71
|
- skeleton/google_testing/GTMIPhoneUnitTestDelegate.h
|
75
72
|
- skeleton/google_testing/GTMIPhoneUnitTestDelegate.m
|
data/iphone_testify.gemspec
DELETED
Binary file
|