Sha256: e81ae26f8f8175d0b6ceb291d07896312766e0439d2c88db8b65e725e9c4d5ee

Contents?: true

Size: 1.48 KB

Versions: 25

Compression:

Stored size: 1.48 KB

Contents

require "bundler/gem_tasks"
require "rake/testtask"
require "rake/extensiontask"

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

task :default => [:compile, :test]

gem = Gem::Specification.load( File.dirname(__FILE__) + '/mini_racer.gemspec' )
Rake::ExtensionTask.new( 'mini_racer_extension', gem )


# via http://blog.flavorjon.es/2009/06/easily-valgrind-gdb-your-ruby-c.html
namespace :test do
  # partial-loads-ok and undef-value-errors necessary to ignore
  # spurious (and eminently ignorable) warnings from the ruby
  # interpreter
  VALGRIND_BASIC_OPTS = "--num-callers=50 --error-limit=no \
                         --partial-loads-ok=yes --undef-value-errors=no"

  desc "run test suite under valgrind with basic ruby options"
  task :valgrind => :compile do
    cmdline = "valgrind #{VALGRIND_BASIC_OPTS} ruby test/test_leak.rb"
    puts cmdline
    system cmdline
  end

  desc "run test suite under valgrind with leak-check=full"
  task :valgrind_leak_check => :compile do
    cmdline = "valgrind #{VALGRIND_BASIC_OPTS} --leak-check=full ruby test/test_leak.rb"
    puts cmdline
    require 'open3'
    _, stderr = Open3.capture3(cmdline)

    section = ""
    stderr.split("\n").each do |line|

      if line =~ /==.*==\s*$/
        if (section =~ /mini_racer|SUMMARY/)
          puts
          puts section
          puts
        end
        section = ""
      else
        section << line << "\n"
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
mini_racer-0.2.5 Rakefile
mini_racer-0.2.4 Rakefile
mini_racer-0.2.3 Rakefile
mini_racer-0.2.2 Rakefile
mini_racer-0.2.1 Rakefile
mini_racer-0.2.0 Rakefile
mini_racer-0.1.15 Rakefile
mini_racer-0.1.14 Rakefile
mini_racer-0.1.13 Rakefile
mini_racer-0.1.12 Rakefile
mini_racer-0.1.11 Rakefile
mini_racer-0.1.10 Rakefile
mini_racer-0.1.9 Rakefile
mini_racer-0.1.8 Rakefile
mini_racer-0.1.7 Rakefile
mini_racer-0.1.6 Rakefile
mini_racer-0.1.5 Rakefile
mini_racer-0.1.5.pre.0 Rakefile
mini_racer-0.1.4 Rakefile
mini_racer-0.1.3 Rakefile