minor: extra rake tasks for tests. don't show C ext warning when testing

This commit is contained in:
Kyle Banker 2010-11-02 14:25:14 -04:00
parent 2939932526
commit e21a4b897a
2 changed files with 26 additions and 7 deletions

View File

@ -176,23 +176,40 @@ namespace :gem do
desc "Install the gem locally"
task :install do
sh "gem install --no-rdoc --no-ri json"
sh "gem uninstall -x -a -I bson"
sh "gem build bson.gemspec"
sh "gem install bson-*.gem"
sh "gem install --no-rdoc --no-ri bson-*.gem"
sh "gem uninstall -x -a -I mongo"
sh "gem build mongo.gemspec"
sh "gem install mongo-*.gem"
sh "gem install --no-rdoc --no-ri mongo-*.gem"
sh "rm mongo-*.gem"
sh "rm bson-*.gem"
end
desc "Install the optional c extensions"
task :install_extensions do
sh "gem uninstall -x -a -I bson_ext"
sh "gem build bson_ext.gemspec"
sh "gem install bson_ext-*.gem"
sh "gem install --no-rdoc --no-ri bson_ext-*.gem"
sh "rm bson_ext-*.gem"
end
end
namespace :ci do
namespace :test do
task :c do
Rake::Task['gem:install'].invoke
Rake::Task['gem:install_extensions'].invoke
Rake::Task['test:c'].invoke
end
end
end
task :default => :list
task :list do

View File

@ -60,10 +60,12 @@ else
module BSON
BSON_CODER = BSON_RUBY
end
warn "\n**Notice: C extension not loaded. This is required for optimum MongoDB Ruby driver performance."
warn " You can install the extension as follows:\n gem install bson_ext\n"
warn " If you continue to receive this message after installing, make sure that the"
warn " bson_ext gem is in your load path and that the bson_ext and mongo gems are of the same version.\n"
unless ENV['TEST_MODE']
warn "\n**Notice: C extension not loaded. This is required for optimum MongoDB Ruby driver performance."
warn " You can install the extension as follows:\n gem install bson_ext\n"
warn " If you continue to receive this message after installing, make sure that the"
warn " bson_ext gem is in your load path and that the bson_ext and mongo gems are of the same version.\n"
end
end
end