| OLD | NEW |
| 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 Loading... |
| 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 } |
| OLD | NEW |