| 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 "tools/gn/test_with_scope.h" | 5 #include "tools/gn/test_with_scope.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "tools/gn/parser.h" | 10 #include "tools/gn/parser.h" |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 // STAMP | 131 // STAMP |
| 132 scoped_ptr<Tool> stamp_tool(new Tool); | 132 scoped_ptr<Tool> stamp_tool(new Tool); |
| 133 SetCommandForTool("touch {{output}}", stamp_tool.get()); | 133 SetCommandForTool("touch {{output}}", stamp_tool.get()); |
| 134 toolchain->SetTool(Toolchain::TYPE_STAMP, std::move(stamp_tool)); | 134 toolchain->SetTool(Toolchain::TYPE_STAMP, std::move(stamp_tool)); |
| 135 | 135 |
| 136 // COPY | 136 // COPY |
| 137 scoped_ptr<Tool> copy_tool(new Tool); | 137 scoped_ptr<Tool> copy_tool(new Tool); |
| 138 SetCommandForTool("cp {{source}} {{output}}", copy_tool.get()); | 138 SetCommandForTool("cp {{source}} {{output}}", copy_tool.get()); |
| 139 toolchain->SetTool(Toolchain::TYPE_COPY, std::move(copy_tool)); | 139 toolchain->SetTool(Toolchain::TYPE_COPY, std::move(copy_tool)); |
| 140 | 140 |
| 141 // COPY_BUNDLE_DATA |
| 142 scoped_ptr<Tool> copy_bundle_data_tool(new Tool); |
| 143 SetCommandForTool("cp {{source}} {{output}}", copy_bundle_data_tool.get()); |
| 144 toolchain->SetTool(Toolchain::TYPE_COPY_BUNDLE_DATA, |
| 145 std::move(copy_bundle_data_tool)); |
| 146 |
| 141 toolchain->ToolchainSetupComplete(); | 147 toolchain->ToolchainSetupComplete(); |
| 142 } | 148 } |
| 143 | 149 |
| 144 // static | 150 // static |
| 145 void TestWithScope::SetCommandForTool(const std::string& cmd, Tool* tool) { | 151 void TestWithScope::SetCommandForTool(const std::string& cmd, Tool* tool) { |
| 146 Err err; | 152 Err err; |
| 147 SubstitutionPattern command; | 153 SubstitutionPattern command; |
| 148 command.Parse(cmd, nullptr, &err); | 154 command.Parse(cmd, nullptr, &err); |
| 149 CHECK(!err.has_error()) | 155 CHECK(!err.has_error()) |
| 150 << "Couldn't parse \"" << cmd << "\", " << "got " << err.message(); | 156 << "Couldn't parse \"" << cmd << "\", " << "got " << err.message(); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 171 const std::string& label_string, | 177 const std::string& label_string, |
| 172 Target::OutputType type) | 178 Target::OutputType type) |
| 173 : Target(setup.settings(), setup.ParseLabel(label_string)) { | 179 : Target(setup.settings(), setup.ParseLabel(label_string)) { |
| 174 visibility().SetPublic(); | 180 visibility().SetPublic(); |
| 175 set_output_type(type); | 181 set_output_type(type); |
| 176 SetToolchain(setup.toolchain()); | 182 SetToolchain(setup.toolchain()); |
| 177 } | 183 } |
| 178 | 184 |
| 179 TestTarget::~TestTarget() { | 185 TestTarget::~TestTarget() { |
| 180 } | 186 } |
| OLD | NEW |