Sha256: 343a1d3342939369ac436c837398c6fadb2bb34437d2f81a45b4995dd2cac4b4

Contents?: true

Size: 836 Bytes

Versions: 23

Compression:

Stored size: 836 Bytes

Contents

begin
  require 'rake/testtask'
rescue LoadError => e
end

if defined? Rake::TestTask
  namespace :test do |t|
    def look_for_seed(tasks)
      matches = tasks.map { |t| /(seed=.*?)[,\]]/.match(t) }.compact
      if matches.any?
        matches.first[1]
      else
        nil
      end
    end

    tasks = Rake.application.top_level_tasks
    ENV["TESTOPTS"] ||= ""
    if tasks.any? { |t| t.include?("verbose")}
      ENV["TESTOPTS"] += " -v"
    end
    if seed = look_for_seed(tasks)
      ENV["TESTOPTS"] += " --" + seed
    end

    agent_home = File.expand_path(File.join(File.dirname(__FILE__),'..','..'))

    Rake::TestTask.new(:newrelic) do |t|
      t.libs << "#{agent_home}/test"
      t.libs << "#{agent_home}/lib"
      t.pattern = "#{agent_home}/test/new_relic/**/*_test.rb"
      t.verbose = true
    end

  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
newrelic_rpm-3.14.3.313 lib/tasks/tests.rake
newrelic_rpm-3.14.2.312 lib/tasks/tests.rake
newrelic_rpm-3.14.1.311 lib/tasks/tests.rake
newrelic_rpm-3.14.0.305 lib/tasks/tests.rake
newrelic_rpm-3.13.2.302 lib/tasks/tests.rake
newrelic_rpm-3.13.1.300 lib/tasks/tests.rake
newrelic_rpm-3.13.0.299 lib/tasks/tests.rake
newrelic_rpm-3.12.1.298 lib/tasks/tests.rake
newrelic_rpm-3.12.0.288 lib/tasks/tests.rake
newrelic_rpm-3.11.2.286 lib/tasks/tests.rake
newrelic_rpm-3.11.1.284 lib/tasks/tests.rake
newrelic_rpm-3.11.0.283 lib/tasks/tests.rake
newrelic_rpm-3.10.0.279 lib/tasks/tests.rake
newrelic_rpm-3.9.9.275 lib/tasks/tests.rake
newrelic_rpm-3.9.8.273 lib/tasks/tests.rake
newrelic_rpm-3.9.7.266 lib/tasks/tests.rake
newrelic_rpm-3.9.6.257 lib/tasks/tests.rake
newrelic_rpm-3.9.5.251 lib/tasks/tests.rake
newrelic_rpm-3.9.4.245 lib/tasks/tests.rake
newrelic_rpm-3.9.3.241 lib/tasks/tests.rake