diff options
| author | Jack Nagel | 2012-04-16 16:44:11 -0500 |
|---|---|---|
| committer | Jack Nagel | 2012-04-16 23:08:32 -0500 |
| commit | c44cb2710ba94e2caaae5de480a895ed2aab490e (patch) | |
| tree | 141c3330166a997957035e4e4712655858d05fff /Library | |
| parent | 84a4935bb5a9c39e6a58e9f848ce1be93d3451b4 (diff) | |
| download | brew-c44cb2710ba94e2caaae5de480a895ed2aab490e.tar.bz2 | |
tests: replace tests script with rake-based runner
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library')
| -rwxr-xr-x | Library/Contributions/cmds/brew-tests.rb | 36 | ||||
| -rw-r--r-- | Library/Homebrew/test/Rakefile | 23 | ||||
| -rwxr-xr-x | Library/Homebrew/test/tests | 24 |
3 files changed, 32 insertions, 51 deletions
diff --git a/Library/Contributions/cmds/brew-tests.rb b/Library/Contributions/cmds/brew-tests.rb index f7f7f78ca..0a2fb78e7 100755 --- a/Library/Contributions/cmds/brew-tests.rb +++ b/Library/Contributions/cmds/brew-tests.rb @@ -1,29 +1,11 @@ -require 'utils' - -Dir.chdir HOMEBREW_REPOSITORY + "Library/Homebrew/test" - -$tests_passed = true - -def test t - test_passed = system "/usr/bin/ruby test_#{t}.rb" - $tests_passed &&= test_passed - puts; puts "#" * 80; puts +module Homebrew extend self + def tests + (HOMEBREW_LIBRARY/'Homebrew/test').cd do + ENV['TESTOPTS'] = '-v' if ARGV.verbose? + system "rake", "test" + exit $?.exitstatus + end + end end -test "bucket" -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
\ No newline at end of file +Homebrew.tests diff --git a/Library/Homebrew/test/Rakefile b/Library/Homebrew/test/Rakefile new file mode 100644 index 000000000..cf3000b9b --- /dev/null +++ b/Library/Homebrew/test/Rakefile @@ -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 diff --git a/Library/Homebrew/test/tests b/Library/Homebrew/test/tests deleted file mode 100755 index c7e2689f2..000000000 --- a/Library/Homebrew/test/tests +++ /dev/null @@ -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 |
