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

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

Issue 551703002: Fix group datadeps (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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_group_target_writer.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "testing/gtest/include/gtest/gtest.h"
6 #include "tools/gn/ninja_group_target_writer.h"
7 #include "tools/gn/target.h"
8 #include "tools/gn/test_with_scope.h"
9
10 TEST(NinjaGroupTargetWriter, Run) {
11 TestWithScope setup;
12 Err err;
13
14 setup.build_settings()->SetBuildDir(SourceDir("//out/Debug/"));
15 Target target(setup.settings(), Label(SourceDir("//foo/"), "bar"));
16
17 target.set_output_type(Target::GROUP);
18
19 Target dep(setup.settings(), Label(SourceDir("//foo/"), "dep"));
20 dep.set_output_type(Target::ACTION);
21 dep.SetToolchain(setup.toolchain());
22 ASSERT_TRUE(dep.OnResolved(&err));
23
24 Target dep2(setup.settings(), Label(SourceDir("//foo/"), "dep2"));
25 dep2.set_output_type(Target::ACTION);
26 dep2.SetToolchain(setup.toolchain());
27 ASSERT_TRUE(dep2.OnResolved(&err));
28
29 Target datadep(setup.settings(), Label(SourceDir("//foo/"), "datadep"));
30 datadep.set_output_type(Target::ACTION);
31 datadep.SetToolchain(setup.toolchain());
32 ASSERT_TRUE(datadep.OnResolved(&err));
33
34 target.deps().push_back(LabelTargetPair(&dep));
35 target.deps().push_back(LabelTargetPair(&dep2));
36 target.datadeps().push_back(LabelTargetPair(&datadep));
37
38 target.SetToolchain(setup.toolchain());
39 ASSERT_TRUE(target.OnResolved(&err));
40
41 std::ostringstream out;
42 NinjaGroupTargetWriter writer(&target, out);
43 writer.Run();
44
45 const char expected[] =
46 "build obj/foo/bar.stamp: stamp obj/foo/dep.stamp obj/foo/dep2.stamp || ob j/foo/datadep.stamp\n";
47 EXPECT_EQ(expected, out.str());
48 }
OLDNEW
« no previous file with comments | « tools/gn/ninja_group_target_writer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698