diff --git a/Gemfile.lock b/Gemfile.lock index d2d1279..00a86d8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - bwoken (2.0.0.beta.1) + bwoken (2.0.0.beta.2) coffee-script-source colorful execjs diff --git a/README.md b/README.md index 511162a..d90a056 100644 --- a/README.md +++ b/README.md @@ -103,15 +103,17 @@ Here's a list of all the switches that bwoken takes for the `test` command:
$ bwoken test -h
[...]
- --simulator Use simulator, even when an iDevice is connected
- --family Test only one device type, either ipad or iphone. Default is to test on both
- --scheme Specify a custom scheme
- --formatter Specify a custom formatter (e.g., --formatter=passthru)
- --focus Specify particular tests to run
- --clobber Remove any generated file
- --skip-build Do not build the iOS binary
- --verbose Be verbose
- -h, --help Display this help message.
+ --simulator Use simulator, even when an iDevice is connected
+ --family Test only one device type, either ipad or iphone. Default is to test on both
+ --scheme Specify a custom scheme
+ --product-name Specify a custom product name (e.g. --product-name="My Product"). Default is the name of of the xcodeproj file
+ --integration-path Specify a custom directory to store your test scripts in (e.g. --integration-path=uiautomation/path/dir). Note that this folder still expects the same directory structure as the one create by `bwoken init`.
+ --formatter Specify a custom formatter (e.g., --formatter=passthru)
+ --focus Specify particular tests to run
+ --clobber Remove any generated file
+ --skip-build Do not build the iOS binary
+ --verbose Be verbose
+ -h, --help Display this help message.
## In Your Code
@@ -187,6 +189,19 @@ Now, you can start using it!
Technically, you can skip this entire Installation section and just run `sudo gem install bwoken && bwoken init`. This is listed here for completeness, but you really shouldn't install gems this way.
+## Contributors
+
+Special thank you goes out to everyone who's helped with bwoken. Here's a (probably incomplete) list of those folks:
+
+* Brad Grzesiak ([listrophy](https://github.com/listrophy))
+* Jaymes Waters ([jaym3s](https://github.com/jaym3s))
+* Jonathan Penn ([jonathanpenn](https://github.com/jonathanpenn))
+* Ryland Herrick ([rylnd](https://github.com/rylnd))
+* Whitney Young ([wbyoung](https://github.com/wbyoung))
+* David Gagnon ([mrdavidgagnon](https://github.com/mrdavidgagnon))
+* [otusweb](https://github.com/otusweb)
+* Alec Gorge ([alecgorge](https://github.com/alecgorge))
+
## Contributing
1. Fork it
diff --git a/bin/unix_instruments.sh b/bin/unix_instruments.sh
index 3e4665b..00a68a2 100755
--- a/bin/unix_instruments.sh
+++ b/bin/unix_instruments.sh
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
#
-# Copyright (c) 2012 Jonathan Penn (http://cocoamanifest.net)
+# Copyright (c) 2013 Jonathan Penn (http://cocoamanifest.net)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -47,7 +47,8 @@ run_instruments() {
# to make this cleaner?
output=$(mktemp -t unix-instruments)
- instruments $@ &> /dev/ttyvf & pid_instruments=$!
+ instruments "$@" &> /dev/ttyvf &
+ pid_instruments=$!
# Cat the instruments output to tee which outputs to stdout and saves to
# $output at the same time
@@ -72,7 +73,7 @@ get_error_status() {
}
trap cleanup_instruments EXIT
-function cleanup_instruments() {
+cleanup_instruments() {
# Because we fork instruments in this script, we need to clean up if it's
# still running because of an error or the user pressed Ctrl-C
if [[ $pid_instruments -gt 0 ]]; then
@@ -87,5 +88,5 @@ function cleanup_instruments() {
if [[ $1 == "----test" ]]; then
get_error_status
else
- run_instruments $@
+ run_instruments "$@"
fi
diff --git a/bwoken.gemspec b/bwoken.gemspec
index c5f9672..0cd9b47 100644
--- a/bwoken.gemspec
+++ b/bwoken.gemspec
@@ -7,8 +7,8 @@ Gem::Specification.new do |gem|
gem.description = %q{iOS UIAutomation Test Runner}
gem.summary = %q{Runs your UIAutomation tests from the command line for both iPhone and iPad; supports coffeescript}
- gem.authors = ['Brad Grzesiak', 'Jaymes Waters']
- gem.email = ['brad@bendyworks.com', 'jaymes@bendyworks.com']
+ gem.authors = ['Brad Grzesiak']
+ gem.email = ['brad@bendyworks.com']
gem.homepage = 'https://bendyworks.github.com/bwoken'
gem.files = Dir['LICENSE', 'README.md', 'bin/**/*', 'lib/**/*']
diff --git a/lib/bwoken.rb b/lib/bwoken.rb
index 848daaf..e9c9a67 100644
--- a/lib/bwoken.rb
+++ b/lib/bwoken.rb
@@ -5,7 +5,15 @@ class << self
DEVICE_FAMILIES = %w(iphone ipad)
def path
- File.join(project_path, 'integration')
+ File.join(project_path, integration_path)
+ end
+
+ def integration_path
+ @integration_path || 'integration'
+ end
+
+ def integration_path= new_integration_path
+ @integration_path = new_integration_path
end
def tmp_path
@@ -13,7 +21,11 @@ def tmp_path
end
def app_name
- File.basename(File.basename(workspace_or_project, '.xcodeproj'), '.xcworkspace')
+ @name || File.basename(File.basename(workspace_or_project, '.xcodeproj'), '.xcworkspace')
+ end
+
+ def app_name= name
+ @name = name
end
def project_path
diff --git a/lib/bwoken/cli.rb b/lib/bwoken/cli.rb
index d918a0d..98fc23f 100644
--- a/lib/bwoken/cli.rb
+++ b/lib/bwoken/cli.rb
@@ -14,6 +14,7 @@
command 'init' do
banner Bwoken::CLI::Init.help_banner
+ on :'integration-path=', 'Specify a custom directory to store your test scripts in (e.g. --integration-path=uiautomation/path/dir). Default: integration. If you use the non-default value here, you will need to always run bwoken with the `--integration-path=your/integration/dir` option.', :default => 'integration'
run { ran_command = 'init' }
end
@@ -26,12 +27,15 @@
on :family=, 'Test only one device type, either ipad or iphone. Default is to test on both',
:match => /\A(?:ipad|iphone|all)\Z/i, :default => 'all'
on :scheme=, 'Specify a custom scheme'
+ on :'product-name=', 'Specify a custom product name (e.g. --product-name="My Product"). Default is the name of of the xcodeproj file'
+ on :'integration-path=', 'Specify a custom directory to store your test scripts in (e.g. --integration-path=uiautomation/path/dir). Note that this folder still expects the same directory structure as the one create by `bwoken init`.', :default => 'integration'
#on :flags=, 'Specify custom build flags (e.g., --flags="-arch=i386,foo=bar")', :as => Array, :default => [] # TODO: implement
on :formatter=, 'Specify a custom formatter (e.g., --formatter=passthru)', :default => 'colorful'
on :focus=, 'Specify particular tests to run', :as => Array, :default => []
on :clobber, 'Remove any generated file'
on :'skip-build', 'Do not build the iOS binary'
on :verbose, 'Be verbose'
+ on :configuration=, 'The build configruation to use (e.g., --configuration=Release)', :default => 'Debug'
run { ran_command = 'test' }
end
diff --git a/lib/bwoken/cli/init.rb b/lib/bwoken/cli/init.rb
index 83ee389..b347111 100644
--- a/lib/bwoken/cli/init.rb
+++ b/lib/bwoken/cli/init.rb
@@ -18,29 +18,31 @@ def help_banner
end
# opts - A slop command object (acts like super-hash)
- # There are currently no options available
+ # Only allowed option is 'integration-path' which should
+ # have defaulted to 'integration'
def initialize opts
- # opts = opts.to_hash if opts.is_a?(Slop)
+ opts = opts.to_hash if opts.is_a?(Slop)
+ Bwoken.integration_path = opts[:'integration-path']
end
def run
- directory 'integration/coffeescript/iphone'
- directory 'integration/coffeescript/ipad'
- directory 'integration/javascript'
- directory 'integration/tmp/results'
- template 'integration/coffeescript/iphone/example.coffee'
- template 'integration/coffeescript/ipad/example.coffee'
- template 'integration/javascript/example_vendor.js'
+ directory "coffeescript/iphone"
+ directory "coffeescript/ipad"
+ directory "javascript"
+ directory "tmp/results"
+ template "coffeescript/iphone/example.coffee"
+ template "coffeescript/ipad/example.coffee"
+ template "javascript/example_vendor.js"
end
def directory dirname
- FileUtils.mkdir_p dirname
+ FileUtils.mkdir_p "#{Bwoken.integration_path}/#{dirname}"
end
def template filename
- FileUtils.cp \
- File.expand_path("../templates/#{filename}", __FILE__),
- filename
+ source = File.expand_path("../templates/#{filename}", __FILE__)
+ destination = "#{Bwoken.integration_path}/#{filename}"
+ FileUtils.cp source, destination
end
end
diff --git a/lib/bwoken/cli/templates/integration/coffeescript/ipad/example.coffee b/lib/bwoken/cli/templates/coffeescript/ipad/example.coffee
similarity index 100%
rename from lib/bwoken/cli/templates/integration/coffeescript/ipad/example.coffee
rename to lib/bwoken/cli/templates/coffeescript/ipad/example.coffee
diff --git a/lib/bwoken/cli/templates/integration/coffeescript/iphone/example.coffee b/lib/bwoken/cli/templates/coffeescript/iphone/example.coffee
similarity index 100%
rename from lib/bwoken/cli/templates/integration/coffeescript/iphone/example.coffee
rename to lib/bwoken/cli/templates/coffeescript/iphone/example.coffee
diff --git a/lib/bwoken/cli/templates/integration/javascript/example_vendor.js b/lib/bwoken/cli/templates/javascript/example_vendor.js
similarity index 100%
rename from lib/bwoken/cli/templates/integration/javascript/example_vendor.js
rename to lib/bwoken/cli/templates/javascript/example_vendor.js
diff --git a/lib/bwoken/cli/test.rb b/lib/bwoken/cli/test.rb
index b9a5c7f..78f1e5e 100644
--- a/lib/bwoken/cli/test.rb
+++ b/lib/bwoken/cli/test.rb
@@ -17,7 +17,7 @@ module CLI
class Test
def self.help_banner
- <