From cc08d08d74f20d72ba378fed3bbc53390be0b97d Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Mon, 11 Mar 2013 22:54:15 -0500 Subject: Switch compilers when no build is specified Given the current state of OS X compilers, the original fails_with behavior is becoming less useful, mostly resulting in build failures each time the compiler is updated. So make the following changes: When a build is specified, we retain the old behavior: switch compilers if the available compiler is <= the build, don't switch if it is > the build. When no build is specified, unconditionally switch compilers, and don't output the advice message. This allows us to mark formulae as perpetually failing, avoiding the need to update formulae each time a new compiler build is made available. As a bonus, this makes the logic much easier to reason about. Closes Homebrew/homebrew#18175. --- Library/Homebrew/test/test_compilers.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Library/Homebrew/test') diff --git a/Library/Homebrew/test/test_compilers.rb b/Library/Homebrew/test/test_compilers.rb index 19eb69434..a30311611 100644 --- a/Library/Homebrew/test/test_compilers.rb +++ b/Library/Homebrew/test/test_compilers.rb @@ -94,9 +94,9 @@ class CompilerTests < Test::Unit::TestCase cs.select_compiler - assert_equal case MacOS.clang_build_version - when 0..210 then :gcc - else :clang + assert_equal case MacOS.gcc_42_build_version + when nil then :llvm + else :gcc end, ENV.compiler end @@ -110,6 +110,6 @@ class CompilerTests < Test::Unit::TestCase cs.select_compiler - assert_equal MacOS.default_compiler, ENV.compiler + assert_not_equal :clang, ENV.compiler end end -- cgit v1.2.3