ocrunner 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +14 -1
- data/Rakefile +1 -0
- data/VERSION +1 -1
- data/lib/ocrunner/cli.rb +20 -1
- data/lib/ocrunner/test_runner.rb +11 -1
- data/ocrunner.gemspec +4 -1
- metadata +14 -2
data/README.rdoc
CHANGED
@@ -1,6 +1,19 @@
|
|
1
1
|
= ocrunner
|
2
2
|
|
3
|
-
ocrunner is a little Ruby wrapper for running OCUnit tests in
|
3
|
+
ocrunner is a little Ruby wrapper for running OCUnit tests in Xcode from the command line. Its main purpose is to parse the huge output from xcodebuild and display a pretty summary to the user.
|
4
|
+
|
5
|
+
To use this, you'll need to be set up with a test target. See http://developer.apple.com/mac/articles/tools/unittestingwithxcode3.html
|
6
|
+
|
7
|
+
== Usage
|
8
|
+
|
9
|
+
cd path/to/xcode/project/directory
|
10
|
+
ocrunner
|
11
|
+
|
12
|
+
To run tests as files are changed (autotest-style), use:
|
13
|
+
|
14
|
+
ocrunner --auto
|
15
|
+
|
16
|
+
You can see all the available options by running ocrunner -h.
|
4
17
|
|
5
18
|
== Note on Patches/Pull Requests
|
6
19
|
|
data/Rakefile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.2.0
|
data/lib/ocrunner/cli.rb
CHANGED
@@ -1,8 +1,12 @@
|
|
1
1
|
require 'trollop'
|
2
|
+
require 'fssm'
|
2
3
|
|
3
4
|
module OCRunner
|
4
5
|
module CLI
|
5
6
|
def self.run
|
7
|
+
|
8
|
+
Kernel.trap('INT') { exit }
|
9
|
+
|
6
10
|
opts = Trollop::options do
|
7
11
|
v = File.read(File.join(File.dirname(__FILE__), '../../VERSION')).strip
|
8
12
|
version "#{v} (c) 2010 Jim Benton github.com/jim/ocrunner"
|
@@ -17,11 +21,26 @@ module OCRunner
|
|
17
21
|
opt :target, 'Target to build', :default => 'Test'
|
18
22
|
opt :config, "Configuration to use", :default => 'Debug'
|
19
23
|
opt :parallel, "Use multiple processors to build (parallelizeTargets)", :type => :boolean, :default => true
|
24
|
+
opt :auto, "Watch filesystem for changes and run tests when they occur", :type => :boolean, :default => false
|
25
|
+
opt :growl, "Report results using Growl", :type => :boolean, :default => false
|
20
26
|
opt :debug_command, "Print xcodebuild command and exit", :type => :boolean, :default => false
|
21
27
|
opt :verbose, "Display all xcodebuild output after summary", :type => :boolean, :default => false
|
22
28
|
end
|
23
29
|
|
24
|
-
OCRunner::TestRunner.new(opts)
|
30
|
+
execute = Proc.new{ OCRunner::TestRunner.new(opts) }
|
31
|
+
|
32
|
+
if opts[:auto]
|
33
|
+
execute.call
|
34
|
+
|
35
|
+
FSSM.monitor(Dir.pwd, %w{**/*.m **/*.h}) do
|
36
|
+
create { |base, relative| execute.call }
|
37
|
+
update { |base, relative| execute.call }
|
38
|
+
delete { |base, relative| execute.call }
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
42
|
+
|
43
|
+
execute.call
|
25
44
|
|
26
45
|
end
|
27
46
|
end
|
data/lib/ocrunner/test_runner.rb
CHANGED
@@ -52,10 +52,14 @@ module OCRunner
|
|
52
52
|
failed = suite.cases.reject {|c| c.passed}
|
53
53
|
puts "Suite '#{suite.name}': #{suite.cases.size - failed.size} passes and #{failed.size} failures in #{suite.time} seconds."
|
54
54
|
end
|
55
|
+
|
55
56
|
puts
|
57
|
+
|
56
58
|
if passed
|
57
|
-
|
59
|
+
growl('Build succeeded.')
|
60
|
+
puts green('*** BUILD SUCCEEDED ***')
|
58
61
|
else
|
62
|
+
growl('BUILD FAILED!')
|
59
63
|
puts red('*** BUILD FAILED ***')
|
60
64
|
end
|
61
65
|
end
|
@@ -115,5 +119,11 @@ module OCRunner
|
|
115
119
|
path.gsub(@current_directory + '/', '')
|
116
120
|
end
|
117
121
|
|
122
|
+
def growl(message)
|
123
|
+
if @options[:growl]
|
124
|
+
`growlnotify -i "xcodeproj" -m "#{message}" `
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
118
128
|
end
|
119
129
|
end
|
data/ocrunner.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{ocrunner}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.2.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Jim Benton"]
|
@@ -52,11 +52,14 @@ Gem::Specification.new do |s|
|
|
52
52
|
|
53
53
|
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
54
54
|
s.add_runtime_dependency(%q<trollop>, [">= 0"])
|
55
|
+
s.add_runtime_dependency(%q<fssm>, [">= 0"])
|
55
56
|
else
|
56
57
|
s.add_dependency(%q<trollop>, [">= 0"])
|
58
|
+
s.add_dependency(%q<fssm>, [">= 0"])
|
57
59
|
end
|
58
60
|
else
|
59
61
|
s.add_dependency(%q<trollop>, [">= 0"])
|
62
|
+
s.add_dependency(%q<fssm>, [">= 0"])
|
60
63
|
end
|
61
64
|
end
|
62
65
|
|
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 0
|
7
|
-
-
|
7
|
+
- 2
|
8
8
|
- 0
|
9
|
-
version: 0.
|
9
|
+
version: 0.2.0
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Jim Benton
|
@@ -29,6 +29,18 @@ dependencies:
|
|
29
29
|
version: "0"
|
30
30
|
type: :runtime
|
31
31
|
version_requirements: *id001
|
32
|
+
- !ruby/object:Gem::Dependency
|
33
|
+
name: fssm
|
34
|
+
prerelease: false
|
35
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
segments:
|
40
|
+
- 0
|
41
|
+
version: "0"
|
42
|
+
type: :runtime
|
43
|
+
version_requirements: *id002
|
32
44
|
description: Provides pretty console output
|
33
45
|
email: jim@autonomousmachine.com
|
34
46
|
executables:
|