aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test/test_dependency.rb
AgeCommit message (Collapse)Author
2015-12-17dependency: fix merging tags in 'merge_repeats'Martin Afanasjew
While it may suffice to merge string and non-reserved tags by forming a union of all tags of dependencies of the same name, this approach fails to work for the reserved tags. These are now merged such that the most restrictive tag (meaning sometimes an empty tag) is preserved. The previous behavior caused essential dependencies to be omitted and builds to fail in response. E.g., multiple `:fortran` dependencies with tags `[]`, `[:recommended]`, and `[:optional]` would have been expanded and merged to `"gcc"` with tags `[:recommended, :optional]`, causing it to be no longer seen as a required dependency. Closes Homebrew/homebrew#47040. Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2015-12-17tests: add (failing) tests for merging deps tagsMartin Afanasjew
The general idea is that merging multiple dependencies of the same name should produce the strictest tag instead of a (meaningless) union of the reserved tags. For example, if a dependency is both a `:recommended` and an `:optional` dependency at different points in the dependency tree, the resulting merged dependency should be tagged as `:recommended`. Handle all other reserved tags in the same spirit.
2015-12-15Allow multiple option_names in dep/reqs.Mike McQuaid
This means that dependencies can be merged but still maintain all their option names. Closes Homebrew/homebrew#46916. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-12-15test_dependency: add failing option names test.Mike McQuaid
This test will obviously fail but it does mark that the option names are not being merged correctly.
2015-12-15Add option_name tests.Mike McQuaid
2015-08-03Core files style updates.BrewTestBot
Closes Homebrew/homebrew#42354. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2014-11-21Fix dependency equalityJack Nagel
2014-07-03Add assert_eql to provide better failure messages for eql? testsJack Nagel
2014-06-18Use assert_predicateJack Nagel
2014-06-18Switch to MinitestJack Nagel
2014-06-18Use a custom test class so we can avoid monkeypatchingJack Nagel
2013-05-06Reduce allocations in dependency constructionJack Nagel
By always passing around a single, unnested array rather than splatting and then defensively flattening and compacting things, we can avoid allocating a bunch of unnecessary arrays. This gives a performance boost of roughly 4% when enumerating 2500 formulae, and has the side effect of cleaning up the dependency API.
2013-01-26Split dependency classes into separate filesJack Nagel
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-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.