Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(105)

Unified Diff: tools/gn/runtime_deps_unittest.cc

Issue 1250883002: Count data deps even if it was already a regular dep (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: typo Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gn/runtime_deps.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/runtime_deps_unittest.cc
diff --git a/tools/gn/runtime_deps_unittest.cc b/tools/gn/runtime_deps_unittest.cc
index 0210b370c9e40b40f752034e4bda58e4677098fe..a674e5b82ed5d3b435af6bdd9348819ab75bed8c 100644
--- a/tools/gn/runtime_deps_unittest.cc
+++ b/tools/gn/runtime_deps_unittest.cc
@@ -240,3 +240,29 @@ TEST(RuntimeDeps, ActionOutputs) {
ASSERT_EQ(1u, result.size());
EXPECT_TRUE(MakePair("../../dep.data", &dep) == result[0]);
}
+
+// Tests that a dependency duplicated in regular and data deps is processed
+// as a data dep.
+TEST(RuntimeDeps, Dupe) {
+ TestWithScope setup;
+ Err err;
+
+ Target action(setup.settings(), Label(SourceDir("//"), "action"));
+ InitTargetWithType(setup, &action, Target::ACTION);
+ action.action_values().outputs() =
+ SubstitutionList::MakeForTest("//action.output");
+ ASSERT_TRUE(action.OnResolved(&err));
+
+ Target target(setup.settings(), Label(SourceDir("//"), "foo"));
+ InitTargetWithType(setup, &target, Target::EXECUTABLE);
+ target.private_deps().push_back(LabelTargetPair(&action));
+ target.data_deps().push_back(LabelTargetPair(&action));
+ ASSERT_TRUE(target.OnResolved(&err));
+
+ // The results should be the executable and the copy output.
+ std::vector<std::pair<OutputFile, const Target*>> result =
+ ComputeRuntimeDeps(&target);
+ EXPECT_TRUE(std::find(result.begin(), result.end(),
+ MakePair("../../action.output", &action)) !=
+ result.end()) << GetVectorDescription(result);
+}
« no previous file with comments | « tools/gn/runtime_deps.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698