tests: replace tests script with rake-based runner
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
parent
84a4935bb5
commit
c44cb2710b
@ -1,29 +1,11 @@
|
|||||||
require 'utils'
|
module Homebrew extend self
|
||||||
|
def tests
|
||||||
Dir.chdir HOMEBREW_REPOSITORY + "Library/Homebrew/test"
|
(HOMEBREW_LIBRARY/'Homebrew/test').cd do
|
||||||
|
ENV['TESTOPTS'] = '-v' if ARGV.verbose?
|
||||||
$tests_passed = true
|
system "rake", "test"
|
||||||
|
exit $?.exitstatus
|
||||||
def test t
|
end
|
||||||
test_passed = system "/usr/bin/ruby test_#{t}.rb"
|
end
|
||||||
$tests_passed &&= test_passed
|
|
||||||
puts; puts "#" * 80; puts
|
|
||||||
end
|
end
|
||||||
|
|
||||||
test "bucket"
|
Homebrew.tests
|
||||||
test "formula"
|
|
||||||
test "versions"
|
|
||||||
test "checksums"
|
|
||||||
test "inreplace"
|
|
||||||
test "hardware"
|
|
||||||
test "formula_install"
|
|
||||||
test "patching"
|
|
||||||
test "external_deps"
|
|
||||||
test "pathname_install"
|
|
||||||
test "utils"
|
|
||||||
test "ARGV"
|
|
||||||
test "ENV"
|
|
||||||
test "updater"
|
|
||||||
test "string"
|
|
||||||
|
|
||||||
exit $tests_passed ? 0 : 1
|
|
||||||
|
|||||||
23
Library/Homebrew/test/Rakefile
Normal file
23
Library/Homebrew/test/Rakefile
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
require 'rake'
|
||||||
|
require 'rake/testtask'
|
||||||
|
|
||||||
|
Dir.chdir File.expand_path(File.dirname(__FILE__))
|
||||||
|
|
||||||
|
TEST_FILES = FileList['test_*.rb']
|
||||||
|
|
||||||
|
task :default => :test
|
||||||
|
|
||||||
|
Rake::TestTask.new :test do |t|
|
||||||
|
t.libs << Dir.pwd
|
||||||
|
t.test_files = TEST_FILES
|
||||||
|
end
|
||||||
|
|
||||||
|
namespace :test do
|
||||||
|
TEST_FILES.each do |file|
|
||||||
|
task = /test_(.+)\.rb/.match(file)
|
||||||
|
Rake::TestTask.new(task[1]) do |t|
|
||||||
|
t.libs << Dir.pwd
|
||||||
|
t.pattern = task[0]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
@ -1,24 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# This shell script runs Homebrew's test suite.
|
|
||||||
|
|
||||||
cd `dirname $0`
|
|
||||||
|
|
||||||
EXIT=0
|
|
||||||
/usr/bin/ruby test_bucket.rb $* || EXIT=1
|
|
||||||
/usr/bin/ruby test_formula.rb $* || EXIT=1
|
|
||||||
/usr/bin/ruby test_versions.rb $* || EXIT=1
|
|
||||||
/usr/bin/ruby test_checksums.rb $* || EXIT=1
|
|
||||||
/usr/bin/ruby test_compilers.rb $* || EXIT=1
|
|
||||||
/usr/bin/ruby test_inreplace.rb $* || EXIT=1
|
|
||||||
/usr/bin/ruby test_hardware.rb $* || EXIT=1
|
|
||||||
/usr/bin/ruby test_formula_install.rb $* || EXIT=1
|
|
||||||
/usr/bin/ruby test_patching.rb $* || EXIT=1
|
|
||||||
/usr/bin/ruby test_external_deps.rb $* || EXIT=1
|
|
||||||
/usr/bin/ruby test_pathname_install.rb $* || EXIT=1
|
|
||||||
/usr/bin/ruby test_utils.rb $* || EXIT=1
|
|
||||||
/usr/bin/ruby test_ARGV.rb $* || EXIT=1
|
|
||||||
/usr/bin/ruby test_ENV.rb $* || EXIT=1
|
|
||||||
/usr/bin/ruby test_updater.rb $* || EXIT=1
|
|
||||||
/usr/bin/ruby test_string.rb $* || EXIT=1
|
|
||||||
|
|
||||||
exit $EXIT
|
|
||||||
Loading…
x
Reference in New Issue
Block a user