diff options
| author | spicyj | 2009-09-02 13:17:15 -0600 | 
|---|---|---|
| committer | Max Howell | 2009-09-03 16:34:31 +0100 | 
| commit | 7c1d09672a5e9e681c5d08cc7164069a232e0af1 (patch) | |
| tree | 3af6d96ada129ef72c612af61533617187689937 /Library/Homebrew/unittest.rb | |
| parent | 9f93a4f355eee7547d7ff2804c8dd48098f152e0 (diff) | |
| download | homebrew-7c1d09672a5e9e681c5d08cc7164069a232e0af1.tar.bz2 | |
Improvements to build environment determination
Simplified hardware model testing.
Even smarter compiler option generation using sysctl and new GCC 4.2 features.
Get processor count from sysctl and thus remove our dependency on RubyCocoa.
Diffstat (limited to 'Library/Homebrew/unittest.rb')
| -rwxr-xr-x | Library/Homebrew/unittest.rb | 16 | 
1 files changed, 11 insertions, 5 deletions
diff --git a/Library/Homebrew/unittest.rb b/Library/Homebrew/unittest.rb index 7943640fd..729cb7997 100755 --- a/Library/Homebrew/unittest.rb +++ b/Library/Homebrew/unittest.rb @@ -12,6 +12,7 @@ require 'download_strategy'  require 'keg'  require 'utils'  require 'brew.h' +require 'hardware.rb'  # these are defined in bin/brew, but we don't want to break our actual  # homebrew tree, and we do want to test everything :) @@ -332,11 +333,16 @@ class BeerTasting <Test::Unit::TestCase      assert_equal '1.9.1-p243', f.version    end -  def test_hw_model -    require 'hw.model.rb' -    # this will raise if we don't recognise your mac, but that prolly  -    # indicates something went wrong rather than we don't know -    assert %w[core1 core2 xeon ppc].include?(hw_model.to_s) +  # 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  | 
