Move hardware detection tests to separate file.
This commit is contained in:
parent
3123720608
commit
a5cbf94596
@ -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
|
||||
|
||||
21
Library/Homebrew/test/test_hardware.rb
Normal file
21
Library/Homebrew/test/test_hardware.rb
Normal 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
|
||||
@ -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 $*
|
||||
|
||||
|
||||
@ -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.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user