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

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

Issue 2101923006: Fix BundleData::GetBundleRootDirOutput() for non-default toolchain. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@create-bundle-deps
Patch Set: Rebase. Created 4 years, 5 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
« no previous file with comments | « tools/gn/ninja_create_bundle_target_writer_unittest.cc ('k') | tools/gn/test_with_scope.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/ninja_group_target_writer.h" 6 #include "tools/gn/ninja_group_target_writer.h"
7 #include "tools/gn/target.h" 7 #include "tools/gn/target.h"
8 #include "tools/gn/test_with_scope.h" 8 #include "tools/gn/test_with_scope.h"
9 9
10 TEST(NinjaGroupTargetWriter, Run) { 10 TEST(NinjaGroupTargetWriter, Run) {
11 Err err;
11 TestWithScope setup; 12 TestWithScope setup;
12 Err err;
13 13
14 setup.build_settings()->SetBuildDir(SourceDir("//out/Debug/"));
15 Target target(setup.settings(), Label(SourceDir("//foo/"), "bar")); 14 Target target(setup.settings(), Label(SourceDir("//foo/"), "bar"));
16
17 target.set_output_type(Target::GROUP); 15 target.set_output_type(Target::GROUP);
18 target.visibility().SetPublic(); 16 target.visibility().SetPublic();
19 17
20 Target dep(setup.settings(), Label(SourceDir("//foo/"), "dep")); 18 Target dep(setup.settings(), Label(SourceDir("//foo/"), "dep"));
21 dep.set_output_type(Target::ACTION); 19 dep.set_output_type(Target::ACTION);
22 dep.visibility().SetPublic(); 20 dep.visibility().SetPublic();
23 dep.SetToolchain(setup.toolchain()); 21 dep.SetToolchain(setup.toolchain());
24 ASSERT_TRUE(dep.OnResolved(&err)); 22 ASSERT_TRUE(dep.OnResolved(&err));
25 23
26 Target dep2(setup.settings(), Label(SourceDir("//foo/"), "dep2")); 24 Target dep2(setup.settings(), Label(SourceDir("//foo/"), "dep2"));
(...skipping 16 matching lines...) Expand all
43 ASSERT_TRUE(target.OnResolved(&err)); 41 ASSERT_TRUE(target.OnResolved(&err));
44 42
45 std::ostringstream out; 43 std::ostringstream out;
46 NinjaGroupTargetWriter writer(&target, out); 44 NinjaGroupTargetWriter writer(&target, out);
47 writer.Run(); 45 writer.Run();
48 46
49 const char expected[] = 47 const char expected[] =
50 "build obj/foo/bar.stamp: stamp obj/foo/dep.stamp obj/foo/dep2.stamp || ob j/foo/datadep.stamp\n"; 48 "build obj/foo/bar.stamp: stamp obj/foo/dep.stamp obj/foo/dep2.stamp || ob j/foo/datadep.stamp\n";
51 EXPECT_EQ(expected, out.str()); 49 EXPECT_EQ(expected, out.str());
52 } 50 }
OLDNEW
« no previous file with comments | « tools/gn/ninja_create_bundle_target_writer_unittest.cc ('k') | tools/gn/test_with_scope.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698