aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test
AgeCommit message (Collapse)Author
2013-01-28DependencyCollector: return created dep from #addJack Nagel
2013-01-28Allow specifying a name attribute for X11DependencyJack Nagel
2013-01-27Update requireJack Nagel
2013-01-26Split dependency classes into separate filesJack Nagel
2013-01-26Fix Dependencies -> Array conversionJack Nagel
2013-01-26Tag Xcode and CLT requirements as build-timeJack Nagel
This way they can be skipped when installing bottles.
2013-01-26FormulaInstaller: construct new ARGV from an Options collectionJack Nagel
The array of options that is passed to the spawned build process is a combination of the current ARGV, options passed in by a dependent formula, and an existing install receipt. The objects that are interacting here each expect the resulting collection to have certain properties, and the expectations are not consistent. Clear up this confusing mess by only dealing with Options collections. This keeps our representation of options uniform across the codebase. We can remove BuildOptions dependency on HomebrewArgvExtension, which allows us to pass any Array-like collection to Tab.create. The only other site inside of FormulaInstaller that uses the array is the #exec call, and there it is splatted and thus we can substitute our Options collection there as well.
2013-01-26FormulaInstaller: allow formulae to pass options to depsJack Nagel
Formulae can now pass build options to dependencies. The following syntax is supported: depends_on 'foo' => 'with-bar' depends_on 'foo' => ['with-bar', 'with-baz'] If a dependency is already installed but lacks the required build options, an exception is raised. Eventually we may be able to just stash the existing keg and reinstall it with the combined set of used_options and passed options, but enabling that is left for another day.
2013-01-26Add support for optional and recommended depsAdam Vandenberg
Optional deps are not installed by default but generate a corresponding "with-foo" option for the formula. Recommended deps _are_ installed by default, and generate a corresponding "without-foo" option.
2013-01-26Tests for BuildOptionsJack Nagel
2013-01-26Refactor option handling internalsJack Nagel
Currently we handle options in several ways, and it is hard to remember what code needs an option string ("--foo"), what needs only the name ("foo") and what needs an Option object. Now that Option objects can act as strings and be converted to JSON, we can start using them instead of passing around strings between Formula objects, Tab objects, and ARGV-style arrays. The Options class is a special collection that can be queried for the inclusion of options in any form: '--foo', 'foo', or Option.new("foo").
2013-01-26brew-test: use SHA-1 in all testballs.Mike McQuaid
2013-01-22Infer path to be added for requirements that search PATHJack Nagel
When a requirement is specified like: satisfy { which "foo" } There is no reason that we should inject all of ENV.userpaths! into the build environment. Instead, infer the directory to be added to PATH from the Pathname that is returned. This is another step towards condensing the "which program" requirements down into a one-liner DSL element.
2013-01-22requirements: enable userpaths by default during evaluationJack Nagel
2013-01-22Add tests for ARGV.filter_for_dependenciesJack Nagel
2013-01-22Add tests for ENV.with_build_environmentJack Nagel
2013-01-21Allow satisfied? to be specified in a blockJack Nagel
Instead of overriding #satisfied?, Requirement subclasses can specify the condition in a block: satisfy do some_condition? end The contents of the block are evaluated in the context of the instance, and so have access to instance variables and instance methods as before. Additionally, it is wrapped in an ENV.with_build_environment block. This can be disabled by passing :build_env => false to satisfy: satisfy :build_env => false do some_condition? end
2013-01-21Object#instance_exec for Ruby 1.8.6Jack Nagel
Not thread safe! But I don't think we care. We want to evaluate the env DSL block in the context of ENV for asthetic reasons, but we also want access to methods on the requirement instance. We can use #instance_exec to pass the requirement itself into the block: class Foo < Requirement env do |req| append 'PATH', req.some_path end def some_path which 'something' end end Also add a simplified version of Object#instance_exec for Ruby 1.8.6.
2013-01-21Allow env DSL to take a blockJack Nagel
In addition to env :userpaths env :std requirements can now do env do append 'PATH', '/some/path/to/bin' # and more end
2013-01-21ENV.with_build_environmentJack Nagel
2013-01-21tests: add mocha mocking libraryJack Nagel
2013-01-17Fix JSON smoke testJack Nagel
- Simplify encoding example because hashes are unordered. - Fix broken require
2013-01-17Update multi_json to 1.5.0Jack Nagel
This contains updates to the OkJson library that allow objects to define to_json for serialization, and this will be used in the upcoming options and deps work.
2013-01-15Tests for Requirement DSLJack Nagel
2013-01-15Tests for BuildEnvironmentJack Nagel
2013-01-13Split up dependency test coverageJack Nagel
The DependencyCollector tests are really integration tests, while the rest are closer to real unit tests. Split them up so that the tests can be run in isolation on a per-class basis.
2013-01-13Remove <=> from Dependency interfaceJack Nagel
It is important that dep equality corresponds to the name attribute, but we may want to use the Comparable interface to sort them by installation order in the future. Code that needs to sort them alphabetically should just use sort_by.
2013-01-12Beef up deps testsJack Nagel
2013-01-12Define HOMEBREW_LIBRARY for testsJack Nagel
2013-01-07Remove Array subclassingJack Nagel
Inheriting from Array (and other core types) is problematic: - It exposes a very wide interface with many methods that are not really relevant to the subclass. - It can cause some weird side effects, as many Array operations are in C and have hardcoded return values; for example, combining two array subclasses returns a new Array instead of the subclass. Avoid these problems using delegation and the Enumerable module where applicable.
2013-01-01Add Apache version style test.Mike McQuaid
2012-12-16Add another Erlang version format.Mike McQuaid
2012-12-01Fix broken `brew cleanup` testsJack Nagel
2012-11-17tests: add profiling supportJack Nagel
`rake profile` will run ruby-prof on the test suite if the ruby-prof gem is installed.
2012-10-25tests: define assert_empty for Ruby <= 1.8Jack Nagel
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-10-25ComparableSet#merge returns selfJack Nagel
Set#merge is supposed to return self, and Formula#recursive_requirements depended on this being true. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-10-25test_cleaner: add missing requireJack Nagel
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-10-25Allow requirements to record tagsJack Nagel
To allow depends_on :x11 => :optional and friends to work as expected, make requirements record any tags and add special handling to the X11Dependency to record both a minimum version and additional tags. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-10-23Fix Keg testsMisty De Meo
* unreverse expected/actuals * don't assume linked file order is guaranteed - it wasn't!
2012-10-20brew ln --force is now brew ln --overwriteMisty De Meo
* Renames --force to --overwrite, freeing up brew ln --force for Homebrew/homebrew#13349 * Changes --dry-run to preview linking by default, rather than overwriting. An overwrite dry-run can be simulated via both --dry-run --overwrite * Adds some basic Keg tests
2012-10-16Add Jenkins version matching (and test).Mike McQuaid
2012-10-15Test coverage for DownloadStrategyDetectorJack Nagel
While at it, make it use class methods instead; no reason to instantiate an object for this. Eventually there should be some functional tests for the individual strategies as well. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-10-15Manage Requirements using ComparableSetMisty De Meo
ComparableSet only allows a single object of a given class, choosing the object with the greatest value. This was mainly created for Requirements, so that, e.g., two X11Dependencies of differing strictness don't both end up in the same requirement set. Fixes Homebrew/homebrew#15240.
2012-09-29tests: set newly-visible global constantsJack Nagel
The changes to error ouput and logging require a few more things to be visible during installation tests. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-09-27test_bucket: don't try to clean a non-existent kegJack Nagel
It is a no-op under Ruby 1.8 but Pathname#find raises ENOENT if the directory doesn't exist under 1.9. But we really shouldn't try to clean a non-existent keg anyway, and FormulaInstaller will have bailed out long before the clean step if the keg doesn't exist, so lets just not even test this condition; the cleaner has its own tests anyway. Alternatively we can adjust the cleaner to handle this case, but I don't see much value in that. n.b. with this, the tests now pass under 1.9.3 (for me), which is nice because I often run them on that version inadvertently. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-09-27Adjust test expectation for 'LD'Jack Nagel
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-09-27Make FileUtils extension available globallyJack Nagel
Now that we are monkeypatching copy_metadata, we should load our extension up front for consistency. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-09-03Stop warning in ENV.x11Jack Nagel
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-08-30tests: avoid unnecessary chdirJack Nagel
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-29tests: support "rake rcov" if rcov is installedJack Nagel
If the rcov gem is installed, `rake rcov` will generate a test coverage report in the coverage directory. I picked rcov because it is 1.8 compatible. But it could easily be swapped out for another coverage tool. Signed-off-by: Jack Nagel <jacknagel@gmail.com>