diff options
| author | Jack Nagel | 2012-04-14 13:17:22 -0500 |
|---|---|---|
| committer | Jack Nagel | 2012-04-14 15:27:45 -0500 |
| commit | 1d0be89fa5bbe9aa07fcacad0c369437553129fc (patch) | |
| tree | edc0ce790da6569a05f544fcbb8ab80d692c59c3 /Library/Homebrew/test/test_formula.rb | |
| parent | d4f757718505b080ef3bd60fbf9ab7a751453e9a (diff) | |
| download | brew-1d0be89fa5bbe9aa07fcacad0c369437553129fc.tar.bz2 | |
tests: reorganize compiler selection tests
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library/Homebrew/test/test_formula.rb')
| -rw-r--r-- | Library/Homebrew/test/test_formula.rb | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/Library/Homebrew/test/test_formula.rb b/Library/Homebrew/test/test_formula.rb index 3144afaa9..b49b06757 100644 --- a/Library/Homebrew/test/test_formula.rb +++ b/Library/Homebrew/test/test_formula.rb @@ -8,8 +8,6 @@ ENV.extend(HomebrewEnvExtension) require 'test/testball' -require 'hardware' - class AbstractDownloadStrategy attr_reader :url end @@ -68,74 +66,4 @@ class FormulaTests < Test::Unit::TestCase assert_equal downloader.url, "file:///#{TEST_FOLDER}/tarballs/testball-0.1.tbz" end end - - def test_compiler_selection - %W{HOMEBREW_USE_CLANG HOMEBEW_USE_LLVM HOMEBREW_USE_GCC}.each { |e| ENV.delete(e) } - - f = TestAllCompilerFailures.new - assert f.fails_with? :clang - assert f.fails_with? :llvm - assert f.fails_with? :gcc - cs = CompilerSelector.new(f) - cs.select_compiler - assert_equal MacOS.default_compiler, ENV.compiler - ENV.send MacOS.default_compiler - - f = TestNoCompilerFailures.new - assert !(f.fails_with? :clang) - assert !(f.fails_with? :llvm) - assert !(f.fails_with? :gcc) - cs = CompilerSelector.new(f) - cs.select_compiler - assert_equal MacOS.default_compiler, ENV.compiler - ENV.send MacOS.default_compiler - - f = TestLLVMFailure.new - assert !(f.fails_with? :clang) - assert f.fails_with? :llvm - assert !(f.fails_with? :gcc) - cs = CompilerSelector.new(f) - cs.select_compiler - assert_equal case MacOS.clang_build_version - when 0..210 then :gcc - else :clang - end, ENV.compiler - ENV.send MacOS.default_compiler - - f = TestMixedCompilerFailures.new - assert f.fails_with? :clang - assert !(f.fails_with? :llvm) - assert f.fails_with? :gcc - cs = CompilerSelector.new(f) - cs.select_compiler - assert_equal :llvm, ENV.compiler - ENV.send MacOS.default_compiler - - f = TestMoreMixedCompilerFailures.new - assert !(f.fails_with? :clang) - assert f.fails_with? :llvm - assert f.fails_with? :gcc - cs = CompilerSelector.new(f) - cs.select_compiler - assert_equal :clang, ENV.compiler - ENV.send MacOS.default_compiler - - f = TestEvenMoreMixedCompilerFailures.new - assert f.fails_with? :clang - assert f.fails_with? :llvm - assert !(f.fails_with? :gcc) - cs = CompilerSelector.new(f) - cs.select_compiler - assert_equal :clang, ENV.compiler - ENV.send MacOS.default_compiler - - f = TestBlockWithoutBuildCompilerFailure.new - assert f.fails_with? :clang - assert !(f.fails_with? :llvm) - assert !(f.fails_with? :gcc) - cs = CompilerSelector.new(f) - cs.select_compiler - assert_equal MacOS.default_compiler, ENV.compiler - ENV.send MacOS.default_compiler - end end |
