Reset compiler when testing fails_with

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
Jack Nagel 2012-04-01 14:56:04 -05:00
parent de444ead0b
commit bb8fcc8901

View File

@ -77,6 +77,7 @@ class FormulaTests < Test::Unit::TestCase
cs = CompilerSelector.new(f) cs = CompilerSelector.new(f)
cs.select_compiler cs.select_compiler
assert_equal MacOS.default_compiler, ENV.compiler assert_equal MacOS.default_compiler, ENV.compiler
ENV.send MacOS.default_compiler
f = TestNoCompilerFailures.new f = TestNoCompilerFailures.new
assert !(f.fails_with? :clang) assert !(f.fails_with? :clang)
@ -85,6 +86,7 @@ class FormulaTests < Test::Unit::TestCase
cs = CompilerSelector.new(f) cs = CompilerSelector.new(f)
cs.select_compiler cs.select_compiler
assert_equal MacOS.default_compiler, ENV.compiler assert_equal MacOS.default_compiler, ENV.compiler
ENV.send MacOS.default_compiler
f = TestLLVMFailure.new f = TestLLVMFailure.new
assert !(f.fails_with? :clang) assert !(f.fails_with? :clang)
@ -96,6 +98,7 @@ class FormulaTests < Test::Unit::TestCase
when 0..210 then :gcc when 0..210 then :gcc
else :clang else :clang
end end
ENV.send MacOS.default_compiler
f = TestMixedCompilerFailures.new f = TestMixedCompilerFailures.new
assert f.fails_with? :clang assert f.fails_with? :clang
@ -104,6 +107,7 @@ class FormulaTests < Test::Unit::TestCase
cs = CompilerSelector.new(f) cs = CompilerSelector.new(f)
cs.select_compiler cs.select_compiler
assert_equal :llvm, ENV.compiler assert_equal :llvm, ENV.compiler
ENV.send MacOS.default_compiler
f = TestMoreMixedCompilerFailures.new f = TestMoreMixedCompilerFailures.new
assert !(f.fails_with? :clang) assert !(f.fails_with? :clang)
@ -112,6 +116,7 @@ class FormulaTests < Test::Unit::TestCase
cs = CompilerSelector.new(f) cs = CompilerSelector.new(f)
cs.select_compiler cs.select_compiler
assert_equal :clang, ENV.compiler assert_equal :clang, ENV.compiler
ENV.send MacOS.default_compiler
f = TestEvenMoreMixedCompilerFailures.new f = TestEvenMoreMixedCompilerFailures.new
assert f.fails_with? :clang assert f.fails_with? :clang
@ -120,6 +125,7 @@ class FormulaTests < Test::Unit::TestCase
cs = CompilerSelector.new(f) cs = CompilerSelector.new(f)
cs.select_compiler cs.select_compiler
assert_equal :clang, ENV.compiler assert_equal :clang, ENV.compiler
ENV.send MacOS.default_compiler
f = TestBlockWithoutBuildCompilerFailure.new f = TestBlockWithoutBuildCompilerFailure.new
assert f.fails_with? :clang assert f.fails_with? :clang
@ -128,5 +134,6 @@ class FormulaTests < Test::Unit::TestCase
cs = CompilerSelector.new(f) cs = CompilerSelector.new(f)
cs.select_compiler cs.select_compiler
assert_equal MacOS.default_compiler, ENV.compiler assert_equal MacOS.default_compiler, ENV.compiler
ENV.send MacOS.default_compiler
end end
end end