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

Side by Side Diff: tools/gn/ninja_copy_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, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <algorithm> 5 #include <algorithm>
6 #include <sstream> 6 #include <sstream>
7 7
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 #include "tools/gn/ninja_copy_target_writer.h" 9 #include "tools/gn/ninja_copy_target_writer.h"
10 #include "tools/gn/target.h" 10 #include "tools/gn/target.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 SubstitutionList::MakeForTest("//out/Debug/{{source_name_part}}.out"); 83 SubstitutionList::MakeForTest("//out/Debug/{{source_name_part}}.out");
84 target.inputs().push_back(SourceFile("//foo/script.py")); 84 target.inputs().push_back(SourceFile("//foo/script.py"));
85 target.SetToolchain(setup.toolchain()); 85 target.SetToolchain(setup.toolchain());
86 ASSERT_TRUE(target.OnResolved(&err)); 86 ASSERT_TRUE(target.OnResolved(&err));
87 87
88 std::ostringstream out; 88 std::ostringstream out;
89 NinjaCopyTargetWriter writer(&target, out); 89 NinjaCopyTargetWriter writer(&target, out);
90 writer.Run(); 90 writer.Run();
91 91
92 const char expected_linux[] = 92 const char expected_linux[] =
93 "build obj/foo/bar.inputdeps.stamp: stamp ../../foo/script.py\n" 93 "build input1.out: copy ../../foo/input1.txt || ../../foo/script.py\n"
94 "build input1.out: copy ../../foo/input1.txt || "
95 "obj/foo/bar.inputdeps.stamp\n"
96 "\n" 94 "\n"
97 "build obj/foo/bar.stamp: stamp input1.out\n"; 95 "build obj/foo/bar.stamp: stamp input1.out\n";
98 std::string out_str = out.str(); 96 std::string out_str = out.str();
99 EXPECT_EQ(expected_linux, out_str); 97 EXPECT_EQ(expected_linux, out_str);
100 } 98 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698