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

Side by Side Diff: tools/gn/builder_unittest.cc

Issue 318383003: Improve error messages and reporting in GN (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « tools/gn/builder.cc ('k') | tools/gn/input_file_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "testing/gtest/include/gtest/gtest.h" 5 #include "testing/gtest/include/gtest/gtest.h"
6 #include "tools/gn/builder.h" 6 #include "tools/gn/builder.h"
7 #include "tools/gn/loader.h" 7 #include "tools/gn/loader.h"
8 #include "tools/gn/target.h" 8 #include "tools/gn/target.h"
9 #include "tools/gn/test_with_scope.h" 9 #include "tools/gn/test_with_scope.h"
10 #include "tools/gn/toolchain.h" 10 #include "tools/gn/toolchain.h"
11 11
12 namespace { 12 namespace {
13 13
14 class MockLoader : public Loader { 14 class MockLoader : public Loader {
15 public: 15 public:
16 MockLoader() { 16 MockLoader() {
17 } 17 }
18 18
19 // Loader implementation: 19 // Loader implementation:
20 virtual void Load(const SourceFile& file, 20 virtual void Load(const SourceFile& file,
21 const LocationRange& origin,
21 const Label& toolchain_name) OVERRIDE { 22 const Label& toolchain_name) OVERRIDE {
22 files_.push_back(file); 23 files_.push_back(file);
23 } 24 }
24 virtual void ToolchainLoaded(const Toolchain* toolchain) OVERRIDE { 25 virtual void ToolchainLoaded(const Toolchain* toolchain) OVERRIDE {
25 } 26 }
26 virtual Label GetDefaultToolchain() const OVERRIDE { 27 virtual Label GetDefaultToolchain() const OVERRIDE {
27 return Label(); 28 return Label();
28 } 29 }
29 virtual const Settings* GetToolchainSettings( 30 virtual const Settings* GetToolchainSettings(
30 const Label& label) const OVERRIDE { 31 const Label& label) const OVERRIDE {
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 a->set_output_type(Target::EXECUTABLE); 207 a->set_output_type(Target::EXECUTABLE);
207 builder_->ItemDefined(scoped_ptr<Item>(a)); 208 builder_->ItemDefined(scoped_ptr<Item>(a));
208 209
209 // A should have the generate bit set since it's in the default toolchain. 210 // A should have the generate bit set since it's in the default toolchain.
210 BuilderRecord* a_record = builder_->GetRecord(a_label); 211 BuilderRecord* a_record = builder_->GetRecord(a_label);
211 EXPECT_TRUE(a_record->should_generate()); 212 EXPECT_TRUE(a_record->should_generate());
212 213
213 // It should have gotten pushed to B. 214 // It should have gotten pushed to B.
214 EXPECT_TRUE(b_record->should_generate()); 215 EXPECT_TRUE(b_record->should_generate());
215 } 216 }
OLDNEW
« no previous file with comments | « tools/gn/builder.cc ('k') | tools/gn/input_file_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698