Permalink
Browse files

* Fixed rake test:quick

* Fixed running stack test on JRuby 1.6.3
  • Loading branch information...
1 parent c4ec8a7 commit a21d91f1103e87c623492614261fe3c78106ebbd @donv donv committed Sep 12, 2011
Showing with 9 additions and 25 deletions.
  1. +3 −19 assets/Rakefile
  2. +5 −5 test/activity/stack_activity_test.rb
  3. +1 −1 test/test_helper.rb
View
@@ -155,29 +155,13 @@ task :test => :uninstall do
end
namespace :test do
- task :quick => [:update_scripts, 'test:update_scripts'] do
+ task :quick => :update_scripts do
Dir.chdir('test') do
puts 'Running quick tests'
+ sh 'ant install'
sh "ant run-tests-quick"
end
end
-
- task :update_scripts do
- test_scripts_path = "/data/data/#{package}.tests/files/scripts"
- # TODO(uwe): Investigate if we can just push the scripts instead of building and installing the instrumentation APK
- if false && package_installed?(true) && device_path_exists?(test_scripts_path)
- Dir['test/assets/scripts/*.rb'].each do |script|
- print "#{script}: " ; $stdout.flush
- `adb push #{script} #{test_scripts_path}`
- end
- `adb shell ps | grep #{package}.tests | awk '{print $2}' | xargs adb shell kill`
- else
- Dir.chdir 'test' do
- sh 'ant install'
- end
- end
- end
-
end
file GEM_FILE
@@ -324,7 +308,7 @@ end
def build_apk(t)
if File.exist?(APK_FILE)
changed_prereqs = t.prerequisites.select do |p|
- File.exist?(p) && !Dir[p].empty? && Dir[p].map{|f| File.mtime(f)}.max > File.mtime(APK_FILE)
+ File.file?(p) && !Dir[p].empty? && Dir[p].map{|f| File.mtime(f)}.max > File.mtime(APK_FILE)
end
return if changed_prereqs.empty?
changed_prereqs.each{|f| puts "#{f} changed."}
@@ -15,10 +15,10 @@
jruby_offset = {
'1.5.6' => [-2, -5, -6, -8],
'1.7.0.dev' => [ 0, 2, 5, 5],
- }[org.jruby.runtime.Constants::VERSION]
+ }[org.jruby.runtime.Constants::VERSION] || [0,0,0,0]
version_message ="ANDROID: #{android.os.Build::VERSION::SDK_INT}, JRuby: #{org.jruby.runtime.Constants::VERSION}"
- assert_equal 44 + os_offset + jruby_offset[0].to_i, activity.find_view_by_id(42).text.to_i, version_message
- assert_equal 68 + os_offset + jruby_offset[1].to_i, activity.find_view_by_id(43).text.to_i, version_message
- assert_equal 77 + os_offset + jruby_offset[2].to_i, activity.find_view_by_id(44).text.to_i, version_message
- assert_equal 96 + os_offset + jruby_offset[3].to_i, activity.find_view_by_id(45).text.to_i, version_message
+ assert_equal 44 + os_offset + jruby_offset[0], activity.find_view_by_id(42).text.to_i, version_message
+ assert_equal 68 + os_offset + jruby_offset[1], activity.find_view_by_id(43).text.to_i, version_message
+ assert_equal 77 + os_offset + jruby_offset[2], activity.find_view_by_id(44).text.to_i, version_message
+ assert_equal 96 + os_offset + jruby_offset[3], activity.find_view_by_id(45).text.to_i, version_message
end
View
@@ -161,7 +161,7 @@ def run_app_tests
if ['android-7', 'android-8'].include? ANDROID_OS
puts "Skipping instrumentation tests on #{ANDROID_OS} since they don't work."
else
- Dir.chdir "#{APP_DIR}/test" do
+ Dir.chdir APP_DIR do
system 'rake test:quick'
assert_equal 0, $?, "tests failed with return code #$?"
end

0 comments on commit a21d91f

Please sign in to comment.