Chromium Code Reviews| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "tools/gn/parser.h" | 8 #include "tools/gn/parser.h" |
| 9 #include "tools/gn/tokenizer.h" | 9 #include "tools/gn/tokenizer.h" |
| 10 | 10 |
| 11 static BuildSettings BuildSettingsWithBuildDir(const std::string& dir) { | |
| 12 BuildSettings build_settings; | |
| 13 build_settings.SetBuildDir(SourceDir(dir)); | |
| 14 return build_settings; | |
| 15 } | |
| 16 | |
| 11 TestWithScope::TestWithScope() | 17 TestWithScope::TestWithScope() |
| 12 : build_settings_(), | 18 : build_settings_(BuildSettingsWithBuildDir("//out/Debug/")), |
|
jbroman
2015/11/27 19:48:26
This is somewhat subtle, but the Settings construc
| |
| 13 settings_(&build_settings_, std::string()), | 19 settings_(&build_settings_, std::string()), |
| 14 toolchain_(&settings_, Label(SourceDir("//toolchain/"), "default")), | 20 toolchain_(&settings_, Label(SourceDir("//toolchain/"), "default")), |
| 15 scope_(&settings_), | 21 scope_(&settings_), |
| 16 scope_progammatic_provider_(&scope_, true) { | 22 scope_progammatic_provider_(&scope_, true) { |
| 17 build_settings_.SetBuildDir(SourceDir("//out/Debug/")); | |
| 18 build_settings_.set_print_callback( | 23 build_settings_.set_print_callback( |
| 19 base::Bind(&TestWithScope::AppendPrintOutput, base::Unretained(this))); | 24 base::Bind(&TestWithScope::AppendPrintOutput, base::Unretained(this))); |
| 20 | 25 |
| 21 settings_.set_toolchain_label(toolchain_.label()); | 26 settings_.set_toolchain_label(toolchain_.label()); |
| 22 settings_.set_default_toolchain_label(toolchain_.label()); | 27 settings_.set_default_toolchain_label(toolchain_.label()); |
| 23 | 28 |
| 24 SetupToolchain(&toolchain_); | 29 SetupToolchain(&toolchain_); |
| 25 } | 30 } |
| 26 | 31 |
| 27 TestWithScope::~TestWithScope() { | 32 TestWithScope::~TestWithScope() { |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 160 const std::string& label_string, | 165 const std::string& label_string, |
| 161 Target::OutputType type) | 166 Target::OutputType type) |
| 162 : Target(setup.settings(), setup.ParseLabel(label_string)) { | 167 : Target(setup.settings(), setup.ParseLabel(label_string)) { |
| 163 visibility().SetPublic(); | 168 visibility().SetPublic(); |
| 164 set_output_type(type); | 169 set_output_type(type); |
| 165 SetToolchain(setup.toolchain()); | 170 SetToolchain(setup.toolchain()); |
| 166 } | 171 } |
| 167 | 172 |
| 168 TestTarget::~TestTarget() { | 173 TestTarget::~TestTarget() { |
| 169 } | 174 } |
| OLD | NEW |