Move hardware detection tests to separate file.

This commit is contained in:
Adam Vandenberg 2010-02-18 12:00:07 -08:00
parent 3123720608
commit a5cbf94596
4 changed files with 24 additions and 14 deletions

View File

@ -101,18 +101,6 @@ class BeerTasting < Test::Unit::TestCase
assert_raises(FormulaUnavailableError) { ARGV.formulae }
end
# these will raise if we don't recognise your mac, but that prolly
# indicates something went wrong rather than we don't know
def test_hardware_cpu_type
assert [:intel, :ppc].include?(Hardware.cpu_type)
end
def test_hardware_intel_family
if Hardware.cpu_type == :intel
assert [:core, :core2, :penryn, :nehalem].include?(Hardware.intel_family)
end
end
def test_brew_h
nostdout do
assert_nothing_raised do

View File

@ -0,0 +1,21 @@
require 'testing_env'
require 'extend/ARGV' # needs to be after test/unit to avoid conflict with OptionsParser
ARGV.extend(HomebrewArgvExtension)
require 'hardware'
class HardwareTests < Test::Unit::TestCase
# these will raise if we don't recognise your mac, but that prolly
# indicates something went wrong rather than we don't know
def test_hardware_cpu_type
assert [:intel, :ppc].include?(Hardware.cpu_type)
end
def test_hardware_intel_family
if Hardware.cpu_type == :intel
assert [:core, :core2, :penryn, :nehalem].include?(Hardware.intel_family)
end
end
end

View File

@ -9,6 +9,9 @@
# Bulk of the tests
ruby unittest.rb $*
# Test hardware sniffers
ruby test_hardware.rb $*
# Test formula installs
ruby test_formula_install.rb $*

View File

@ -23,13 +23,11 @@ Dir.chdir HOMEBREW_PREFIX
at_exit { HOMEBREW_PREFIX.parent.rmtree }
require 'utils'
require 'hardware'
require 'formula'
require 'download_strategy'
require 'keg'
require 'utils'
require 'brew.h'
require 'hardware'
# for some reason our utils.rb safe_system behaves completely differently
# during these tests. This is worrying for sure.