Sha256: a42705e8c269a36d11c8f9eb3be7eba130308c8820931d151b7fcc749230ef20

Contents?: true

Size: 827 Bytes

Versions: 33

Compression:

Stored size: 827 Bytes

Contents

begin
  require 'rake/testtask'
rescue LoadError
end

if defined? Rake::TestTask
  namespace :test do
    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

33 entries across 33 versions & 1 rubygems

Version Path
newrelic_rpm-6.8.0.360 lib/tasks/tests.rake
newrelic_rpm-6.7.0.359 lib/tasks/tests.rake
newrelic_rpm-6.6.0.358 lib/tasks/tests.rake
newrelic_rpm-6.5.0.357 lib/tasks/tests.rake
newrelic_rpm-6.4.0.356 lib/tasks/tests.rake
newrelic_rpm-6.3.0.355 lib/tasks/tests.rake
newrelic_rpm-6.2.0.354 lib/tasks/tests.rake
newrelic_rpm-6.1.0.352 lib/tasks/tests.rake
newrelic_rpm-6.0.0.351 lib/tasks/tests.rake
newrelic_rpm-5.7.0.350 lib/tasks/tests.rake
newrelic_rpm-5.6.0.349 lib/tasks/tests.rake
newrelic_rpm-5.5.0.348 lib/tasks/tests.rake
newrelic_rpm-5.4.0.347 lib/tasks/tests.rake
newrelic_rpm-5.3.0.346 lib/tasks/tests.rake
newrelic_rpm-5.2.0.345 lib/tasks/tests.rake
newrelic_rpm-5.1.0.344 lib/tasks/tests.rake
newrelic_rpm-5.0.0.342 lib/tasks/tests.rake
newrelic_rpm-4.8.0.341 lib/tasks/tests.rake
newrelic_rpm-4.7.1.340 lib/tasks/tests.rake
newrelic_rpm-4.7.0.339 lib/tasks/tests.rake