Skip to content

Commit

Permalink
Make the test task use the compile task.
Browse files Browse the repository at this point in the history
  • Loading branch information
benburkert committed Aug 24, 2011
1 parent 74da9ce commit 161b684
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
13 changes: 7 additions & 6 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,18 @@ require 'yard'

desc "Re-compile the extensions"
task :compile do
FileUtils.rm_f('gpgme_n.bundle')
FileUtils.rm_f('gpgme_n.o')
FileUtils.rm_f('Makefile')
FileUtils.rm_rf('tmp') if File.directory?('tmp')
mkdir 'tmp'

system "ruby ext/gpgme/extconf.rb"
system "make"
Dir.chdir('tmp') do
system "ruby #{File.dirname(__FILE__)}/ext/gpgme/extconf.rb"
system "make"
end
end

task :default => [:test]

Rake::TestTask.new(:test) do |t|
Rake::TestTask.new(:test => :compile) do |t|
t.libs << 'test'
t.pattern = "test/**/*_test.rb"
t.verbose = true
Expand Down
5 changes: 5 additions & 0 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# -*- encoding: utf-8 -*-

# include compiled gpgme_n.bundle
tmp_dir = File.join(File.dirname(__FILE__), '..', 'tmp')
$:.unshift(tmp_dir) if File.directory?(tmp_dir)

require 'rubygems'
require 'bundler/setup'
require 'minitest/autorun'
Expand Down

0 comments on commit 161b684

Please sign in to comment.