File: Rakefile

package info (click to toggle)
ruby-minitest-reporters 1.0.19-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 388 kB
  • ctags: 199
  • sloc: ruby: 1,134; makefile: 5
file content (52 lines) | stat: -rw-r--r-- 1,378 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
require "bundler/gem_tasks"
require "rake/testtask"

task :default => :test
Rake::TestTask.new do |t|
  t.pattern = "test/{unit,integration}/**/*_test.rb"
  t.verbose = true
end

rubymine_home = [
  ENV["RUBYMINE_HOME"],
  "../rubymine-contrib/ruby-testing/src/rb/testing/patch/common",
  "/Applications/RubyMine.app/Contents/rb/testing/patch/common",
].compact.detect { |d| Dir.exist?(d) }

Rake::TestTask.new("test:gallery") do |t|
  t.pattern = "test/gallery/**/*_test.rb"
  t.verbose = true
  t.libs << rubymine_home
end

# - RubyMineReporter must be tested separately inside of RubyMine
# - JUnitReporter normally writes to `test/reports` instead of stdout
task :gallery do
  unless rubymine_home
    warn "To see RubyMineReporter supply RUBYMINE_HOME= or git clone git://git.jetbrains.org/idea/contrib.git ../rubymine-contrib"
    exit 1
  end

  [
    "Pride",
    "DefaultReporter",
    "JUnitReporter",
    "ProgressReporter",
    "RubyMateReporter",
    "SpecReporter",
    "RubyMineReporter",
    "HtmlReporter"
  ].each do |reporter|
    puts
    puts "-" * 72
    puts "Running gallery tests using #{reporter}..."
    puts "-" * 72
    puts

    sh "rake test:gallery REPORTER=#{reporter}" do
      # Ignore failures. They're expected when you are running the gallery
      # test suite.
    end
    sh "cat test/reports/*" if reporter == "JUnitReporter"
  end
end