brew/Library/Homebrew/test/test_ENV.rb
Jack Nagel 33233f5039 Stop warning in ENV.x11
It has been long enough since `depends_on :x11` was introduced that we
can make it the caller's responsibility to ensure X11 is present before
invoking ENV.x11, so stop outputting a warning.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-09-03 21:04:49 -05:00

30 lines
594 B
Ruby

require 'testing_env'
require 'hardware'
class EnvironmentTests < Test::Unit::TestCase
def test_ENV_options
ENV.gcc_4_0
begin
ENV.gcc_4_2
rescue RuntimeError => e
if `sw_vers -productVersion` =~ /10\.(\d+)/ and $1.to_i < 7
raise e
end
end
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
end