test/test_helper.rb in ruboto-0.13.0 vs test/test_helper.rb in ruboto-0.14.0
- old
+ new
@@ -162,10 +162,11 @@
puts message
`adb shell log -t 'RUBOTO TEST' '#{message}'`
end
def generate_app(options = {})
+ package = options.delete(:package) || PACKAGE
example = options.delete(:example) || false
update = options.delete(:update) || false
# FIXME(uwe): Remove exclusion feature
excluded_stdlibs = options.delete(:excluded_stdlibs)
included_stdlibs = options.delete(:included_stdlibs)
@@ -174,10 +175,11 @@
raise "Unknown options: #{options.inspect}" unless options.empty?
Dir.mkdir TMP_DIR unless File.exists? TMP_DIR
FileUtils.rm_rf APP_DIR if File.exists? APP_DIR
template_dir = "#{APP_DIR}_template_#{$$}"
+ template_dir << "_package_#{package}" if package != PACKAGE
template_dir << "_example_#{example}" if example
template_dir << "_bundle_#{[*bundle].join('_')}" if bundle
template_dir << '_updated' if update
template_dir << '_standalone' if standalone
template_dir << "_without_#{excluded_stdlibs.map { |ed| ed.gsub(/[.\/]/, '_') }.join('_')}" if excluded_stdlibs
@@ -205,11 +207,11 @@
update_app if update
end
else
uninstall_jruby_jars_gem unless standalone
puts "Generating app #{APP_DIR}"
- system "#{RUBOTO_CMD} gen app --package #{PACKAGE} --path #{APP_DIR} --name #{APP_NAME} --target android-#{ANDROID_TARGET}"
+ system "#{RUBOTO_CMD} gen app --package #{package} --path #{APP_DIR} --name #{APP_NAME} --target android-#{ANDROID_TARGET}"
if $? != 0
FileUtils.rm_rf APP_DIR
raise "gen app failed with return code #$?"
end
Dir.chdir APP_DIR do
@@ -233,11 +235,15 @@
#end
# EMXIF
unless example && !update
Dir.chdir APP_DIR do
- system 'rake debug'
+ system 'rake patch_dex' # Ensure dx heap space is sufficient.
assert_equal 0, $?
+ Dir.chdir 'test' do
+ system 'ant instrument' # This will also build the main project.
+ assert_equal 0, $?
+ end
end
end
puts "Storing app as template #{template_dir}"
FileUtils.cp_r APP_DIR, template_dir, :preserve => true
end