aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test/test_dependency_expansion.rb
diff options
context:
space:
mode:
authorJack Nagel2013-11-13 10:38:14 -0600
committerJack Nagel2013-11-13 10:38:14 -0600
commitfdfc54961eb497b6dd854852dc604cb50c994fda (patch)
tree57dea1135fc65eab085cbf77e80a7f4cb9915eb7 /Library/Homebrew/test/test_dependency_expansion.rb
parent4715b3c93616395bdca30c6ed8fc65b5525c3941 (diff)
downloadhomebrew-fdfc54961eb497b6dd854852dc604cb50c994fda.tar.bz2
Prevent deps of build-time deps from leaking into the build environment
When decided what dependencies should be part of the build environment (and have appropriate entries added to variables like PKG_CONFIG_PATH), we select the entire dependency tree except for (1) inactive optional and recommended deps (2) indirect build-time deps (i.e., build-time deps of other deps) There is a third category that sould be excluded: dependencies of direct build-time deps. These are irrelevant to the build, and including them can cause unexpected linkages.
Diffstat (limited to 'Library/Homebrew/test/test_dependency_expansion.rb')
-rw-r--r--Library/Homebrew/test/test_dependency_expansion.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/Library/Homebrew/test/test_dependency_expansion.rb b/Library/Homebrew/test/test_dependency_expansion.rb
index 90d4dcc36..cf22b6170 100644
--- a/Library/Homebrew/test/test_dependency_expansion.rb
+++ b/Library/Homebrew/test/test_dependency_expansion.rb
@@ -95,4 +95,17 @@ class DependencyExpansionTests < Test::Unit::TestCase
assert_equal [@bar, @baz], deps
end
+
+ def test_keep_dep_but_prune_recursive_deps
+ f = stub(:deps => [
+ build_dep(:foo, [:build], [@bar]),
+ build_dep(:baz, [:build]),
+ ])
+
+ deps = Dependency.expand(f) do |dependent, dep|
+ Dependency.keep_but_prune_recursive_deps if dep.build?
+ end
+
+ assert_equal [@foo, @baz], deps
+ end
end