diff --git a/.gitignore b/.gitignore index cc4b63a..6451220 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ *.bundle *.so *.dll +/.build/ diff --git a/Gemfile b/Gemfile index c39582a..65b9529 100644 --- a/Gemfile +++ b/Gemfile @@ -6,4 +6,4 @@ gem "bundler" gem "test-unit" gem "test-unit-ruby-core" gem "rake" -gem "rake-compiler" +gem "ruby-core-tasks", github: "ruby/ruby-core-tasks" diff --git a/Rakefile b/Rakefile index fdab5bb..855ea02 100644 --- a/Rakefile +++ b/Rakefile @@ -1,22 +1,22 @@ require "bundler/gem_tasks" require "rake/testtask" +require "ruby-core/extensiontask" -desc "Run tests" -task :test do +if RUBY_PLATFORM.include?("s390x") # Avoid possible test failures with the zlib applying the following patch on # s390x CPU architecture. # https://github.com/madler/zlib/pull/410 - ENV["DFLTCC"] = "0" if RUBY_PLATFORM =~ /s390x/ - Rake::Task["test_internal"].invoke + ENV["DFLTCC"] = "0" end -Rake::TestTask.new(:test_internal) do |t| +extask = RubyCore::ExtensionTask.new(Bundler::GemHelper.instance.gemspec) + +desc "Run tests" +Rake::TestTask.new do |t| t.libs << "test/lib" + t.libs.concat(extask.libs) t.ruby_opts << "-rhelper" t.test_files = FileList["test/**/test_*.rb"] end -require 'rake/extensiontask' -Rake::ExtensionTask.new("zlib") - task :default => [:compile, :test] diff --git a/rakelib/epoch.rake b/rakelib/epoch.rake new file mode 100644 index 0000000..5275d2f --- /dev/null +++ b/rakelib/epoch.rake @@ -0,0 +1 @@ +require 'ruby-core/epoch'