Sha256: 50a1bab7d0ea2bc7070b34a6f31386878b01df5ce582e1b2ebf0e7a8cba745e9

Contents?: true

Size: 1.63 KB

Versions: 5

Compression:

Stored size: 1.63 KB

Contents

require 'rake/testtask'

namespace :test do

  Rake::TestTask.new(:integration) do |t|
    t.libs = ['lib']
    t.test_files = FileList['test/integration/*_test.rb']
    t.ruby_opts += ["-w"]
  end

  Rake::TestTask.new(:run) do |t|
    t.libs = ['lib']
    t.test_files = FileList['test/*_test.rb']
    t.ruby_opts += ["-w"]
  end

  Rake::TestTask.new(:unit) do |t|
    t.libs = ['lib']
    t.test_files = FileList['test/unit/*_test.rb']
    t.ruby_opts += ["-w"]
  end

  Rake::TestTask.new(:gobjectintrospection) do |t|
    t.libs = ['lib']
    t.test_files = FileList['test/ffi-gobject_introspection/*_test.rb']
    t.ruby_opts += ["-w"]
  end

  Rake::TestTask.new(:glib) do |t|
    t.libs = ['lib']
    t.test_files = FileList['test/ffi-glib/*_test.rb']
    t.ruby_opts += ["-w"]
  end

  Rake::TestTask.new(:gobject) do |t|
    t.libs = ['lib']
    t.test_files = FileList['test/ffi-gobject/*_test.rb']
    t.ruby_opts += ["-w"]
  end

  desc 'Build Regress test library and typelib'
  task :lib => "test/lib/Makefile" do
    sh %{cd test/lib && make}
  end

  task :integration => :lib
  task :run => :lib

  desc 'Run rcov for the entire test suite'
  task :coverage => :lib do
    rm_f "coverage"
    system "rcov", "-Ilib", "--exclude", "\.gem\/,\/gems\/", *FileList['test/**/*_test.rb']
  end
end

file "test/lib/Makefile" => "test/lib/configure" do
  sh %{cd test/lib && ./configure --enable-maintainer-mode}
end

file "test/lib/configure" do
  sh %{cd test/lib && NOCONFIGURE=1 ./autogen.sh}
end

desc 'Run unit an integration tests'
task :test => ['test:gobjectintrospection',
  'test:unit', 'test:run', 'test:glib', 'test:gobject', 'test:integration']

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
gir_ffi-0.2.3 tasks/test.rake
gir_ffi-0.2.2 tasks/test.rake
gir_ffi-0.2.1 tasks/test.rake
gir_ffi-0.2.0 tasks/test.rake
gir_ffi-0.1.0 tasks/test.rake