aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cask/cmd/brew-cask-tests.rb
blob: 92ef3ddd902c5fa0bf8deb670dd30c0f36509391 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
require "English"

repo_root = Pathname(__FILE__).realpath.parent.parent
repo_root.cd do
  ENV["HOMEBREW_NO_ANALYTICS_THIS_RUN"] = "1"

  Homebrew.install_gem_setup_path! "bundler"
  unless quiet_system("bundle", "check")
    system "bundle", "install", "--path", "vendor/bundle"
  end

  test_task = "test"
  %w[rspec minitest coverage].each do |subtask|
    next unless ARGV.flag?("--#{subtask}")
    test_task = "test:#{subtask}"
  end

  system "bundle", "exec", "rake", test_task
  Homebrew.failed = !$CHILD_STATUS.success?
end