2010-03-02 22:54:12 -08:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class TestBall <Formula
|
|
|
|
# name parameter required for some Formula::factory
|
|
|
|
def initialize name=nil
|
2010-06-10 13:09:30 -07:00
|
|
|
@url="file:///#{TEST_FOLDER}/tarballs/testball-0.1.tbz"
|
2010-03-02 22:54:12 -08:00
|
|
|
@homepage = 'http://example.com/'
|
|
|
|
super "testball"
|
|
|
|
end
|
|
|
|
def install
|
|
|
|
prefix.install "bin"
|
|
|
|
prefix.install "libexec"
|
|
|
|
end
|
|
|
|
end
|
2010-04-03 08:44:41 -07:00
|
|
|
|
2012-04-13 21:47:33 -05:00
|
|
|
class TestBallWithRealPath < TestBall
|
|
|
|
def initialize name=nil
|
|
|
|
super "testballwithrealpath"
|
|
|
|
@path = Pathname.new(__FILE__)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2011-09-16 11:04:12 -07:00
|
|
|
class TestBallWithMirror < Formula
|
|
|
|
# `url` is bogus---curl should fail to download it. The mirror is fine
|
|
|
|
# though.
|
|
|
|
url "file:///#{TEST_FOLDER}/bad_url/testball-0.1.tbz"
|
|
|
|
mirror "file:///#{TEST_FOLDER}/tarballs/testball-0.1.tbz"
|
|
|
|
|
|
|
|
def initialize name=nil
|
|
|
|
@homepage = 'http://example.com/'
|
|
|
|
super "testballwithmirror"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2010-04-03 08:44:41 -07:00
|
|
|
class ConfigureFails <Formula
|
|
|
|
# name parameter required for some Formula::factory
|
|
|
|
def initialize name=nil
|
2010-06-10 13:09:30 -07:00
|
|
|
@url="file:///#{TEST_FOLDER}/tarballs/configure_fails.tar.gz"
|
2010-04-03 08:44:41 -07:00
|
|
|
@homepage = 'http://example.com/'
|
|
|
|
@version = '1.0.0'
|
|
|
|
@md5 = '9385e1b68ab8af68ac2c35423443159b'
|
|
|
|
super "configurefails"
|
|
|
|
end
|
|
|
|
|
|
|
|
def install
|
|
|
|
system "./configure"
|
|
|
|
end
|
|
|
|
end
|
2012-03-18 13:58:13 -05:00
|
|
|
|
2012-04-07 13:29:40 -05:00
|
|
|
class TestCompilerFailures < Formula
|
2012-03-18 13:58:13 -05:00
|
|
|
def initialize name=nil
|
|
|
|
@url="file:///#{TEST_FOLDER}/tarballs/testball-0.1.tbz"
|
|
|
|
@homepage = 'http://example.com/'
|
|
|
|
super "compilerfailures"
|
|
|
|
end
|
2012-04-07 13:29:40 -05:00
|
|
|
end
|
2012-03-18 13:58:13 -05:00
|
|
|
|
2012-04-07 13:29:40 -05:00
|
|
|
class TestAllCompilerFailures < TestCompilerFailures
|
2012-03-18 13:58:13 -05:00
|
|
|
fails_with :clang
|
|
|
|
fails_with :llvm
|
|
|
|
fails_with :gcc
|
|
|
|
end
|
|
|
|
|
2012-04-07 13:29:40 -05:00
|
|
|
class TestNoCompilerFailures < TestCompilerFailures
|
2012-03-18 13:58:13 -05:00
|
|
|
fails_with(:clang) { build 42 }
|
|
|
|
fails_with(:llvm) { build 42 }
|
|
|
|
fails_with(:gcc) { build 42 }
|
|
|
|
end
|
|
|
|
|
2012-04-07 13:29:40 -05:00
|
|
|
class TestLLVMFailure < TestCompilerFailures
|
2012-03-18 13:58:13 -05:00
|
|
|
fails_with :llvm
|
|
|
|
end
|
|
|
|
|
2012-04-07 13:29:40 -05:00
|
|
|
class TestMixedCompilerFailures < TestCompilerFailures
|
2012-03-18 13:58:13 -05:00
|
|
|
fails_with(:clang) { build MacOS.clang_build_version }
|
|
|
|
fails_with(:llvm) { build 42 }
|
|
|
|
fails_with(:gcc) { build 5666 }
|
|
|
|
end
|
|
|
|
|
2012-04-07 13:29:40 -05:00
|
|
|
class TestMoreMixedCompilerFailures < TestCompilerFailures
|
2012-03-18 13:58:13 -05:00
|
|
|
fails_with(:clang) { build 42 }
|
|
|
|
fails_with(:llvm) { build 2336 }
|
|
|
|
fails_with(:gcc) { build 5666 }
|
|
|
|
end
|
|
|
|
|
2012-04-07 13:29:40 -05:00
|
|
|
class TestEvenMoreMixedCompilerFailures < TestCompilerFailures
|
2012-03-18 13:58:13 -05:00
|
|
|
fails_with :clang
|
|
|
|
fails_with(:llvm) { build 2336 }
|
|
|
|
fails_with(:gcc) { build 5648 }
|
|
|
|
end
|
|
|
|
|
2012-04-07 13:29:40 -05:00
|
|
|
class TestBlockWithoutBuildCompilerFailure < TestCompilerFailures
|
2012-03-18 13:58:13 -05:00
|
|
|
fails_with :clang do
|
|
|
|
cause "failure"
|
|
|
|
end
|
|
|
|
end
|