
* CPU functions now exist in Hardware::CPU * Added compatibility functions in compat/hardware_compat.rb * Names are less specific to Mac hardware, e.g. CPU.family instead of Hardware.intel_family * Hardware::CPU.family works for both Intel and PowerPC * New helper methods on CPU, like .sse4? and .altivec? Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
18 lines
518 B
Ruby
18 lines
518 B
Ruby
require 'testing_env'
|
|
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,
|
|
:arrandale, :sandybridge, :ivybridge].include?(Hardware::CPU.family)
|
|
end
|
|
end
|
|
end
|