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

Unified Diff: tools/gn/ninja_target_writer_unittest.cc

Issue 1663813003: GN: Don't write stamp files for one rule. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
« tools/gn/ninja_target_writer.cc ('K') | « tools/gn/ninja_target_writer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/ninja_target_writer_unittest.cc
diff --git a/tools/gn/ninja_target_writer_unittest.cc b/tools/gn/ninja_target_writer_unittest.cc
index e46471a5eaafa6ca5a2b1523bae2357fb99e75f2..ccb9c7a3cebb81b4d76c6550bc918552ca1a8348 100644
--- a/tools/gn/ninja_target_writer_unittest.cc
+++ b/tools/gn/ninja_target_writer_unittest.cc
@@ -72,10 +72,10 @@ TEST(NinjaTargetWriter, WriteInputDepsStampAndGetDep) {
OutputFile dep =
writer.WriteInputDepsStampAndGetDep(std::vector<const Target*>());
- EXPECT_EQ("obj/foo/base.inputdeps.stamp", dep.value());
- EXPECT_EQ("build obj/foo/base.inputdeps.stamp: stamp "
- "../../foo/script.py\n",
- stream.str());
+ // Since there is only one dependency, it should just be returned and
+ // nothing written to the stream.
+ EXPECT_EQ("../../foo/script.py", dep.value());
+ EXPECT_EQ("", stream.str());
}
// Input deps for the target (should depend on the base).
@@ -85,6 +85,8 @@ TEST(NinjaTargetWriter, WriteInputDepsStampAndGetDep) {
OutputFile dep =
writer.WriteInputDepsStampAndGetDep(std::vector<const Target*>());
+ // Since there is more than one dependency, a stamp file will be returned
+ // and the rule for the stamp file will be written to the stream.
EXPECT_EQ("obj/foo/target.inputdeps.stamp", dep.value());
EXPECT_EQ("build obj/foo/target.inputdeps.stamp: stamp "
"../../foo/input.txt obj/foo/base.stamp\n",
@@ -133,8 +135,8 @@ TEST(NinjaTargetWriter, WriteInputDepsStampAndGetDepWithToolchainDeps) {
OutputFile dep =
writer.WriteInputDepsStampAndGetDep(std::vector<const Target*>());
- EXPECT_EQ("obj/foo/target.inputdeps.stamp", dep.value());
- EXPECT_EQ("build obj/foo/target.inputdeps.stamp: stamp "
- "obj/foo/setup.stamp\n",
- stream.str());
+ // Since there is more than one dependency, a stamp file will be returned
+ // and the rule for the stamp file will be written to the stream.
+ EXPECT_EQ("obj/foo/setup.stamp", dep.value());
+ EXPECT_EQ("", stream.str());
}
« tools/gn/ninja_target_writer.cc ('K') | « tools/gn/ninja_target_writer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698