brew/Library/Homebrew/test/test_ENV.rb

30 lines
594 B
Ruby
Raw Normal View History

2010-03-20 23:13:25 -07:00
require 'testing_env'
require 'hardware'
2010-03-20 23:13:25 -07:00
class EnvironmentTests < Test::Unit::TestCase
def test_ENV_options
ENV.gcc_4_0
2012-03-08 00:59:11 -08:00
begin
ENV.gcc_4_2
rescue RuntimeError => e
if `sw_vers -productVersion` =~ /10\.(\d+)/ and $1.to_i < 7
raise e
end
end
2010-03-20 23:13:25 -07:00
ENV.O3
ENV.minimal_optimization
ENV.no_optimization
ENV.libxml2
ENV.enable_warnings
assert !ENV.cc.empty?
assert !ENV.cxx.empty?
end
def test_switching_compilers
ENV.llvm
ENV.clang
assert_equal ENV['LD'], ENV['CC']
assert_equal ENV['OBJC'], ENV['CC']
end
2010-03-20 23:13:25 -07:00
end