Permalink
Browse files

Impovements on test routines

  • Loading branch information...
1 parent a68068d commit 42b1a56917791d5f99a152e00c8cc2b7615f4ac3 @dklimkin dklimkin committed Apr 1, 2013
Showing with 23 additions and 11 deletions.
  1. +6 −3 ads_common/Rakefile
  2. +13 −6 adwords_api/Rakefile
  3. +4 −2 dfp_api/Rakefile
View
@@ -24,15 +24,18 @@ task :default => [:build]
desc 'Package the Common library into a gem file.'
task :build do
- system 'gem build google-ads-common.gemspec'
+ result = system('/bin/env gem build google-ads-common.gemspec')
+ raise 'Build failed.' unless result
end
desc 'Perform the unit testing.'
task :test do
- system 'ruby test/suite_unittests.rb'
+ result = system('/bin/env ruby test/suite_unittests.rb')
+ raise 'Unit tests failed.' unless result
end
desc 'Run tests coverage tool.'
task :coverage do
- system 'ruby test/coverage.rb'
+ result = system('/bin/env ruby test/coverage.rb')
+ raise 'Coverage run failed.' unless result
end
View
@@ -32,27 +32,31 @@ task :default => [:generate, :build]
desc 'Package the AdWords API library into a gem file.'
task :build do
- system 'gem build google-adwords-api.gemspec'
+ result = system('/bin/env gem build google-adwords-api.gemspec')
+ raise 'Build failed.' unless result
end
desc 'Perform the unit testing.'
task :test do
- system 'ruby test/suite_unittests.rb'
+ result = system('/bin/env ruby test/suite_unittests.rb')
+ raise 'Unit tests failed.' unless result
end
desc 'Perform the examples testing.'
task :test_examples do
Dir.glob('test/suite_exampletests_v*.rb').each do |file|
puts 'Running test suite: %s' % file
- system 'ruby %s' % file
+ result = system('/bin/env ruby %s' % file)
+ raise 'Example tests failed for %s.' % file unless result
end
end
desc 'Perform integration testing.'
task :test_integrate do
Dir.glob('test/suite_integration.rb').each do |file|
puts 'Running test suite: %s' % file
- system 'ruby %s' % file
+ result = system('/bin/env ruby %s' % file)
+ raise 'Integration tests failed for %s.' % file unless result
end
end
@@ -61,13 +65,16 @@ task :test_smoke => [:test, :test_integrate]
desc 'Run tests coverage tool.'
task :coverage do
- system 'ruby test/coverage.rb'
+ result = system('/bin/env ruby test/coverage.rb')
+ raise 'Coverage run failed.' unless result
end
desc 'Package demo apps.'
task :build_demo do
['adwords_on_rails'].each do |app|
- system 'tar cz --mode +r,u+X+w -C examples -f %s.tar.gz %s' % [app, app]
+ result = system('tar cz --mode +r,u+X+w -C examples -f %s.tar.gz %s' %
+ [app, app])
+ raise 'Demo packaging failed for %s.' % app unless result
end
end
View
@@ -32,12 +32,14 @@ task :default => [:generate, :build]
desc 'Package the DFP API library into a gem file.'
task :build do
- system 'gem build google-dfp-api.gemspec'
+ result = system('/usr/bin/env gem build google-dfp-api.gemspec')
+ raise 'Build failed.' unless result
end
desc 'Perform the unit testing.'
task :test do
- system 'ruby test/suite_*.rb'
+ result = system('/usr/bin/env ruby test/suite_unittests.rb')
+ raise 'Unit tests failed.' unless result
end
desc 'Generate API stubs only'

0 comments on commit 42b1a56

Please sign in to comment.