Index: tools/gn/target_unittest.cc |
diff --git a/tools/gn/target_unittest.cc b/tools/gn/target_unittest.cc |
index f4acacac226942691e7f4e8dc36b32c64a9ef186..426243ece8ccc14479f847d6902f405c028325e3 100644 |
--- a/tools/gn/target_unittest.cc |
+++ b/tools/gn/target_unittest.cc |
@@ -234,6 +234,31 @@ TEST(Target, InheritCompleteStaticLibNoIheritedStaticLibDeps) { |
ASSERT_FALSE(a.OnResolved(&err)); |
} |
+TEST(Target, NoActionDepPropgation) { |
+ TestWithScope setup; |
+ Err err; |
+ |
+ // Create a dependency chain: |
+ // A (exe) -> B (action) -> C (source_set) |
+ { |
+ TestTarget a(setup, "//foo:a", Target::EXECUTABLE); |
+ TestTarget b(setup, "//foo:b", Target::ACTION); |
+ TestTarget c(setup, "//foo:c", Target::SOURCE_SET); |
+ |
+ a.private_deps().push_back(LabelTargetPair(&b)); |
+ b.private_deps().push_back(LabelTargetPair(&c)); |
+ |
+ ASSERT_TRUE(c.OnResolved(&err)); |
+ ASSERT_TRUE(b.OnResolved(&err)); |
+ ASSERT_TRUE(a.OnResolved(&err)); |
+ |
+ // The executable should not have inherited the source set across the |
+ // action. |
+ std::vector<const Target*> libs = a.inherited_libraries().GetOrdered(); |
+ ASSERT_TRUE(libs.empty()); |
+ } |
+} |
+ |
TEST(Target, GetComputedOutputName) { |
TestWithScope setup; |
Err err; |